/* planetterrian.com: "Editorial studio" direction.
   Dark by default, warm paper through prefers-color-scheme: light. Every colour is a token in the two blocks below.
   No gradients, glows, shadows or decorative shapes. One reveal transition, off under reduced motion.
   Kept out of the HTML so the CSP in _headers can stay at style-src 'self'. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/newsreader-500-latin.woff2") format("woff2");
}

/* planetterrian-tokens v1: copied verbatim in site.css, page.css and orbit/src/views/styles.ts; edit all copies together. --hairline-strong is decorative (under 3:1); controls use a surface-specific --control-line. */
:root {
  color-scheme: dark light;
  --bg: #111417;
  --surface: #181c20;
  --raised: #1f2428;
  --hairline: #2a3036;
  --hairline-strong: #3d454d;
  --ink: #e8ecef;
  --muted: #a7b0b8;
  --accent: #3fb8af;
  --accent-ink: #0e2a28;
  --accent-text: #3fb8af;
  --accent-hover: #5cc9c1;
  --scrim: rgba(0, 0, 0, 0.55);
  --fs-label: 13px;
  --fs-small: 15px;
  --fs-body: 17px;
  --fs-h3: 20px;
  --fs-h2: 26px;
  --fs-display: 34px;
  --fs-h1: 44px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1080px;
  --gutter: 16px;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f6f2;
    --surface: #ffffff;
    --raised: #f1efe9;
    --hairline: #d9d6ce;
    --hairline-strong: #a8a397;
    --ink: #1b1f23;
    --muted: #566069;
    --accent: #17766f;
    --accent-ink: #ffffff;
    --accent-text: #17766f;
    --accent-hover: #125f59;
    --scrim: rgba(27, 31, 35, 0.4);
  }
}
/* end planetterrian-tokens v1 */

/* site tokens: public-site additions to the shared block above (identical in site.css and page.css).
   --control-line outlines buttons and the menu toggle at 3:1 or better on every surface. */
:root {
  --control-line: #6b747d;
}
@media (prefers-color-scheme: light) {
  :root {
    --control-line: #8a857a;
  }
}
/* end site tokens */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 120ms ease; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--s5); }

.skip-link { position: absolute; left: var(--s4); top: -100px; z-index: 300; background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--s3); }

/* The one uppercase style: section labels, ledger group labels, footer column heads and the log category column. */
.label, .group-label, .news-kind {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.12; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(34px, 26px + 1.8vw, var(--fs-h1)); max-width: 16em; margin: var(--s3) 0 var(--s4); }
h2 { font-size: clamp(var(--fs-h2), 22px + 0.9vw, var(--fs-display)); margin: var(--s2) 0 var(--s3); }
h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }

/* Masthead / navigation */
.masthead { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--hairline); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: var(--s8); position: relative; }
.wordmark { display: inline-flex; align-items: center; gap: var(--s3); color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--fs-small); letter-spacing: -0.005em; }
.wordmark:hover { color: var(--ink); }
.wordmark img { border-radius: 6px; border: 1px solid var(--hairline); }
.nav-links { display: flex; gap: var(--s6); }
.nav-links a { color: var(--ink); text-decoration: none; font-size: var(--fs-small); font-weight: 500; padding: var(--s2) 0; }
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

/* Hero */
.hero { padding: var(--s7) 0 var(--s7); }
.hero-sub { font-size: var(--fs-h3); line-height: 1.5; color: var(--ink); max-width: 38em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s6); margin-top: var(--s5); }
.hero-links { font-size: var(--fs-small); color: var(--muted); max-width: 32em; }
.hero-links p + p { margin-top: var(--s1); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--s7); padding: var(--s3) var(--s5); border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-body); font-weight: 600; text-decoration: none; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.btn-primary, .btn-primary:hover { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn-primary:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn-secondary, .btn-secondary:hover { background: transparent; color: var(--ink); border: 1px solid var(--control-line); }
.btn-secondary:hover { border-color: var(--ink); }

/* Sections */
.section { padding: var(--s8) 0; border-top: 1px solid var(--hairline); }
.section-head { max-width: 40em; margin-bottom: var(--s6); }
#products { padding-top: var(--s7); }
#products .section-head { margin-bottom: var(--s5); }
.section-desc { color: var(--muted); font-size: var(--fs-body); max-width: 38em; }

/* Products */
.featured { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); margin-bottom: var(--s7); }
.product { position: relative; }
.product-name a { color: var(--ink); text-decoration: none; }
.product-name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.product-name a:focus-visible { outline: none; }
.product-name a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.product:hover .product-name a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.mark { width: 32px; height: 32px; border-radius: var(--radius-sm); flex: none; }

