/* tovi.work — site stylesheet on Tovi design-system tokens (design-system/tovi-v2/tokens.json).
   Colours, fonts, radii and spacing come from the Tovi system (tokens.json).
   Site-only additions: reading type scale and page widths (marked "site"). */

@font-face { font-family: "Geist"; src: url(./fonts/Geist-Variable.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(./fonts/GeistMono-Variable.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

.tv-site {
  /* Tovi tokens — light */
  --bg-0: #dcdcdf; --bg-1: #ececee; --bg-2: #f7f7f8; --bg-3: #e2e2e5; --bg-4: #d4d4d8; --field: #ffffff;
  --border: #cfcfd4; --border-strong: #808088;
  --text: #161618; --text-2: #4e4e55; --text-3: #5c5c63;
  --primary: var(--text); --on-primary: #f7f7f8; --focus: #161618;
  --measured: #1a4cb0; --measured-bg: #e4ebf8; --judged: #9a5800; --judged-bg: #f8ecd9;
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px;
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px;
  --font-sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", Consolas, ui-monospace, monospace;
  /* site: page surfaces */
  --page: var(--bg-2); --surface: var(--field);
  /* site: reading scale and widths */
  --site-max: 1200px; --site-gutter: 32px; --site-prose: 680px;
  --site-section: 112px;

  background: var(--page); color: var(--text); font-family: var(--font-sans);
  font-size: 16px; line-height: 26px; -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
.tv-site {
  --bg-0: #0c0c0d; --bg-1: #141415; --bg-2: #1b1b1d; --bg-3: #242427; --bg-4: #2e2e32; --field: #0f0f10;
  --border: #2a2a2d; --border-strong: #6c6c73;
  --text: #ececee; --text-2: #a6a6ad; --text-3: #85858c;
  --on-primary: #0c0c0d; --focus: #ececee;
  --measured: #4d8cf5; --measured-bg: #14213a; --judged: #f4ac45; --judged-bg: #2c2112;
  --page: var(--bg-1); --surface: var(--bg-2);
}
}

.tv-site *, .tv-site *::before, .tv-site *::after { box-sizing: border-box; }
.tv-site a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.tv-site a:hover { text-decoration-color: var(--text); }
.tv-site :focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tv-site h1, .tv-site h2, .tv-site h3, .tv-site p, .tv-site ul, .tv-site ol { margin: 0; }

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

/* Type (site reading scale, Geist) */
.h1 { font-size: 56px; line-height: 60px; font-weight: 600; letter-spacing: -0.025em; max-width: 920px; }
.h2 { font-size: 36px; line-height: 42px; font-weight: 600; letter-spacing: -0.02em; }
.h3 { font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.005em; }
.lead { font-size: 20px; line-height: 30px; color: var(--text-2); max-width: var(--site-prose); }
.body2 { color: var(--text-2); }
.small { font-size: 14px; line-height: 20px; color: var(--text-2); }
.mono { font-family: var(--font-mono); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* Buttons — ink accent, never a hue */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8); height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); font: 500 15px/20px var(--font-sans); text-decoration: none !important; white-space: nowrap; cursor: pointer; }
.btn-primary { background: var(--primary); color: var(--on-primary) !important; border: 1px solid var(--primary); }
.btn-secondary { background: transparent; color: var(--text) !important; border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--bg-3); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--bg-3); }

/* Header */
.hdr { border-bottom: 1px solid var(--border); background: var(--page); }
.hdr-row { display: flex; align-items: center; gap: var(--sp-24); height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; display: block; }
.nav { display: flex; align-items: center; gap: var(--sp-4); flex: 1 1 auto; flex-wrap: wrap; }
.nav a { font-size: 14px; line-height: 20px; color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); }
.nav a:hover { color: var(--text); background: var(--bg-3); }
.hdr-actions { display: flex; align-items: center; gap: var(--sp-8); margin-left: auto; }
.only-phone { display: none !important; }

/* Sections */
.section { padding: var(--site-section) 0; border-top: 1px solid var(--border); }
.section-head { display: flex; flex-direction: column; gap: var(--sp-16); max-width: 760px; margin-bottom: 56px; }
.eyebrow { font-size: 14px; line-height: 20px; color: var(--text-3); }

/* Hero */
.hero { padding: 104px 0 72px; }
.hero-text { display: flex; flex-direction: column; gap: var(--sp-24); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); align-items: center; margin-top: var(--sp-8); }
.hero-shot { margin-top: 72px; }

