/* The Orvel download site. One stylesheet: fonts, tokens, base,
 * then the sections in page order. The look matches the app (Orvin's
 * colours, Sora and IBM Plex Sans); fonts are copied in by build.py. */

@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("fonts/sora-latin-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url("fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations"); }

:root {
  color-scheme: light;
  --bg: #F7F8FA; --surface: #fff; --tint: #ECEFFB;
  --ink: #1A1D29; --ink-2: #454A5E; --muted: #666C82;
  --rule: #E3E6EC; --rule-strong: #CDD2DC;
  --accent: #3E5CE0; --accent-dark: #2F47B8; --accent-soft: #E9EDFD;
  --night: #12141C; --night-2: #1B1E2A; --night-rule: #2C3040; --night-ink: #F2F3F7; --night-muted: #A4A9BC;
  --green: #177A53; --green-bg: #E8F7EF; --amber: #94591A; --amber-bg: #FFF3E0;
  --red: #B42318; --violet: #6A3FC8; --violet-bg: #F1ECFC;
  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --container: 1200px; --gutter: 32px; --section: 104px; --nav-h: 4rem;
  --radius: 14px; --radius-s: 8px;
  --shadow: 0 1px 2px rgb(18 20 28 / 0.05), 0 12px 32px -12px rgb(18 20 28 / 0.14);
  --shadow-lift: 0 2px 4px rgb(18 20 28 / 0.06), 0 28px 56px -20px rgb(18 20 28 / 0.28);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 1.5rem); scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(2.375rem, 3.2vw + 1.25rem, 3.75rem); font-weight: 700; line-height: 1.06; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.75rem, 1.8vw + 1.125rem, 2.5rem); font-weight: 600; line-height: 1.12; }