/* Stage: an aria-hidden shape (CSS generated, never read out) before the sentence-case word.
   Filled dot = Growing, half dot = Alpha, ring = Early, two bars = Paused. Drawn in currentColor. */
.stage { position: relative; display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-label); font-weight: 600; line-height: 1.4; color: var(--ink); white-space: nowrap; }
.stage::before { content: ""; flex: none; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 50%; }
.stage-growing::before { background: currentColor; }
.stage-alpha::after { content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: currentColor; clip-path: inset(0 50% 0 0); }
.stage-paused::before { width: 9px; border-width: 0 3px; border-radius: 0; }

.product-featured { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: var(--s5); transition: border-color 120ms ease; }
.product-featured:hover { border-color: var(--hairline-strong); }
.product-top { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.product-top .product-name { font-size: var(--fs-h2); line-height: 1.15; margin-right: auto; }
.product-promise { font-size: var(--fs-body); margin-bottom: var(--s2); }
.product-fact { color: var(--muted); font-size: var(--fs-small); margin-bottom: var(--s4); }
.measure, .product-status { font-size: var(--fs-small); padding: var(--s3) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); margin-bottom: var(--s4); font-variant-numeric: tabular-nums; }
.measure strong { font-weight: 600; color: var(--ink); }
.measure .source { color: var(--muted); font-size: var(--fs-label); white-space: nowrap; }
.shot { margin: 0; }
.shot img { width: 100%; aspect-ratio: 4 / 1; object-fit: cover; border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
/* Calm the bright Avvizo capture on the dark page; full strength on the light page. */
.shot-bright img { filter: brightness(0.82); }
.shot figcaption { font-size: var(--fs-label); color: var(--muted); margin-top: var(--s2); }
.product-domain { font-size: var(--fs-small); font-weight: 600; color: var(--ink); margin-top: var(--s4); }
.product-featured .shot { margin-top: auto; }

.group-label { padding-bottom: var(--s3); border-bottom: 1px solid var(--ink); }
.group-label span { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: var(--s3); }
.ledger { margin-bottom: var(--s7); }
.ledger:last-child { margin-bottom: 0; }
.product-row { display: grid; grid-template-columns: 32px 220px minmax(0, 1fr) 200px; gap: var(--s2) var(--s5); align-items: start; padding: var(--s5) 0; border-bottom: 1px solid var(--hairline); }
.product-row .product-name a::after { border-radius: 0; }
.row-name { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.row-text p { color: var(--ink); font-size: var(--fs-body); max-width: 40em; }
.row-text .also { color: var(--muted); font-size: var(--fs-small); margin-top: var(--s2); }
.also a { position: relative; z-index: 1; }
.product-row .product-domain { margin-top: 2px; text-align: right; color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }

/* Open tests */
.test-section { background: var(--raised); }
.test-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s7); align-items: start; }
.test-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); margin-top: var(--s5); }
.test-points { counter-reset: point; border-top: 1px solid var(--ink); }
.test-points li { counter-increment: point; display: grid; grid-template-columns: 36px 1fr; padding: var(--s4) 0; border-bottom: 1px solid var(--hairline); color: var(--muted); }
.test-points li::before { content: counter(point); grid-row: span 2; font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.3; color: var(--ink); font-variant-numeric: tabular-nums; }
.test-points strong { display: block; color: var(--ink); font-weight: 600; }

