/* Toser — "annotated fine print". Shared design system for every marketing page. Mobile first. */
:root {
  /* ink & paper */
  --bg: #0D0D0F; --bg-2: #111113; --surface: #151517; --surface-2: #1B1B1E; --surface-3: #232327;
  --border: rgba(238,232,221,.09); --border-strong: rgba(238,232,221,.17);
  --text: #EEE8DD; --text-2: #B3AC9F; --muted: #7A746A;
  /* marker & annotations */
  --marker: #FF9029; --marker-ink: #1A0E03; --marker-soft: rgba(255,144,41,.14); --marker-line: rgba(255,144,41,.4);
  --redline: #FF7A59; --sage: #8BD3A5; --pencil: #9DB4FF;
  /* legacy aliases used by older page styles */
  --brand: var(--marker); --brand-2: var(--marker); --brand-3: var(--pencil);
  --brand-soft: var(--marker-soft); --brand-line: var(--marker-line);
  --grad: linear-gradient(var(--marker), var(--marker));
  --ok: var(--sage); --warn: var(--marker); --bad: var(--redline);
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 60px -30px rgba(0,0,0,.8);
  --glow: 0 0 0 1px rgba(255,144,41,.5), 0 12px 40px -14px rgba(255,144,41,.45);
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --container: 1180px; --gutter: 16px; --nav-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --gutter: 32px; --nav-h: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
/* ASCII snow (drawn by base.js): sits behind the header and hero, scrolls with the page, fades into the ink. */
body { position: relative; }
#snow { position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: clamp(760px, 140vh, 1500px); pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.9) 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.9) 40%, transparent 100%); }
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--marker); color: var(--marker-ink); }
:focus-visible { outline: 2px solid var(--marker); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--marker); color: var(--marker-ink); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 80px 0; position: relative; }
@media (min-width: 768px) { .section { padding: 128px 0; } }
.grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid { gap: 20px; } }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }

/* Type */
h1, h2, h3, h4 { margin: 0; line-height: 1.08; font-weight: 400; letter-spacing: -.01em; }
.display, .h2 { font-family: var(--serif); font-weight: 400; text-wrap: balance; }
.display { font-size: clamp(3rem, 12.5vw, 6.6rem); line-height: .95; letter-spacing: -.025em; }
.h2 { font-size: clamp(2.3rem, 7.5vw, 4rem); line-height: 1; letter-spacing: -.02em; }
.h3 { font-family: var(--font); font-size: clamp(1.1rem, 2.2vw, 1.25rem); font-weight: 560; letter-spacing: -.01em; line-height: 1.3; }
.display em, .h2 em { font-style: italic; }
.lead { font-size: clamp(1.06rem, 2.3vw, 1.25rem); color: var(--text-2); line-height: 1.55; text-wrap: pretty; }
.muted { color: var(--muted); }
p { margin: 0; color: var(--text-2); text-wrap: pretty; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-2);
}
.eyebrow::before { content: "§"; font-family: var(--serif); font-size: 18px; letter-spacing: 0; color: var(--marker); text-transform: none; }
.gradient-text { color: var(--marker); font-style: italic; }
.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.section-head .h2 { margin: 16px 0 18px; }
code, .mono { font-family: var(--mono); }
.hand { font-family: var(--hand); font-weight: 600; color: var(--marker); letter-spacing: .01em; }

