/* ============================================================
   Wetware — landing (owned surface)
   Design system: "Daylight Clinic, dark-primary" — see DESIGN.md
   Two voices: Martian Mono (machine) / Schibsted Grotesk (human)
   One signal: green = live / nominal / go / logged
   Matte instrument: no glow, no gradients, no shadows
   ============================================================ */

:root {
  /* Dark (primary) */
  --bg: #060709;          /* Ink — page/chassis */
  --surface: #15171a;     /* Smoke — cards, panels */
  --line: #303337;        /* Hairline — borders, tracks */
  --text: #f0f2f4;        /* Porcelain — primary text */
  --muted: #999fa4;       /* Muted — labels, meta */
  --sig-graphic: #42d595; /* Signal — traces, rings, bars */
  --sig-text: #42d595;    /* Signal — green text and icons */
  --sig-fill: #42d595;    /* Signal — filled primary action */
  --on-fill: #060709;     /* text on Signal fills */
  --warning: #e8aa4e;
  --error: #e85854;

  --font-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-sans: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;

  --sp-hairline: 4px;
  --sp-row: 8px;
  --sp-cluster: 12px;
  --sp-block: 16px;
  --sp-section: 24px;

  --r-card: 3px;    /* data cards, controls */
  --r-chassis: 6px; /* outer chassis */

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Light ("day shift") — three-stop green ramp, never interchanged */
    --bg: #f3f5f7;          /* Porcelain bg */
    --surface: #fdfdfe;     /* Card */
    --line: #d8dbdd;        /* Hairline */
    --text: #111416;        /* Ink */
    --muted: #50565a;       /* Muted */
    --sig-graphic: #20a47a; /* Signal / trace — graphics only */
    --sig-text: #086e53;    /* Signal / ink — green words and icons */
    --sig-fill: #037c58;    /* Signal / fill — buttons, white text */
    --on-fill: #ffffff;
    --warning: #945f0e;
    --error: #be222a;

    color-scheme: light;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sig-fill); color: var(--on-fill); }

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a { color: inherit; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

img, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--sig-text);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  z-index: 10;
  font-size: 0.875rem;
}
.skip:focus-visible { left: 12px; top: 12px; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* grid/flex items with long user-provided text must shrink, not blow out the track */
.hosts > *, .host > *, .skill-grid > *, .skill-option > *, .cards > * {
  min-width: 0;
}

section { padding: 72px 0; border-top: 1px solid var(--line); scroll-margin-top: 57px; }
section.hero-wrap { border-top: none; padding: 72px 0 56px; }
section.strip-wrap { padding: 0; }

/* ---------- shared vocabulary ---------- */

/* Specimen label: uppercase tracked mono — replaces headings on data cards */
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

/* Machine-voice data */
.data {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  font-weight: 400;
}

.muted { color: var(--muted); }

h2 { font-size: 1.625rem; margin-bottom: var(--sp-section); }
h3 { font-size: 1.0625rem; }

.section-lede {
  max-width: 620px;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: var(--sp-section);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: var(--r-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
              color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary {
  background: var(--sig-fill);
  color: var(--on-fill);
  border-color: var(--sig-fill);
}
.btn-primary:hover { background: var(--sig-graphic); border-color: var(--sig-graphic); }
@media (prefers-color-scheme: light) {
  /* light-mode hover darkens instead — trace green is graphics-only */
  .btn-primary:hover { background: var(--sig-text); border-color: var(--sig-text); }
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--muted); }

/* ---------- chrome band (header) ---------- */

.chrome {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.chrome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-block);
  height: 56px;
}

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

.wordmark {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text);
}

.chrome-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.chrome-nav a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.chrome-nav a:hover { color: var(--text); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sig-graphic);
  flex: none;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}
.hero > * { min-width: 0; }

.hero h1 {
  font-size: clamp(2rem, 3.8vw, 2.5rem);
}

.hero-sub {
  margin-top: var(--sp-block);
  max-width: 34em;
  color: var(--muted);
  font-size: 1.0625rem;
}
.hero-sub strong { color: var(--text); font-weight: 500; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-cluster);
  margin-top: var(--sp-section);
}

.hero-meta {
  margin-top: var(--sp-block);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- the instrument mock ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-chassis);
  overflow: hidden;
}

.panel-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 16px;
}

/* the Ring */
.ring { width: 172px; height: 172px; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-arc {
  fill: none;
  stroke: var(--sig-graphic);
  stroke-width: 8;
  stroke-dasharray: 527.8;
  stroke-dashoffset: 200.6; /* 62% of the day's budget spent */
}
.ring-tick { stroke: var(--line); stroke-width: 1.5; }
.ring-target { stroke: var(--muted); stroke-width: 1.5; }
.ring-figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.125rem;
  font-weight: 500;
  fill: var(--sig-text);
}
.ring-caption {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  fill: var(--muted);
}

/* underline macro bars */
.bars { display: grid; gap: var(--sp-cluster); min-width: 0; }
.bar-row { display: grid; gap: 5px; }
.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-row);
}
.bar-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--text);
}
.bar-val .of { color: var(--muted); }
.bar-track {
  height: 2px;
  background: var(--line);
  border-radius: 0;
}
.bar-fill { height: 2px; background: var(--sig-graphic); }
.bar-fill-protein { width: 65%; }
.bar-fill-fat { width: 68%; }
.bar-fill-carbs { width: 55%; }