/* What's new */
.log-month { max-width: 860px; font-size: var(--fs-small); font-weight: 600; color: var(--ink); padding-bottom: var(--s2); border-bottom: 1px solid var(--ink); }
.news-list + .log-month { margin-top: var(--s6); }
.news-list { max-width: 860px; }
.news-item { display: grid; grid-template-columns: 112px 96px minmax(0, 1fr); gap: var(--s1) var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--hairline); }
.news-date { font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.news-kind { padding-top: 3px; }
.news-body h3 { font-size: var(--fs-body); margin-bottom: var(--s1); }
.news-body h3 a { color: var(--ink); }
.news-body h3 a:hover { color: var(--accent-hover); }
.news-body p { color: var(--muted); font-variant-numeric: tabular-nums; }
.news-more { margin-top: var(--s5); color: var(--muted); }

/* Founder */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s7); align-items: start; }
.about-grid .section-head { margin-bottom: 0; }
.about-text { font-family: var(--font-display); font-size: clamp(var(--fs-h3), 18px + 0.6vw, var(--fs-h2)); line-height: 1.45; max-width: 30em; font-variant-numeric: tabular-nums; }
.about-links { margin-top: var(--s4); }

/* Footer */
.footer-section { padding-bottom: var(--s6); }
.footer-head { max-width: 40em; }
.footer-email { margin-top: var(--s3); }
.footer-email a { color: var(--ink); }
.footer-email a:hover { color: var(--ink); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: var(--s6); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--hairline); }
.footer-cols nav { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); font-size: var(--fs-small); }
.footer-cols .label { margin-bottom: var(--s2); }
.footer-cols nav > a, .footer-list a { color: var(--ink); text-decoration: none; padding: 2px 0; }
.footer-cols nav > a:hover, .footer-list a:hover { color: var(--ink); text-decoration: underline; }
.footer-list { display: flex; flex-direction: column; gap: var(--s1); }
.footer-note { display: block; color: var(--muted); max-width: 26em; }
.footer-list .footer-note a { color: var(--ink); text-decoration: underline; padding: 0; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s6); margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--hairline); font-size: var(--fs-small); color: var(--muted); }
.footer-bottom p:last-child { max-width: 40em; }

/* The one reveal: only when site.js has added the js class. */
.js .reveal { opacity: 0; transform: translateY(8px); transition: opacity 320ms ease-out, transform 320ms ease-out; }
.js .reveal.visible { opacity: 1; transform: none; }

/* Short laptop screens: keep the featured names and stages above the fold. */
@media (min-width: 761px) and (max-height: 800px) {
  .hero { padding: var(--s6) 0 var(--s6); }
  #products { padding-top: var(--s6); }
  #products .section-head { margin-bottom: var(--s4); }
}

/* Tablet */
@media (max-width: 960px) {
  .product-row { grid-template-columns: 32px minmax(0, 1fr); }
  .product-row .row-name { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); }
  .product-row .row-text, .product-row .product-domain { grid-column: 2; }
  .product-row .product-domain { text-align: left; }
  .test-grid, .about-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-ventures { grid-column: 1 / -1; }
}

/* Phone */
@media (max-width: 760px) {
  .container { padding: 0 var(--gutter); }
  .hero { padding: var(--s6) 0 var(--s7); }
  .hero-sub { font-size: var(--fs-body); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { padding: var(--s7) 0; }
  .featured { grid-template-columns: 1fr; gap: var(--s4); margin-bottom: var(--s6); }
  .product-featured { padding: var(--s4); }
  .news-item { grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); }
  .news-body { grid-column: 1 / -1; }
  .footer-cols { grid-template-columns: 1fr; }
  .group-label span { display: block; margin: var(--s1) 0 0; }

  /* Menu: only collapses when site.js runs; without JS the links stay visible and wrap. */
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 0 var(--s4);
    background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-small); font-weight: 600;
    border: 1px solid var(--control-line); border-radius: var(--radius-sm); cursor: pointer;
  }
  html:not(.js) .nav { flex-wrap: wrap; padding-top: var(--s2); padding-bottom: var(--s2); }
  html:not(.js) .nav-links { flex-wrap: wrap; gap: var(--s1) var(--s4); width: 100%; }
  .js .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  }
  .js .nav-links.open { display: flex; }
  .js .nav-links a { display: block; padding: var(--s4) var(--gutter); font-size: var(--fs-body); border-bottom: 1px solid var(--hairline); }
  .js .nav-links a:last-child { border-bottom: 0; }
  .js .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; top: 65px; background: var(--scrim); z-index: -1; }
}

@media (prefers-color-scheme: light) {
  .shot-bright img { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .product-featured, a { transition: none; }
}