/* Highlighter: put .mark on inline text; add .on (or let JS add it) to sweep it in */
.mark {
  color: inherit; padding: 0 .12em; margin: 0 -.06em; border-radius: .2em .5em .25em .45em;
  background-image: linear-gradient(100deg, rgba(255,144,41,0) 0, rgba(255,144,41,.92) 2%, rgba(255,144,41,.78) 50%, rgba(255,144,41,.9) 97%, rgba(255,144,41,0) 100%);
  background-repeat: no-repeat; background-size: 0% 82%; background-position: 0 60%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 1s var(--ease) var(--d, .2s), color .3s var(--ease) var(--d, .2s);
}
.mark.on, .no-js .mark { background-size: 100% 82%; color: var(--marker-ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px;
  border-radius: var(--r); border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font-weight: 560; font-size: 15px; letter-spacing: -.005em; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .3s var(--ease), color .2s;
}
.btn:hover { background: rgba(238,232,221,.05); border-color: rgba(238,232,221,.3); }
.btn:active { transform: translateY(1px); }
.btn-primary { border-color: transparent; background: var(--marker); color: var(--marker-ink); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 30px -12px rgba(255,144,41,.55); }
.btn-primary:hover { background: #FFA54D; border-color: transparent; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 16px 40px -14px rgba(255,144,41,.7); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-chrome svg { width: 18px; height: 18px; flex: none; }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--marker-line); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: var(--marker); }

/* Surfaces: sheets of paper */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.035) inset;
}
@media (min-width: 768px) { .card { padding: 30px; } }
.card-hover { transition: border-color .3s var(--ease), transform .3s var(--ease); }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.glass { background: rgba(21,21,23,.72); backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--border-strong); color: var(--text-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px rgba(139,211,165,.15); }
.clause-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.6; color: var(--marker); background: var(--marker-soft); border: 1px solid var(--marker-line); white-space: nowrap;
}
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.high { color: var(--sage); } .badge.medium { color: var(--marker); } .badge.low { color: var(--redline); }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--text-2); }
hr.rule { border: 0; height: 1px; background: var(--border); margin: 0; }

/* Background ornaments (ruled paper + warm lamp glow) */
.bg-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(238,232,221,.045) 31px 32px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .16; pointer-events: none; }
.orb-violet, .orb-blue { background: #FF9029; } .orb-cyan { background: #FF7A59; opacity: .08; }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h); border-bottom: 1px solid transparent; transition: background .3s var(--ease), border-color .3s var(--ease); }
.site-header.scrolled { background: rgba(13,13,15,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--border); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* Logo: orange § glued to white "Toser", both in Instrument Serif italic. In italic the two glyphs' ink
   meets exactly at the natural advance, so no spacing is added or removed. */
.brand, .wm { display: inline-flex; align-items: baseline; font-family: var(--serif); font-style: italic; font-weight: 400;
  line-height: 1; letter-spacing: 0; color: #FFFFFF; white-space: nowrap; }
.brand { font-size: 32px; }
.brand .sym, .wm .sym { color: var(--marker); margin: 0; }
/* App tile: the § alone on ink, used where the full logo is too small. */
.sym-tile { display: inline-grid; place-items: center; width: 100%; height: 100%; border-radius: 22%; background: #0D0D0F;
  color: var(--marker); font-family: var(--serif); font-style: italic; line-height: 1; font-size: 1.2em; }
.nav-links { display: none; align-items: center; gap: 2px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-size: 15px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--marker); text-underline-offset: 6px; }
.nav-cta { display: none; align-items: center; gap: 8px; }
.nav-toggle { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border-strong); background: transparent; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 2px; position: relative; transition: transform .3s var(--ease), background .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49; padding: 12px var(--gutter) 32px; background: rgba(13,13,15,.97);
  display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}
.nav-open .mobile-menu { opacity: 1; visibility: visible; transform: none; }
.nav-open { overflow: hidden; }
.mobile-menu a:not(.btn) { display: flex; align-items: baseline; gap: 14px; padding: 16px 2px; font-family: var(--serif); font-size: 30px; border-bottom: 1px solid var(--border); }
.mobile-menu a:not(.btn)::before { content: attr(data-n); font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 22px; }
.mobile-menu .btn { margin-top: 24px; }
@media (min-width: 960px) { .nav-links, .nav-cta { display: flex; } .nav-toggle, .mobile-menu { display: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; }
.footer-grid .footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin-top: 14px; max-width: 340px; font-size: 15px; }
.footer-col h4 { font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer-col a { display: block; padding: 6px 0; color: var(--text-2); font-size: 15px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--muted); font-size: 13px; font-family: var(--mono); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-grid .footer-brand { grid-column: auto; } }

/* Forms */
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; color: var(--text-2); font-weight: 500; }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--border-strong);
  transition: border-color .2s, box-shadow .2s; font-size: 16px;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--marker); box-shadow: 0 0 0 3px rgba(255,144,41,.18); }

/* Reveal on scroll (base.js adds .in) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

main { padding-top: var(--nav-h); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Above-the-fold entrance: pure CSS, no JS dependency */
.rise { animation: rise .9s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Text that must paint above a highlighted line below it (descenders over the marker). */
.ink-over { position: relative; z-index: 1; }
