@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500&family=Inter:wght@400;500&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #04090c;
  --bg-2: #061219;
  --panel: #0a1418;
  --panel-2: #0d1b21;
  --raised: #10242b;
  --surface: var(--panel);
  --surface-2: var(--panel-2);

  /* text */
  --ink: #eef7f9;
  --text: #dcedf0;
  --muted: #8fadb4;
  --faint: #5f7d85;

  /* lines */
  --line: rgba(140, 220, 214, 0.13);
  --line-strong: rgba(140, 220, 214, 0.26);
  --line-soft: rgba(140, 220, 214, 0.07);

  /* Deepwater accent + legacy aliases so existing markup keeps working */
  --accent: #2fd4c2;
  --accent-strong: #6ab8ff;
  --accent-tint: rgba(47, 212, 194, 0.11);
  --accent-line: rgba(47, 212, 194, 0.44);
  --violet: var(--accent);
  --violet-2: var(--accent-strong);
  --mint: var(--accent);
  --mint-2: var(--accent-strong);
  --gold: var(--accent);
  --gold-soft: var(--accent-tint);
  --gold-line: var(--accent-line);

  /* supporting hues */
  --cyan: #6ab8ff;
  --green: #57d99a;
  --amber: #6ab8ff;
  --danger: #ff7d8a;

  /* page-only pulse stops */
  --pulse-bg: #04090c;
  --pulse-lift: #061219;
  --pulse-edge: #083038;
  --pulse-edge-rgb: 8, 48, 56;
  --pulse-accent-rgb: 47, 212, 194;
  --pulse-third-rgb: 106, 184, 255;
  --pulse-purple-rgb: 54, 31, 94;

  /* chrome + elevation */
  --chrome-bg: rgba(4, 9, 12, 0.84);
  --shadow: rgba(0, 0, 0, 0.58);
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.48), 0 2px 8px rgba(0, 0, 0, 0.3);
  --elev-2: 0 8px 24px rgba(0, 0, 0, 0.46), 0 2px 6px rgba(0, 0, 0, 0.34);
  --elev-3: 0 24px 60px rgba(0, 0, 0, 0.62), 0 8px 20px rgba(0, 0, 0, 0.42);
  --glow-accent: 0 0 0 1px rgba(47, 212, 194, 0.28), 0 10px 34px rgba(47, 212, 194, 0.12);
  --ring: 0 0 0 3px var(--accent-tint), 0 0 0 1px var(--accent);

  /* radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-pill: 999px;
  --radius: var(--radius-md);

  /* touch */
  --touch: 44px;
  --touch-lg: 56px;

  /* type scale */
  --fs-h1: 42px;
  --fs-display: 42px;
  --fs-h2: 28px;
  --fs-h3: 21px;
  --fs-h4: 16px;
  --fs-body: 16px;
  --fs-stream: 13px;
  --fs-meta: 11px;
  --fs-label: 11px;
  --lh-tight: 1.05;
  --lh-body: 1.6;
  --lh-stream: 1.5;
  --fs-voice: 17px;
  --lh-voice: 1.7;
  --tracking-meta: 0.02em;
  --tracking-label: 0;
  --weight-label: 500;
  --weight-strong: 500;
  --weight-display: 700;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-voice: "Source Serif 4", Georgia, "Times New Roman", serif;
  --disp: var(--font-display);
  --mono: var(--font-mono);
}

html[data-theme="light"] {
  color-scheme: dark;
  --bg: #04090c;
  --bg-2: #061219;
  --panel: #0a1418;
  --panel-2: #0d1b21;
  --raised: #10242b;
  --ink: #eef7f9;
  --text: #dcedf0;
  --muted: #8fadb4;
  --faint: #5f7d85;
  --line: rgba(140, 220, 214, 0.13);
  --line-strong: rgba(140, 220, 214, 0.26);
  --line-soft: rgba(140, 220, 214, 0.07);
  --accent: #2fd4c2;
  --accent-strong: #6ab8ff;
  --accent-tint: rgba(47, 212, 194, 0.11);
  --accent-line: rgba(47, 212, 194, 0.44);
  --chrome-bg: rgba(4, 9, 12, 0.84);
  --shadow: rgba(0, 0, 0, 0.58);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(var(--pulse-edge-rgb), 0.13), transparent 66%),
    radial-gradient(760px 520px at 100% 8%, rgba(var(--pulse-edge-rgb), 0.10), transparent 68%),
    radial-gradient(680px 500px at 92% 2%, rgba(var(--pulse-third-rgb), 0.065), transparent 74%),
    radial-gradient(760px 540px at 82% 82%, rgba(var(--pulse-purple-rgb), 0.075), transparent 76%),
    radial-gradient(640px 460px at 100% 100%, rgba(var(--pulse-accent-rgb), 0.055), transparent 70%),
    linear-gradient(180deg, var(--pulse-bg) 0%, var(--pulse-lift) 58%, var(--pulse-bg) 100%);
  background-size: 132% 132%, 142% 142%, 128% 128%, 146% 146%, 152% 152%, 100% 100%;
  background-position: 0% 0%, 100% 8%, 92% 2%, 82% 82%, 100% 100%, 0 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0;
  animation: deepwaterPagePulse 12.4s ease-in-out infinite;
}