/* Screenshot frame (real screenshots from the test account go here) */
.shot { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--bg-0); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.shot-bar { position: absolute; top: 0; left: 0; right: 0; height: 32px; border-bottom: 1px solid var(--border); background: var(--bg-1);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 12px; color: var(--text-3); }
.shot-bar img { width: 14px; height: 14px; }
.shot-label { font-size: 14px; line-height: 20px; color: var(--text-3); text-align: center; padding: 0 24px; }
.shot-tall { aspect-ratio: 4 / 3; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-32); }
.step { display: flex; flex-direction: column; gap: var(--sp-12); padding-top: var(--sp-24); border-top: 1px solid var(--border-strong); }
.step-n { font-family: var(--font-mono); font-size: 14px; color: var(--text-3); }
.cmd { margin-top: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); }
.cmd code { font-family: var(--font-mono); font-size: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; }

/* Measured vs model estimate */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.split-text { display: flex; flex-direction: column; gap: var(--sp-16); }
.example { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-24); display: flex; flex-direction: column; gap: var(--sp-16); }
.example-cap { font-size: 13px; line-height: 18px; color: var(--text-3); }
.metric { display: flex; flex-direction: column; gap: 6px; padding-bottom: var(--sp-16); border-bottom: 1px solid var(--border); }
.metric-label { font-size: 13px; color: var(--text-2); }
.metric-fig { font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.metric-fig span { font-size: 15px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.prov { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; }
.prov-m { color: var(--measured); }
.prov-j { color: var(--judged); }
.prov .meta { color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--measured); flex: none; }
.diamond { width: 8px; height: 8px; border: 1.5px solid var(--judged); transform: rotate(45deg); flex: none; }
.reading { background: var(--judged-bg); border-radius: var(--radius-sm); padding: var(--sp-16); display: flex; flex-direction: column; gap: var(--sp-8); }
.reading p { font-size: 15px; line-height: 23px; }
.rules { display: flex; flex-direction: column; gap: var(--sp-12); padding-left: 0; list-style: none; }
.rules li { display: flex; gap: var(--sp-12); }
.rules li::before { content: ""; width: 6px; height: 6px; margin-top: 10px; background: var(--text-3); flex: none; }

/* Features */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: center; padding: 48px 0; }
.feature + .feature { border-top: 1px solid var(--border); }
.feature.flip .feature-text { order: 2; }
.feature-text { display: flex; flex-direction: column; gap: var(--sp-12); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-16); margin-top: 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-24); display: flex; flex-direction: column; gap: var(--sp-8); }
.card p { font-size: 15px; line-height: 23px; color: var(--text-2); }

/* Data */
.data-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
.cases { display: flex; flex-direction: column; gap: var(--sp-16); list-style: none; padding: 0; counter-reset: c; }
.cases li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--sp-12); padding: var(--sp-16) 0; border-top: 1px solid var(--border); }
.cases li::before { counter-increment: c; content: counter(c); font-family: var(--font-mono); font-size: 14px; color: var(--text-3); }
.links-col { display: flex; flex-wrap: wrap; gap: var(--sp-12); margin-top: var(--sp-8); }

/* Download */
.dl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 56px; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.dl-actions { display: flex; flex-direction: column; gap: var(--sp-12); align-items: flex-start; }
.need { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.need li { display: flex; gap: var(--sp-12); }
.need li::before { content: ""; width: 6px; height: 6px; margin-top: 10px; background: var(--text-3); flex: none; }
.phone-note { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-16); background: var(--page); }

/* Footer — legal links always visible, never behind a menu */
.ftr { border-top: 1px solid var(--border); padding: 48px 0 40px; }
.ftr-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-24); }
.ftr-links { display: flex; flex-wrap: wrap; gap: 10px 24px; list-style: none; padding: 0; max-width: 760px; }
.ftr-links a { font-size: 14px; line-height: 20px; color: var(--text-2); text-decoration: none; }
.ftr-links a:hover { color: var(--text); text-decoration: underline; }
.ftr-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-16); margin-top: 40px; padding-top: var(--sp-24); border-top: 1px solid var(--border); }
.lang { display: inline-flex; align-items: center; gap: var(--sp-8); font-size: 14px; color: var(--text-2); }
.lang select { height: 36px; padding: 0 32px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--field);
  color: var(--text); font: 400 14px/20px var(--font-sans); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }

