/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f5f3ee;
  --bg-tint: #ece9e1;
  --surface: #fffdf8;
  --ink: #16181b;
  --ink-2: #3a3e44;
  --muted: #6a6e75;
  --line: #ddd8cc;
  --line-strong: #c9c3b5;
  --accent: #1e3d5c;

  --ch: #7c3aed;
  --ch-strong: #6d28d9;
  --nat: #2f9256;
  --nat-deep: #123f30;

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f11;
    --bg-tint: #131417;
    --surface: #17181b;
    --ink: #ecebe6;
    --ink-2: #c6c5bf;
    --muted: #94969b;
    --line: #26282c;
    --line-strong: #35383d;
    --accent: #9dbbdb;
    --ch: #8b5cf6;
    --ch-strong: #a78bfa;
    --nat: #4cb877;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px;
  text-decoration: none; font-size: 14px;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 28px; height: 28px; flex: none; }
.mark circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.mark path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.wordmark { font-family: var(--serif); font-size: 26px; line-height: 1; letter-spacing: -0.01em; }
.nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--ink-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ch { background: var(--ch); color: #fff; }
.btn-ch:hover { background: var(--ch-strong); }
@media (prefers-color-scheme: dark) { .btn-ch:hover { background: #7c3aed; } }
.btn-soon {
  border: 1px dashed var(--line-strong); color: var(--muted); cursor: default;
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(64px, 11vw, 132px) 0 0; overflow: hidden; }
.eyebrow, .kicker, .platforms, .product-url, .stats dt, .facts dt, .ch-meta, .nat-label {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.hero h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(46px, 8.4vw, 104px);
  line-height: .98;
  letter-spacing: -0.02em;
  max-width: 12.5em;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { margin-top: 28px; max-width: 38em; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); text-wrap: pretty; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.ridge { display: block; width: 100%; height: clamp(70px, 12vw, 150px); margin-top: clamp(48px, 8vw, 96px); }
.ridge-line { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ridge-sun { fill: #e8b93c; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.section-tint { background: var(--bg-tint); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.kicker span { color: var(--ink); }
.kicker span::after { content: ""; display: inline-block; width: 44px; height: 1px; margin: 0 12px 0 14px; vertical-align: middle; background: var(--line-strong); }
.section h2 {
  margin-top: 16px; font-family: var(--serif);
  font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.015em; text-wrap: balance;
}

/* ---------- Products ---------- */
.product {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
}
.product + .product { margin-top: 28px; }
.product-nat .product-copy { order: 2; }
.product-nat .product-visual { order: 1; }

.product-id { display: flex; align-items: center; gap: 16px; }
.product-id img { width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 18px -8px rgba(0,0,0,.35); }
.product-id h3 { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 38px); line-height: 1.05; letter-spacing: -0.01em; }
.product-url { display: inline-block; margin-top: 4px; text-decoration: none; font-size: 12px; }
a.product-url:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.product-tagline { margin-top: 28px; font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.25; }
.product-ch .product-tagline { color: var(--ch); }
.product-nat .product-tagline { color: var(--nat); }
.product-desc { margin-top: 12px; color: var(--ink-2); text-wrap: pretty; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 14px 0 14px 16px; border-left: 1px solid var(--line); }
.stats div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-size: 11px; }
.stats dd { margin: 2px 0 0; font-family: var(--serif); font-size: 40px; line-height: 1; }

.features { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-size: 15px; }
.features li { position: relative; padding-left: 18px; color: var(--ink-2); line-height: 1.45; }
.features li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 2px; }
.product-ch .features li::before { background: var(--ch); }
.product-nat .features li::before { background: var(--nat); border-radius: 50%; }

.platforms { margin-top: 24px; font-size: 11.5px; line-height: 1.7; }
.product-actions { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.badge-link img { height: 44px; width: auto; }

.product-visual { position: relative; align-self: stretch; border-radius: var(--radius); overflow: hidden; min-height: 440px; }

/* Commodity Hub visual */
.ch-visual {
  display: grid; place-items: center; padding: clamp(18px, 3vw, 32px);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(124, 58, 237, .28), transparent 60%),
    linear-gradient(#0d0d0f, #111116);
  border: 1px solid #1f2026;
}
.ch-panel {
  width: 100%; max-width: 460px; padding: 20px;
  background: #15161b; border: 1px solid #26272e; border-radius: 12px;
  color: #e6e6ea; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7);
}
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ch-name { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ch-meta { margin-top: 2px; color: #8b8c95; font-size: 11px; }
.ch-pill { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 5px 9px; border-radius: 999px; color: #c4b5fd; background: rgba(124,58,237,.18); border: 1px solid rgba(139,92,246,.4); }
.ch-chart { display: block; width: 100%; height: auto; margin-top: 14px; }
.ch-grid line { stroke: #26272e; stroke-width: 1; }
.ch-area { fill: url(#chFill); }
.ch-prev { fill: none; stroke: #6b6c78; stroke-width: 1.5; stroke-dasharray: 4 5; }
.ch-line { fill: none; stroke: #8b5cf6; stroke-width: 2.5; stroke-linejoin: round; }
.ch-dots circle { fill: #15161b; stroke: #a78bfa; stroke-width: 2; }
.ch-months text { fill: #8b8c95; font-family: var(--mono); font-size: 12px; text-anchor: middle; }
.ch-legend { display: flex; gap: 18px; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: #8b8c95; }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid #8b5cf6; }
.sw-prev { border-top: 1.5px dashed #6b6c78; }
.ch-tickers { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid #26272e; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-family: var(--mono); font-size: 12px; color: #a1a2ab; }
.ch-tickers b { display: inline-block; min-width: 26px; color: #e6e6ea; font-weight: 600; }

/* Encyclopaedia Naturalis visual */
.nat-visual { display: grid; place-items: center; padding: 36px 20px; background: linear-gradient(#27a96a, #1b7d55); }
.nat-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.nat-card {
  position: relative; width: min(100%, 300px);
  padding: 18px 18px 16px; border-radius: 26px;
  background: #fbfaf6; color: #17201b;
  box-shadow: 0 30px 60px -24px rgba(6, 30, 20, .6), 0 0 0 7px rgba(255,255,255,.14);
  font-size: 14px; line-height: 1.45;
}
.nat-bar { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #2f9256; font-weight: 500; }
.nat-found { font-family: var(--mono); font-size: 10.5px; color: #7a8680; text-transform: uppercase; letter-spacing: .06em; }
.nat-emoji { margin: 18px 0 10px; width: 64px; height: 64px; display: grid; place-items: center; font-size: 36px; border-radius: 18px; background: #e5f2e9; }
.nat-name { font-family: var(--serif); font-size: 28px; line-height: 1.05; }
.nat-sci { font-family: var(--serif); font-style: italic; font-size: 17px; color: #59655f; }
.nat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.nat-chips span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #eef1ec; color: #3d4a43; }
.nat-chips .chip-unc { background: #ddeefe; color: #1f5f99; }
.nat-summary { margin-top: 12px; color: #3d4a43; }
.nat-label { margin-top: 14px; font-size: 10.5px; color: #7a8680; }
.nat-months { list-style: none; display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 6px 0 0; padding: 0; }
.nat-months li { text-align: center; font-family: var(--mono); font-size: 10px; padding: 5px 0; border-radius: 5px; background: #eef1ec; color: #8a958f; }
.nat-months li.on { background: #2f9256; color: #fff; }
.nat-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e6e8e3; }
.nat-xp { font-family: var(--mono); font-size: 11.5px; color: #b07d12; }
.nat-log { font-size: 13px; font-weight: 600; color: #fff; background: #2f9256; padding: 7px 13px; border-radius: 999px; }

/* ---------- Principles ---------- */
.principles { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); }
.principles li { counter-increment: p; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.principles li::before { content: counter(p, decimal-leading-zero); font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.principles h3 { margin-top: 14px; font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.principles p { margin-top: 10px; color: var(--ink-2); font-size: 16px; text-wrap: pretty; }

/* ---------- Company ---------- */
.company { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.company .section-head { margin-bottom: 0; }
.company-text { margin-top: 22px; color: var(--ink-2); text-wrap: pretty; }
.company-text a, .facts a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.company-text a:hover, .facts a:hover { text-decoration-color: currentColor; }
.facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 16px 22px; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { font-size: 11.5px; padding-top: 3px; }
.facts dd { margin: 0; }

/* ---------- Contact ---------- */
.contact { text-align: left; }
.contact-title { font-size: clamp(56px, 10vw, 128px) !important; line-height: .95 !important; }
.contact-text { margin-top: 18px; color: var(--ink-2); max-width: 34em; }
.contact-email {
  display: inline-block; margin-top: 28px;
  font-family: var(--serif); font-style: italic; font-size: clamp(30px, 5vw, 56px); line-height: 1.1;
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px;
  overflow-wrap: anywhere;
}
.contact-email:hover { text-decoration-thickness: 2px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .mark { width: 22px; height: 22px; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .product { grid-template-columns: 1fr; }
  .product-nat .product-copy, .product-nat .product-visual { order: 0; }
  .product-visual { min-height: 400px; }
  .company { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav a:not(:last-child) { display: none; }
  .product { padding: 20px 16px; border-radius: var(--radius); }
  .features { grid-template-columns: 1fr; }
  .stats dd { font-size: 34px; }
  .stats div { padding-left: 12px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; padding: 14px 16px; }
  .product-visual { min-height: 0; }
  .ch-visual { padding: 14px; }
  .ch-panel { padding: 14px; }
  .ch-tickers { grid-template-columns: 1fr; }
  .nat-visual { padding: 28px 14px; }
}