@keyframes deepwaterPagePulse {
  0%, 100% {
    background-position: 0% 0%, 100% 8%, 92% 2%, 82% 82%, 100% 100%, 0 0;
  }

  43% {
    background-position: 3% 2%, 96% 12%, 86% 5%, 78% 86%, 96% 96%, 0 0;
  }

  71% {
    background-position: 1% 4%, 98% 7%, 94% 1%, 86% 78%, 100% 94%, 0 0;
  }
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--chrome-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg);
}

.brand strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.nav a:hover,
.nav .primary-link {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.hero {
  padding: 54px 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: end;
}

.eyebrow {
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, p { margin: 0; }

h1 {
  max-width: 860px;
  margin-top: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-display);
  line-height: .95;
  font-weight: var(--weight-display);
}

h2 {
  margin-top: 5px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.05;
  font-weight: var(--weight-display);
}

.lead {
  max-width: 790px;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 20px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button,
.mini-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: rgba(47, 212, 194, 0.62);
  color: var(--bg);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.button.ghost,
.mini-button {
  color: var(--muted);
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.mini-button.danger {
  border-color: rgba(255, 143, 190, 0.34);
  color: var(--danger);
}

input[type="file"] { display: none; }

.kernel-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--elev-2);
}

.kernel-card { padding: 22px; }

.kernel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.kernel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kernel-head strong {
  color: var(--green);
  font-size: 46px;
  line-height: .9;
}

.meter {
  height: 10px;
  margin: 20px 0;
  border: 1px solid rgba(229, 226, 216, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
}

.kernel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kernel-grid div {
  border: 1px solid rgba(235, 233, 224, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.kernel-grid b {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

.kernel-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.grid,
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 0;
}

.split {
  grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr);
  padding-bottom: 72px;
}

.panel { padding: 22px; }

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid rgba(235, 233, 224, 0.18);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(5, 6, 18, 0.48);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

form .button {
  margin-top: 16px;
}

.warning {
  margin-top: 16px;
  border: 1px solid rgba(244, 201, 107, 0.22);
  border-radius: 8px;
  padding: 13px 14px;
  color: #f5dfaa;
  background: rgba(244, 201, 107, 0.06);
  font-size: 13px;
}

.command-box,
.recovery-box {
  min-height: 190px;
  margin: 14px 0 0;
  border: 1px solid rgba(235, 233, 224, 0.12);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: rgba(4, 9, 12, 0.54);
  white-space: pre-wrap;
  overflow: auto;
}

.recovery-box {
  min-height: 540px;
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.entry {
  border: 1px solid rgba(235, 233, 224, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.entry-type {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.entry-time {
  color: var(--faint);
  font-size: 12px;
}

.entry strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

.entry p,
.entry small {
  color: var(--muted);
}

.empty {
  border: 1px dashed rgba(235, 233, 224, 0.18);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .grid,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1240px); }
  .actions { flex-direction: column; }
  .button { width: 100%; }
  .panel-head { flex-direction: column; }
}

/* ── Shared theme + interaction polish (added by unified design layer) ── */
html[data-theme="light"] body {
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(var(--pulse-edge-rgb), 0.13), transparent 66%),
    radial-gradient(760px 520px at 100% 8%, rgba(var(--pulse-edge-rgb), 0.10), transparent 68%),
    radial-gradient(680px 500px at 92% 2%, rgba(var(--pulse-third-rgb), 0.065), transparent 74%),
    radial-gradient(760px 540px at 82% 82%, rgba(var(--pulse-purple-rgb), 0.075), transparent 76%),
    radial-gradient(640px 460px at 100% 100%, rgba(var(--pulse-accent-rgb), 0.055), transparent 70%),
    linear-gradient(180deg, var(--pulse-bg) 0%, var(--pulse-lift) 58%, var(--pulse-bg) 100%);
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

.theme-toggle-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 11px;
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 0 14px;
  cursor: pointer;
}

.button,
.mini-button,
.nav a,
.theme-toggle-button {
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
}

.theme-toggle-button:hover {
  border-color: var(--accent-line);
  background: var(--accent-tint);
}

.button.primary {
  box-shadow: var(--elev-1);
}

.button:hover,
.mini-button:hover {
  border-color: var(--accent-line);
}

.button.primary:hover {
  box-shadow: var(--elev-2);
  transform: translateY(-1px);
}

.button:active,
.mini-button:active {
  transform: translateY(1px);
}

.button:focus-visible,
.mini-button:focus-visible,
.nav a:focus-visible,
.theme-toggle-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--accent);
}