/* Tablet */
@media (max-width: 1023px) {
  .tv-site { --site-section: 88px; }
  .h1 { font-size: 46px; line-height: 52px; }
  .split, .data-grid, .dl { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature.flip .feature-text { order: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl { padding: 40px; }
}
@media (max-width: 899px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--sp-24); }
  .nav { display: none; }

}
/* Phone — no download: Tovi runs on Windows and macOS */
@media (max-width: 639px) {
  .tv-site { --site-gutter: 16px; --site-section: 64px; font-size: 16px; line-height: 25px; }
  .h1 { font-size: 34px; line-height: 40px; letter-spacing: -0.02em; }
  .h2 { font-size: 26px; line-height: 32px; }
  .lead { font-size: 17px; line-height: 26px; }
  .hero { padding: 48px 0 40px; }
  .hero-shot { margin-top: 40px; }
  .section-head { margin-bottom: 32px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .dl { padding: var(--sp-24); }
  .only-desktop { display: none !important; }
  .only-phone { display: flex !important; }
  .hdr-row { gap: var(--sp-12); }
  .ftr-links { flex-direction: column; gap: 14px; }
}

/* ---------- Inner pages ---------- */
.page-head { padding: 80px 0 48px; display: flex; flex-direction: column; gap: var(--sp-16); }
.page-title { font-size: 44px; line-height: 50px; font-weight: 600; letter-spacing: -0.022em; }
.page-body { padding-bottom: var(--site-section); }
.narrow { max-width: 760px; }
.block { padding: 40px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-16); }
.block:first-child { border-top: 0; padding-top: 0; }
.h2s { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.012em; }
.plain { padding-left: 22px; display: flex; flex-direction: column; gap: var(--sp-8); color: var(--text-2); }
.plain li::marker { color: var(--text-3); }
.inline-code { font-family: var(--font-mono); font-size: 0.875em; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 5px; }
.path { font-weight: 500; color: var(--text); }
.placeholder { color: var(--text-3); }

/* Two platform cards */
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-16); }
.platform { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-32); display: flex; flex-direction: column; gap: var(--sp-12); align-items: flex-start; }

/* Temporary "first launch" notice */
.notice { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: var(--sp-32); display: flex; flex-direction: column; gap: var(--sp-24); }
.notice-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-32); }
.notice-col { display: flex; flex-direction: column; gap: var(--sp-12); }
.numbered { padding-left: 22px; display: flex; flex-direction: column; gap: var(--sp-8); color: var(--text-2); }

/* Key-value list (legal notice, data tables) */
.kv { display: grid; grid-template-columns: 200px minmax(0, 1fr); border-top: 1px solid var(--border); }
.kv dt, .kv dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--text-2); font-size: 15px; }
.kv dd { color: var(--text); }
.table-box { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tbl th { font-weight: 500; color: var(--text-2); background: var(--surface); font-size: 14px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { width: 34%; }

/* Long document: contents rail + reading column */
.doc { display: grid; grid-template-columns: 240px minmax(0, 680px); gap: 80px; padding-bottom: var(--site-section); }
.toc { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: var(--sp-8); }
.toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.toc a { display: block; padding: 5px 0; font-size: 14px; line-height: 20px; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); }
.prose { font-size: 16px; line-height: 27px; }
.prose h2 { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; margin: 48px 0 12px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; color: var(--text); }
.prose ul { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.prose li::marker { color: var(--text-3); }
.prose code { font-family: var(--font-mono); font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 5px; }
.prose .short { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-24) var(--sp-24) 8px; margin-bottom: 8px; }
.prose .short h2 { margin-top: 0; }
.doc-meta { font-size: 14px; color: var(--text-3); }

/* 404 */
.nf { padding: 160px 0; display: flex; flex-direction: column; gap: var(--sp-24); align-items: flex-start; }

@media (max-width: 1023px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .toc { position: static; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-16) var(--sp-24); background: var(--surface); }
  .platforms, .notice-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .page-head { padding: 40px 0 32px; }
  .page-title { font-size: 32px; line-height: 38px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .kv dd { padding-top: 4px; }
  .notice, .platform { padding: var(--sp-24); }
  .prose h2 { font-size: 20px; line-height: 28px; margin-top: 40px; }
  .nf { padding: 80px 0; }
}

/* ---------- Site build additions ---------- */
html, body { margin: 0; }
.tv-site { --shadow-popover: 0 8px 24px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.08); min-height: 100vh; }
@media (prefers-color-scheme: dark) {
  .tv-site { --shadow-popover: 0 8px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.07); }
}
.nav a[aria-current="page"] { color: var(--text); }

/* Menu on tablet and phone: <details>, no script. The footer keeps every legal link visible anyway. */
.menu { display: none; position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--bg-3); }
.menu-panel { position: absolute; right: 0; top: 52px; z-index: 10; min-width: 240px; padding: var(--sp-8);
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); }
.menu-panel a { padding: 12px; border-radius: var(--radius-sm); font-size: 16px; line-height: 20px; text-decoration: none; color: var(--text); }
.menu-panel a:hover { background: var(--bg-3); }
.menu-panel a[aria-current="page"] { background: var(--bg-4); }
@media (max-width: 899px) { .menu { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 639px) { .ftr-top { flex-direction: column; align-items: flex-start; } }