/* meal / training rows: exactly two tiers */
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-cluster);
  padding: 12px 16px;
}
.row + .row { border-top: 1px solid var(--line); }
.row-icon { flex: none; color: var(--muted); }
.row-icon.ok { color: var(--sig-text); }
.row-main { min-width: 0; flex: 1; }
.row-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}
.row-log {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--sig-text);
  border: 1px solid var(--sig-text);
  border-radius: 2px;
  padding: 5px 9px;
  background: transparent;
}

/* draw-once instrument motion; nothing loops */
@media (prefers-reduced-motion: no-preference) {
  .ring-arc {
    stroke-dashoffset: 527.8;
    animation: ring-settle 600ms cubic-bezier(0.22, 1, 0.36, 1) 150ms forwards;
  }
  .bar-fill {
    transform-origin: left center;
    transform: scaleX(0);
    animation: bar-settle 500ms cubic-bezier(0.22, 1, 0.36, 1) 250ms forwards;
  }
}

@keyframes ring-settle { to { stroke-dashoffset: 200.6; } }
@keyframes bar-settle { to { transform: scaleX(1); } }

/* ---------- stat strip ---------- */

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.strip-container {
  max-width: 1080px;
  padding-left: 0;
  padding-right: 0;
}

.stat {
  padding: 20px 24px;
  display: grid;
  gap: 6px;
}
.stat + .stat { border-left: 1px solid var(--line); }
.stat-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text);
}

/* ---------- feature cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-block);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.card p { font-size: 0.9375rem; color: var(--text); }
.card .card-foot {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- start / hosts ---------- */

.hosts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-block);
  margin-bottom: var(--sp-section);
}

.host {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
  display: grid;
  gap: var(--sp-cluster);
  align-content: start;
}

.host h3 { font-size: 1.125rem; }

.host ol {
  margin: 0;
  padding-left: 1.25em;
  font-size: 0.9375rem;
  display: grid;
  gap: 6px;
}
.connector-address {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-block);
  margin: 0 0 var(--sp-block);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.connector-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
}

.copy-btn {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 5px 8px;
  cursor: pointer;
  transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }
.copy-btn.done { color: var(--sig-text); border-color: var(--sig-text); }

.store-notice { margin-bottom: var(--sp-section); }

/* the say-this block */
.say {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: 20px;
  display: grid;
  gap: var(--sp-row);
  margin-bottom: var(--sp-section);
}
.say blockquote {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  border-left: 2px solid var(--sig-graphic);
  padding-left: var(--sp-block);
}
.say p { color: var(--muted); font-size: 0.9375rem; max-width: 58em; }

/* alert (info): variant + icon + words, never color alone */
.alert {
  display: flex;
  gap: var(--sp-cluster);
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--sp-block);
  margin-bottom: var(--sp-block);
}
.alert svg { flex: none; margin-top: 2px; color: var(--sig-text); }
.alert .alert-title { font-weight: 600; font-size: 0.9375rem; }
.alert p { color: var(--muted); font-size: 0.9375rem; }

.aside-note { color: var(--muted); font-size: 0.875rem; max-width: 60em; }
.aside-note a { color: var(--text); }

/* ---------- skill ---------- */

.skill-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.skill-option {
  min-height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  display: grid;
  gap: var(--sp-block);
  align-content: start;
}
.skill-option h3 { font-size: 1.125rem; }
.skill-option > p { color: var(--muted); font-size: 0.9375rem; }

.prompt-box {
  display: grid;
  gap: var(--sp-block);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
}
.prompt-box p {
  overflow-wrap: anywhere;
  font-size: 0.9375rem;
  font-weight: 500;
}

.skill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-cluster);
}

.skill-benefits {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: var(--sp-section);
  margin-bottom: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.skill-benefits li {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.skill-benefits li + li { border-left: 1px solid var(--line); }

/* ---------- roadmap ---------- */

.roadmap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.roadmap-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--sp-block);
  padding: 16px 0;
  align-items: baseline;
}
.roadmap-item + .roadmap-item { border-top: 1px solid var(--line); }
.roadmap-item .label { padding-top: 2px; }
.roadmap-item .body { font-size: 0.9375rem; color: var(--muted); }
.roadmap-item .body strong { color: var(--text); font-weight: 600; }
.roadmap-item sup a { color: var(--sig-text); text-decoration: none; }

.benchmark-note {
  margin-top: var(--sp-block);
  max-width: 60em;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
}

.foot-inner { display: grid; gap: var(--sp-section); }

.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-block);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.foot-links a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.foot-links a:hover { color: var(--text); }

.foot-status {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot-legal { font-size: 0.8125rem; color: var(--muted); max-width: 60em; }

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hosts { grid-template-columns: minmax(0, 1fr); }
  .skill-grid { grid-template-columns: minmax(0, 1fr); }
  .skill-benefits { grid-template-columns: 1fr 1fr; }
  .skill-benefits li:nth-child(3) { border-left: none; }
  .skill-benefits li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  section { padding: 56px 0; }
  /* keep the two-line headline lockup on phone widths */
  .hero h1 { font-size: clamp(1.375rem, 6.9vw, 2rem); }
  .chrome-nav { gap: 14px; }
  .chrome-nav a.nav-optional { display: none; }
  .chrome-nav .live { display: none; }
  .panel-body { grid-template-columns: 1fr; justify-items: center; }
  .bars { width: 100%; }
  .strip { grid-template-columns: 1fr 1fr; }
  .connector-address { grid-template-columns: minmax(0, 1fr); gap: var(--sp-row); }
  .skill-benefits { grid-template-columns: 1fr; }
  .skill-benefits li + li { border-left: none; border-top: 1px solid var(--line); }
  .roadmap-item { grid-template-columns: 80px 1fr; gap: var(--sp-cluster); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
