/* Home page, light and dark. home.js draws the canvases in the matching palette. */
:root {
  --bg: #f7f6f2;
  --ink: #132336;
  --ink-2: #3d4b5c;
  --muted: #6d7682;
  --rule: #dcdcd4;
  --coral: #ce5b43;
  --blue: #3f6fb0;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --edge: clamp(16px, 4vw, 56px);
  --card: #ffffff;
  --thumb-axis: #c9cbc4;
  --thumb-bar: #b9c3cf;
  --slab-top: #ffffff;
  --slab-left: #e9eae4;
  --slab-right: #dfe1da;
  --slab-line: #c9ccc6;
  --base-top: #1b2a3c;
  --base-left: #101b28;
  --base-right: #16222f;
  --grid: #e3e3dc;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1520;
    --ink: #ece8de;
    --ink-2: #b9c0ca;
    --muted: #8a94a2;
    --rule: #263244;
    --coral: #e8775c;
    --blue: #7f9fd0;
    --card: #152031;
    --thumb-axis: #34445a;
    --thumb-bar: #4a5d78;
    --slab-top: #1d2a3b;
    --slab-left: #172334;
    --slab-right: #131d2b;
    --slab-line: #2e3d52;
    --base-top: #070c14;
    --base-left: #04080e;
    --base-right: #060a11;
    --grid: #1f2b3b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 400; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
figure { margin: 0; }

/* Header */
.top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 22px var(--edge); }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.logo picture { display: flex; }
.logo img { width: 22px; height: 22px; }
.top nav { display: flex; align-items: center; gap: 26px; font-size: 0.92rem; color: var(--ink-2); }
.top nav a:hover, .nav-auth:hover { color: var(--ink); }
.nav-auth { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-auth:disabled { cursor: default; }

/* Arrow links */
.arrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 500; padding-bottom: 3px; border-bottom: 1px solid var(--ink); }
.arrow::after { content: "→"; transition: transform 0.2s ease; }
.arrow:hover::after { transform: translateX(3px); }

/* Hero */
.hero { position: relative; margin: 0 var(--edge); height: min(78vh, 760px); min-height: 520px; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-copy { position: absolute; left: clamp(20px, 4vw, 56px); top: 50%; transform: translateY(-50%); max-width: 600px; }
.hero h1 { white-space: nowrap; font-size: clamp(2.6rem, 5.4vw, 4.8rem); line-height: 0.98; letter-spacing: -0.035em; margin-bottom: 26px; }
.hero p { font-size: 1.12rem; color: var(--ink-2); max-width: 380px; text-wrap: pretty; }
.hero .links { display: flex; gap: 28px; margin-top: 30px; }

/* Recent results */
.releases { margin: 72px var(--edge) 0; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.row-head h2 { font-size: 1.35rem; }
.release-list { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 18px; }
.release { display: flex; gap: 20px; align-items: center; }
.thumb { flex: none; width: 128px; height: 74px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; }
.thumb .axis { stroke: var(--thumb-axis); stroke-width: 1; }
.thumb .bar-a { fill: var(--thumb-bar); }
.thumb .bar-b { fill: var(--coral); }
.thumb .line-b { fill: none; stroke: var(--blue); stroke-width: 2; }
.thumb .dot { fill: var(--coral); }
.release time { font: 0.78rem var(--mono); color: var(--muted); }
.release h3 { font-size: 1rem; font-weight: 500; line-height: 1.35; margin-top: 4px; letter-spacing: -0.01em; }

/* Split sections */
.split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); align-items: center; margin: 150px var(--edge) 0; }
.split.reverse { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.split h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 26px; }
.split p { color: var(--ink-2); max-width: 440px; font-size: 1.02rem; }
.iso svg, .curve svg { width: 100%; height: auto; display: block; overflow: visible; }
.iso figcaption { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font: 0.8rem var(--mono); color: var(--muted); }
.iso figcaption b { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border: 1px solid var(--muted); border-radius: 50%; font-weight: 400; font-size: 0.68rem; }
.curve figcaption { font: 0.78rem var(--mono); color: var(--muted); margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 28px; margin: 34px 0 0; }
.stats dt { font: 0.72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stats dd { margin: 4px 0 0; font-size: 1.9rem; letter-spacing: -0.03em; }
.stats div:nth-child(2) dd { color: var(--coral); }

/* Isometric drawing */
.iso .slab-top { fill: var(--slab-top); stroke: var(--slab-line); stroke-width: 1; }
.iso .slab-left { fill: var(--slab-left); stroke: var(--slab-line); stroke-width: 1; }
.iso .slab-right { fill: var(--slab-right); stroke: var(--slab-line); stroke-width: 1; }
.iso .base-top { fill: var(--base-top); }
.iso .base-left { fill: var(--base-left); }
.iso .base-right { fill: var(--base-right); }
.iso .led { fill: #6fd3a8; }
.iso .flow { fill: none; stroke: var(--coral); stroke-width: 1.6; stroke-dasharray: 3 6; animation: flow 1.6s linear infinite; }
.iso .pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes flow { to { stroke-dashoffset: -18; } }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* Curve */
.curve .grid { stroke: var(--grid); stroke-width: 1; }
.curve .tick { font: 11px var(--mono); fill: var(--muted); }
.curve .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.curve .area { fill: url(#curve-fill); }
.curve .pt { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.curve .pt.last { fill: var(--coral); stroke: var(--coral); }

/* Get in touch */
.touch { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); margin: 160px var(--edge) 0; }
.touch h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); letter-spacing: -0.03em; }
.touch-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.touch-cols > div { border-top: 1px solid var(--rule); padding-top: 18px; }
.touch-cols h3 { font-size: 1.12rem; font-weight: 500; margin-bottom: 10px; }
.touch-cols p { color: var(--muted); font-size: 0.93rem; margin-bottom: 22px; }

/* Footer */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 120px var(--edge) 0; padding: 22px 0; border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-2); }
.foot nav { display: flex; gap: 22px; }
.foot nav a:hover { color: var(--ink); }
.foot-canvas { display: block; width: 100%; height: 96px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .hero { height: auto; min-height: 0; display: flex; flex-direction: column-reverse; }
  .hero-canvas { position: relative; height: 56vh; min-height: 320px; }
  .hero-copy { position: relative; left: auto; top: auto; transform: none; max-width: none; padding: 8px 0 28px; }
  .release-list, .touch-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .split, .split.reverse, .touch { grid-template-columns: minmax(0, 1fr); margin-top: 96px; }
  .split.reverse .curve { order: 2; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .stats dd { font-size: 1.45rem; }
  .thumb { width: 104px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .iso .flow, .iso .pulse { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
