:root {
  /* Mirrors the app's ScranColor (light, white-first) + source palette */
  --bg: #ffffff;
  --panel: #f5f6f8;
  --panel2: #eceef2;
  --ink: #16191d;
  --ink-2: #3a3d42;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.14);
  --verified: #16191d;
  --database: #3d66d6;
  --estimate: #b07514;
  --error: #c2362c;
  --on-ink: #ffffff;

  --r-btn: 14px;
  --r-card: 20px;
  --r-lg: 28px;

  --font-display: "Archivo Black", system-ui, sans-serif;
  --font-body: "Inter Tight", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1140px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1); /* expo-out */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2.5px solid var(--database); outline-offset: 3px; border-radius: 8px; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 300; background: var(--ink); color: var(--on-ink); font-weight: 700; padding: 12px 18px; border-radius: 12px; transition: top 0.2s var(--ease); }
.skip-link:focus-visible { top: 12px; }

/* Mono accents — the app's "// microcopy" voice */
.mono-eyebrow { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink-2); margin-bottom: 20px; }
.mono-eyebrow--invert { color: rgba(255,255,255,0.7); }
.mono-note { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2); margin-top: 22px; }
.mono-note--invert { color: rgba(255,255,255,0.62); }

/* Display headings — Archivo Black, uppercase, tight */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; line-height: 1.02; text-transform: uppercase; text-wrap: balance; }
.section__lede, .honest__body, .hero__sub { text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: 15px 26px; border-radius: var(--r-btn);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--verified); color: var(--on-ink); }
.btn--primary:hover { transform: translateY(-2px); background: #000; }
.btn--ghost { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn--invert { background: #fff; color: var(--ink); }
.btn--invert:hover { transform: translateY(-2px); background: #f1f1f1; }
.btn span[aria-hidden] { display: inline-block; transition: transform 0.25s var(--ease); }
.btn:hover span[aria-hidden] { transform: translateX(4px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn--sm { padding: 10px 18px; font-size: 0.92rem; }
.btn--lg { padding: 17px 30px; font-size: 1.06rem; }

.link-quiet { font-family: var(--font-body); font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.link-quiet:hover { opacity: 0.6; }
.link-quiet--invert { color: rgba(255,255,255,0.9); }
.link-quiet--invert:hover { color: #fff; opacity: 1; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.82); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); transition: box-shadow 0.3s var(--ease); }
.nav.is-scrolled { box-shadow: 0 8px 24px -18px rgba(0,0,0,0.28); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand__mark { display: inline-flex; color: var(--ink); }
.brand__word { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.22em; }
.nav__links { display: flex; gap: 30px; font-family: var(--font-mono); font-size: 0.84rem; color: var(--ink-2); }
.nav__links a:hover { color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav__menu { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; background: none; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.nav__menu span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 0.3s var(--ease); transform-origin: center; }
.nav__menu[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__menu[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.nav__mobile { display: none; flex-direction: column; border-top: 1px solid var(--line); background: rgba(255,255,255,0.96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav__mobile a { font-family: var(--font-mono); font-size: 0.95rem; color: var(--ink); padding: 15px 24px; border-bottom: 1px solid var(--line); }
.nav__mobile a:active { background: var(--panel); }
.nav__mobile:not([hidden]) { display: flex; }

/* ---------- Hero ---------- */
.hero { padding: clamp(44px, 7vw, 88px) 0 clamp(36px, 5vw, 72px); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: clamp(28px, 5vw, 64px); }
.hero__title { font-size: clamp(2.7rem, 6.6vw, 5rem); }
.hero__sub { font-family: var(--font-body); margin-top: 26px; font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-2); max-width: 40ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* Hero entrance — one orchestrated sequence, gated on html.js so content is
   never hidden without JavaScript. Reduced-motion gets an instant page. */
html.js .hero-seq > *, html.js .hero-seq--device { opacity: 0; transform: translateY(22px); }
html.js.is-loaded .hero-seq > *, html.js.is-loaded .hero-seq--device { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
html.js.is-loaded .hero-seq > *:nth-child(1) { transition-delay: 0.05s; }
html.js.is-loaded .hero-seq > *:nth-child(2) { transition-delay: 0.14s; }
html.js.is-loaded .hero-seq > *:nth-child(3) { transition-delay: 0.26s; }
html.js.is-loaded .hero-seq > *:nth-child(4) { transition-delay: 0.36s; }
html.js.is-loaded .hero-seq > *:nth-child(5) { transition-delay: 0.46s; }
html.js.is-loaded .hero-seq--device { transition-delay: 0.3s; }
html.js.is-loaded .hero-seq--device > * { opacity: 1; transform: none; }

@keyframes phone-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
html.is-loaded .hero__device .phone { animation: phone-float 7s ease-in-out 1.4s infinite; }

/* ---------- Phone (device frame) ---------- */
.hero__device { display: flex; justify-content: center; }
.phone {
  width: min(290px, 76vw);
  background: var(--ink);
  border-radius: 46px;
  padding: 9px;
  box-shadow: 0 30px 60px -28px rgba(0,0,0,0.42), 0 0 0 1px rgba(0,0,0,0.05);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 38px;
  background: #fff;
}
.phone--sm { width: min(260px, 80vw); }

/* ---------- Source strip ---------- */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.strip__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; padding: 24px; }
.strip__lead { font-family: var(--font-body); font-weight: 600; font-size: 1.02rem; }
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 9px; border: 1px solid;
}
.badge svg { flex: none; }
.badge--verified { color: var(--verified); border-color: rgba(22,25,29,0.35); background: rgba(22,25,29,0.06); }
.badge--database { color: var(--database); border-color: rgba(61,102,214,0.35); background: rgba(61,102,214,0.08); }
.badge--estimate { color: var(--estimate); border-color: rgba(176,117,20,0.35); background: rgba(176,117,20,0.09); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 116px) 0; }
.section--tint { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 640px; margin-bottom: clamp(38px, 5vw, 60px); }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section__title { font-size: clamp(1.9rem, 4vw, 3.1rem); }
.section__lede { font-family: var(--font-body); margin-top: 20px; color: var(--ink-2); font-size: 1.12rem; text-transform: none; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px 22px; transition: transform 0.2s ease, border-color 0.2s ease; }
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card__tag { display: inline-flex; font-family: var(--font-mono); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 7px; margin-bottom: 18px; }
.tag--verified { color: var(--verified); background: rgba(22,25,29,0.07); }
.tag--database { color: var(--database); background: rgba(61,102,214,0.10); }
.tag--estimate { color: var(--estimate); background: rgba(176,117,20,0.11); }
.card h3 { font-size: 1.18rem; margin-bottom: 9px; }
.card p { font-family: var(--font-body); color: var(--ink-2); font-size: 0.96rem; text-transform: none; }

/* The maths */
.maths { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 5vw, 72px); }
.ticks { list-style: none; margin-top: 26px; display: grid; gap: 13px; }
.ticks li { font-family: var(--font-body); position: relative; padding-left: 30px; font-weight: 500; color: var(--ink); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 6px; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }

.equation { background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-card); padding: 30px 28px; box-shadow: 0 18px 44px -26px rgba(0,0,0,0.25); }
.equation__label { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); margin-bottom: 12px; }
.equation__line { font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1; }
.equation__line .eq-unit { font-family: var(--font-mono); font-size: 1rem; color: var(--ink-2); margin-left: 6px; }
.equation__work { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-top: 20px; font-family: var(--font-mono); font-size: 0.96rem; }
.equation__work span { display: inline-flex; gap: 6px; align-items: baseline; }
.equation__work i { font-style: normal; color: var(--ink-2); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; }
.equation__work .eq-op { color: var(--database); font-weight: 700; }
.equation__src { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2); margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.equation__src strong { color: var(--ink); }

/* Light/dark duo */
.duo { display: flex; justify-content: center; gap: clamp(18px, 4vw, 46px); flex-wrap: wrap; }

/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 30px 26px; }
.step__n { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--database); display: block; margin-bottom: 16px; }
.step h3 { font-size: 1.2rem; margin-bottom: 9px; }
.step p { font-family: var(--font-body); color: var(--ink-2); text-transform: none; }

/* Manifesto */
.honest { max-width: 900px; }
.honest__title { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.honest__body { font-family: var(--font-body); margin-top: 26px; font-size: 1.18rem; color: var(--ink-2); max-width: 64ch; text-transform: none; }

/* CTA */
.cta { padding: clamp(56px, 8vw, 108px) 0; }
.cta__inner { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: clamp(48px, 6vw, 84px) 28px; text-align: center; }
.cta__title { font-size: clamp(2.4rem, 6vw, 4rem); color: #fff; }
.cta__sub { font-family: var(--font-body); margin-top: 14px; color: rgba(255,255,255,0.78); font-size: 1.1rem; }
.cta__actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: center; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 44px 0; background: var(--bg); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.brand--sm .brand__word { font-size: 0.92rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2); }
.footer__links a:hover { color: var(--ink); }
.footer__legal { width: 100%; font-family: var(--font-mono); color: var(--ink-2); font-size: 0.78rem; padding-top: 10px; border-top: 1px solid var(--line); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
/* Stagger groups: container stays visible, children cascade (70ms apart). */
.reveal[data-stagger] { opacity: 1; transform: none; }
[data-stagger] > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
[data-stagger].is-visible > * { opacity: 1; transform: none; }
/* Equation: operators pop in sequence once the card is on screen. */
.equation .eq-op { display: inline-block; opacity: 0; transform: scale(0.6); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
.reveal.is-visible .equation__work .eq-op:nth-child(2) { transition-delay: 0.5s; }
.reveal.is-visible .equation__work .eq-op:nth-child(4) { transition-delay: 0.9s; }
.reveal.is-visible .eq-op { opacity: 1; transform: none; }
.eq-num { font-weight: 700; font-style: normal; }
@media (prefers-reduced-motion: reduce) {
  .reveal, [data-stagger] > *, .equation .eq-op,
  html.js .hero-seq > *, html.js .hero-seq--device { opacity: 1; transform: none; transition: none; }
  html.is-loaded .hero__device .phone { animation: none; }
  .btn, .btn span[aria-hidden], .card, .skip-link, .nav__menu span { transition: none; }
}

/* Responsive */
@media (max-width: 940px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__menu { display: flex; }
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__cta { justify-content: center; }
  .hero__device { margin-top: 20px; }
  .mono-eyebrow, .mono-note { text-align: inherit; }
  .maths { grid-template-columns: 1fr; }
  .ticks { display: inline-grid; text-align: left; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .nav__actions .link-quiet { display: none; }
  /* Let the headline wrap naturally on narrow screens — forced breaks fight 320px. */
  .hero__title br { display: none; }
  .hero__title { font-size: clamp(2.35rem, 11.5vw, 2.7rem); }
  .cta__inner { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Legal pages (privacy / terms / cookies) ---------- */
.legal { padding: clamp(40px, 7vw, 84px) 0 92px; }
.legal__wrap { max-width: 768px; margin: 0 auto; }
.legal__title { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 10px; }
.legal__updated { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2); margin-bottom: 30px; }
.legal__lede { font-size: 1.08rem; color: var(--ink-2); margin-bottom: 26px; }
.legal h2 { font-family: var(--font-body); font-weight: 700; text-transform: none; letter-spacing: -0.01em; font-size: 1.34rem; line-height: 1.22; margin: 42px 0 12px; scroll-margin-top: 88px; }
.legal h3 { font-family: var(--font-body); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 1.06rem; margin: 26px 0 8px; }
.legal p { margin: 0 0 14px; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 7px; }
.legal a { color: var(--database); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { opacity: 0.72; }
.legal__note { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 28px; line-height: 1.55; }
.legal__toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 22px; margin: 0 0 36px; }
.legal__toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
.legal__toc li { margin-bottom: 5px; }
.legal__toc a { color: var(--ink); text-decoration: none; font-size: 0.94rem; }
.legal__toc a:hover { color: var(--database); }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.94rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { font-weight: 700; }
/* Marked placeholders the company must fill before publishing. */
.legal__ph { background: rgba(176,117,20,0.14); color: var(--estimate); padding: 1px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: 0.85em; }
@media (max-width: 620px) { .legal__toc ul { columns: 1; } }

/* ---------- Cookie consent banner ---------- */
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200; max-width: 560px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: 0 14px 44px rgba(0,0,0,0.16); padding: 18px 20px; }
.cookie[hidden] { display: none; }
.cookie__text { font-size: 0.92rem; color: var(--ink); margin-bottom: 14px; }
.cookie__text a { color: var(--database); text-decoration: underline; }
.cookie__row { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie .btn { padding: 10px 18px; font-size: 0.9rem; }
.page-404 { text-align: center; padding: clamp(60px, 14vw, 160px) 0; }
.page-404 h1 { font-size: clamp(2.4rem, 9vw, 4rem); margin-bottom: 14px; }