h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.lead { font-size: clamp(1.0625rem, 0.3vw + 1rem, 1.2rem); line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #2E9E6E; box-shadow: 0 0 0 4px rgb(46 158 110 / 0.15); }
.skip { position: absolute; left: 1rem; top: -6rem; z-index: 50; padding: 0.5rem 1rem; border-radius: var(--radius-s); background: var(--ink); color: #fff; }
.skip:focus-visible { top: 1rem; }
section { padding-block: var(--section); }
.head { display: grid; gap: 0.9rem; margin-bottom: 3rem; max-width: 46rem; }
.head .eyebrow { margin: 0; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font: 600 0.6875rem/1.5 var(--font-body); letter-spacing: 0.02em; vertical-align: middle; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0 1.3rem; border-radius: var(--radius-s); border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn-quiet:hover { background: var(--surface); border-color: var(--ink-2); }
.btn-small { min-height: 2.4rem; padding: 0 1rem; font-size: 0.9375rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* nav */
.nav { position: sticky; top: 0; z-index: 40; background: rgb(247 248 250 / 0.85); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.nav-bar { display: flex; align-items: center; gap: 2rem; height: var(--nav-h); }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; font: 600 1.0625rem var(--font-display); text-decoration: none; letter-spacing: -0.01em; }
.wordmark img { border-radius: 7px; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; font-size: 0.9375rem; color: var(--ink-2); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--accent); }

/* hero */
.hero { padding-top: 4.5rem; padding-bottom: 5.5rem; position: relative; }
.hero::before { content: ""; position: absolute; inset: -10rem 0 auto auto; width: 60rem; height: 44rem; background: radial-gradient(closest-side, rgb(62 92 224 / 0.14), transparent); pointer-events: none; z-index: -1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 3.5rem; align-items: center; }
.hero-text { display: grid; gap: 1.4rem; }
.hero-text .eyebrow { margin: 0; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 0.875rem; padding: 0.3rem 0.8rem 0.3rem 0.65rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; justify-self: start; }
.small-print { font-size: 0.875rem; color: var(--muted); }
.small-print a { color: var(--accent); }
.ticks { list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: 0.9375rem; color: var(--ink-2); }
.ticks li { display: inline-flex; align-items: center; gap: 0.45rem; }
.ticks .icon { color: var(--green); }
.hero-visual { position: relative; }
.window { margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-lift); }
.window-bar { display: flex; gap: 6px; padding: 10px 12px; background: #F1F2F5; border-bottom: 1px solid var(--rule); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: #D5D8DF; }
.hero .window { transform: perspective(2000px) rotateY(-4deg); transform-origin: left center; }
.chip { position: absolute; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-lift); font-size: 0.8125rem; }
.chip-stock { left: -2rem; bottom: -1.6rem; padding: 0.75rem 1rem; }
.chip-top { color: var(--muted); }
.chip-top .mono { color: var(--ink); font-weight: 600; margin-right: 0.35rem; }
.chip-count { margin-top: 0.2rem; font-weight: 600; font-size: 1rem; }
.chip-count em { font-style: normal; color: var(--red); font-size: 0.8125rem; margin-left: 0.3rem; }
.chip-paid { right: -1.2rem; top: 18%; display: flex; gap: 0.6rem; align-items: center; padding: 0.7rem 0.95rem; }
.chip-paid .icon { color: var(--green); width: 1.5rem; height: 1.5rem; }
.chip-paid strong, .chip-paid span { display: block; }
.chip-paid span { color: var(--muted); }

/* how it works */
.flow-section { background: var(--surface); border-block: 1px solid var(--rule); }
.flow { list-style: none; padding: 0; margin: 0; display: flex; align-items: stretch; }
.flow-step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; padding: 1.25rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); }
.flow-step > .icon { width: 1.6rem; height: 1.6rem; color: var(--accent); margin: 0.35rem 0 0.2rem; }
.flow-step p { font-size: 0.9rem; color: var(--ink-2); }
.flow-arrow { flex: 0 0 2rem; display: grid; place-items: center; color: var(--rule-strong); }
.flow-tag { align-self: flex-start; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.tag-violet { background: var(--violet-bg); color: var(--violet); }
.tag-blue { background: var(--accent-soft); color: var(--accent-dark); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-green { background: var(--green-bg); color: var(--green); }
.ledger { margin-top: auto; display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.7rem; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--rule); font-size: 0.8125rem; }
.ledger .down { color: var(--red); font-weight: 600; }
.ledger .up { color: var(--green); font-weight: 600; }
.flow-buy { margin-top: 1.25rem; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border: 1px dashed var(--rule-strong); border-radius: var(--radius); color: var(--ink-2); }
.flow-buy > .icon { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.flow-buy p { flex: 1; }
.flow-buy .ledger { margin: 0; min-width: 11rem; }

/* modules */
.module-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.module-grid li { padding: 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 0.6rem; align-content: start; transition: transform 0.15s, box-shadow 0.15s; }
.module-grid li:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.module-grid li p { color: var(--ink-2); font-size: 0.9375rem; }
.module-grid li.soon { background: transparent; border-style: dashed; box-shadow: none; }
.module-icon { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.module-icon .icon { width: 1.4rem; height: 1.4rem; }
.extras { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.extras li { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); font-size: 0.9rem; color: var(--ink-2); }
.extras .icon { color: var(--accent); }

/* screens */
.tour { background: var(--night); color: var(--night-ink); }
.tour h2 { color: #fff; }
.tour .lead { color: var(--night-muted); }
.tour-body { display: grid; grid-template-columns: minmax(15rem, 0.32fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.tour-tabs { display: grid; gap: 0.5rem; }
.tour-tabs button { text-align: left; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--night-rule); background: transparent; color: var(--night-muted); cursor: pointer; display: grid; gap: 0.25rem; transition: background 0.15s, border-color 0.15s; }
.tour-tabs button strong { color: var(--night-ink); font-weight: 600; }
.tour-tabs button span { font-size: 0.875rem; }
.tour-tabs button:hover { background: var(--night-2); }
.tour-tabs button[aria-selected="true"] { background: var(--night-2); border-color: var(--accent); }
.tour .window { border-color: var(--night-rule); }
.tour-panes section { padding: 0; }
.tour-panes { position: sticky; top: 5.5rem; }  /* the screen stays in view beside a long list of tabs */

/* data */
.data-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
.tree { list-style: none; padding: 1.25rem 1.4rem; margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); font-size: 0.9375rem; box-shadow: var(--shadow); }
.tree li { display: flex; gap: 1rem; padding: 0.35rem 0 0.35rem 1.25rem; }
.tree li:first-child { padding-left: 0; }
.tree i { font-style: normal; font-family: var(--font-mono); font-size: 0.875rem; min-width: 9rem; }
.tree span { color: var(--muted); }
.rows { margin: 0; display: grid; gap: 1rem; }
.rows > div { padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.rows dt { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; margin-bottom: 0.3rem; }
.rows dt .icon { color: var(--accent); }
.rows dd { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }

/* run it */
.run { background: var(--surface); border-block: 1px solid var(--rule); }
.run-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.run-grid article { padding: 1.75rem; border: 1px solid var(--rule); border-radius: var(--radius); display: grid; gap: 0.85rem; align-content: start; background: var(--bg); }
.run-grid article p { color: var(--ink-2); }
.run-grid .btn { justify-self: start; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; font-size: 0.9375rem; }
.checks li::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 0.55rem; }
.code { margin: 0; padding: 0.85rem 1rem; border-radius: var(--radius-s); background: var(--night); color: #E6E8F0; font: 0.875rem/1.5 var(--font-mono); overflow-x: auto; }

/* download */
.close-panel { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 3rem; align-items: center; padding: 3rem; border-radius: 22px; background: var(--night); color: var(--night-ink); position: relative; overflow: hidden; }
.close-panel::after { content: ""; position: absolute; right: -10rem; bottom: -14rem; width: 34rem; height: 34rem; border-radius: 50%; background: radial-gradient(closest-side, rgb(62 92 224 / 0.45), transparent); pointer-events: none; }
.close-panel h2 { color: #fff; margin-bottom: 0.8rem; }
.close-panel .lead { color: var(--night-muted); }
.close-actions { position: relative; z-index: 1; display: grid; gap: 1rem; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; }
.dl { display: flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1rem; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--night-rule); color: var(--night-ink); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.dl:hover { border-color: var(--accent); background: #20243A; }
.dl .icon { color: #8FA2FF; width: 1.4rem; height: 1.4rem; }
.dl strong, .dl small { display: block; }
.dl small { color: var(--night-muted); }
.first-open { border: 1px solid var(--night-rule); border-radius: var(--radius); padding: 0.85rem 1.1rem; font-size: 0.9rem; color: var(--night-muted); }
.first-open summary { cursor: pointer; color: var(--night-ink); font-weight: 500; }
.first-open p { margin-top: 0.65rem; }
.first-open strong { color: var(--night-ink); }

/* footer */
.footer { padding: 2.5rem 0 3rem; }
.footer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.9375rem; color: var(--ink-2); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { width: 100%; color: var(--muted); font-size: 0.875rem; }

@media (max-width: 1020px) {
  :root { --section: 80px; --gutter: 24px; }
  .hero-grid, .data-grid, .close-panel, .tour-body { grid-template-columns: 1fr; }
  .tour-panes { position: static; }
  .hero .window { transform: none; }
  .chip-stock { left: 0.75rem; }
  .chip-paid { right: 0.75rem; }
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); flex-basis: 2rem; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .tour-tabs { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-bar .btn { margin-left: auto; }
}
@media (max-width: 640px) {
  :root { --section: 64px; --gutter: 16px; }
  .module-grid, .run-grid, .downloads, .tour-tabs { grid-template-columns: 1fr; }
  .close-panel { padding: 1.75rem; }
  .chip { display: none; }
  .flow-buy { flex-direction: column; align-items: flex-start; }
  .tree i { min-width: 7rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- help page ---------- */
.help-body { padding-block: 3.5rem 4rem; max-width: 52rem; }
.help h1 { font-size: clamp(2rem, 2.4vw + 1.2rem, 3rem); line-height: 1.08; }
.help section { padding-top: 2.5rem; margin-top: 2.5rem; border-top: 1px solid var(--rule); scroll-margin-top: 5rem; }
.help section h2 { font-size: clamp(1.5rem, 1vw + 1.1rem, 2rem); margin-bottom: 1rem; }
.help section h3 { margin: 1.5rem 0 0.5rem; }
.help ol, .help ul { padding-left: 1.25rem; display: grid; gap: 0.45rem; color: var(--ink-2); }
.help p { color: var(--ink-2); max-width: 65ch; }
.help code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2, #F3F4F7); padding: 0.1em 0.35em; border-radius: 4px; }
.help pre.code code { background: none; padding: 0; color: inherit; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.help-cards article { padding: 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.help-cards h3 { margin-top: 0; }
