/* ==========================================================================
   PDF Sign — landing page
   Dark-first, Linear structure + Raycast visual weight.
   Single accent: cherry-scarlet.
   ========================================================================== */

/* Self-hosted variable fonts (Latin subset, from @fontsource-variable).
   Preloaded in index.html so the browser has the file before first paint —
   this is what makes font-display: swap non-visible in practice (no swap
   happens because the variable WOFF2 is already in cache). */
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette */
  --bg:           #0A0A0A;
  --bg-section:   #111111;
  --bg-elevated:  #161616;
  --border:       #27272A;
  --border-soft:  #1F1F22;
  --text:         #FAFAFA;
  --text-dim:     #A1A1AA;
  --text-mute:    #71717A;

  --accent:       #B91C1C;   /* cherry-scarlet */
  --accent-hover: #991B1B;
  --accent-soft:  rgba(185, 28, 28, 0.12);
  --accent-glow:  rgba(185, 28, 28, 0.45);

  --ok:           #16A34A;   /* tailwind green-600 — confirmation/success */
  --ok-soft:      rgba(22, 163, 74, 0.12);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;

  /* Spacing */
  --container: 1120px;

  /* Motion — split semantically.
     --ease-out  : entrance (default for new elements appearing) — expo-out
     --ease-in   : exit (elements leaving the viewport / collapsing)
     --ease-soft : state change (color, border-color, opacity transitions on hover/focus)
     --ease-bounce: accent only (intentional overshoot — confined to a small handful of decorative cases) */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:     cubic-bezier(0.5, 0, 1, 0.5);
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Tiled SVG noise (subtle film grain, data-URL so no extra request) */
  --noise-url: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ========================================================= RESET */

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No scroll-behavior: smooth — Lenis owns the scroll. Native smooth
     scroll fights Lenis, producing the "delay then jump" feel. */
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease-soft);
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 600;
}

p { margin: 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

/* ==================================================== TYPOGRAPHY */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 20px;
}

.section__h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  /* No max-width — each H2 fits on one line at desktop widths. Mobile
     below 720px falls back to natural multi-line wrap via the fluid
     clamp() font size. */
  text-wrap: balance;
  margin-bottom: 48px;
}

.accent { color: var(--accent); }

/* ========================================================= BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s var(--ease-soft), border-color 0.15s var(--ease-soft), transform 0.1s var(--ease-soft);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn--sm { padding: 8px 14px; font-size: 13px; }

.btn--lg {
  padding: 14px 22px;
  font-size: 15px;
  border-radius: var(--r-md);
}

.btn--primary {
  background: var(--accent);
  color: var(--text);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--text-dim);
  background: var(--bg-elevated);
}

.btn--block { width: 100%; }

/* ============================================================ NAV */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav__brand img { border-radius: 6px; }

.nav__links {
  display: flex;
  gap: 28px;
  margin-left: 24px;
  flex: 1;
  font-size: 14px;
  color: var(--text-dim);
}

.nav__links a:hover { color: var(--text); }

@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ========================================================== HERO */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  isolation: isolate;
}

/* ---- Hero image background with slow Ken-Burns zoom ----
   No `will-change` — the animation is infinite and keeping a permanent
   compositor hint costs memory without a rendering win. */
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -3;
  animation: ken-burns 22s ease-in-out infinite alternate;
  transform: translateZ(0);   /* promote to own layer once, no per-frame hint */
}
@keyframes ken-burns {
  from { transform: scale(1)   translate3d(0, 0, 0); }
  to   { transform: scale(1.05) translate3d(-1%, -1.5%, 0); }
}

/* ---- Vertical dark gradient for text contrast ----
   Darker middle band so cherry-scarlet text reads on bright image zones. */
.hero__gradient {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg,
      rgba(10, 10, 10, 0.65) 0%,
      rgba(10, 10, 10, 0.55) 45%,
      rgba(10, 10, 10, 0.88) 100%),
    radial-gradient(ellipse 60% 45% at 50% 55%, rgba(185, 28, 28, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Film grain tile (SVG data-URL from :root --noise-url) ----
   Plain opacity — no `mix-blend-mode: overlay`, which forces a full-page
   composite every frame and is the #1 cause of scroll jank on this page. */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--noise-url);
  background-size: 200px 200px;
  opacity: 0.25;
  pointer-events: none;
}

.hero__inner {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero__h1 {
  font-size: clamp(40px, 5.2vw + 1vh, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  max-width: 20ch;
  margin-inline: auto;
  font-variation-settings: "wght" 600;
}

.hero__line {
  display: block;
}

.hero__h1 {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Brighten the accent on the photographic hero — #B91C1C cherry is
   too dim against warm-gold zones of the Firefly image. Keeps brand
   color in other contexts (about, FAQ) untouched. */
.hero__h1 .accent {
  color: #F87171;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7), 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Stagger indices for hero words. Previously baked into HTML via
   inline `style="--word-i:N"` attrs; moved to CSS so the page works
   under strict CSP `style-src 'self'` (no `'unsafe-inline'`). */
.hero__line:first-child .word:nth-child(1) { --word-i: 0; }
.hero__line:first-child .word:nth-child(2) { --word-i: 1; }
.hero__line:first-child .word:nth-child(3) { --word-i: 2; }
.hero__line:first-child .word:nth-child(4) { --word-i: 3; }
.hero__line:first-child .word:nth-child(5) { --word-i: 4; }
.hero__line:last-child  .word:nth-child(1) { --word-i: 5; }
.hero__line:last-child  .word:nth-child(2) { --word-i: 6; }

/* Default (CSS-only fallback) — per-word animation as before. */
.hero__h1 .word {
  display: inline-block;
  margin-right: 0.22em;
}

body:not(.js-hero-chars) .hero__h1 .word {
  opacity: 0;
  transform: translateY(18px);
  animation: word-in 0.85s var(--ease-bounce) forwards;
  animation-delay: calc(0.25s + var(--word-i, 0) * 0.08s);
}

/* When JS char-split runs, the word containers are static; characters animate. */
body.js-hero-chars .hero__h1 .word {
  opacity: 1;
  transform: none;
  animation: none;
}

body.js-hero-chars .hero__h1 .char {
  /* Display: inline (NOT inline-block) so chars stay inside the inline flow:
     preserves kerning across char boundaries and prevents intra-word line
     breaks. Without this, font-swap from system fallback to Inter would
     cause the H1 to re-wrap (1 line ↔ 2 lines), producing a large CLS. */
  display: inline;
  opacity: 0;
  /* Opacity-only animation — transform on inline is ineffective.
     Trade-off: lose the per-char "rise" but keep layout stable through
     the entire font-load + JS-init window. */
  will-change: opacity;
}

@keyframes word-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero__sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 auto 36px;
  line-height: 1.55;
}

.hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}


/* ======================================================== TRUSTBAR */

.trustbar {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 18px 0;
  background: var(--bg-section);
}

.trustbar__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  /* Reserve space — three chips at one row on desktop, max two rows on mobile.
     Prevents layout shift if SVG paint is delayed (it shouldn't be — inline). */
  min-height: 36px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease-soft), color 0.15s var(--ease-soft);
}

.chip__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-mute);
  transition: color 0.15s var(--ease-soft);
}

.chip--link {
  cursor: pointer;
}

.chip--link:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.chip--link:hover .chip__icon {
  color: var(--accent);
}

/* =================================================== SECTION BASE */

.section {
  padding: 112px 0;
}

@media (max-width: 720px) {
  .section { padding: 72px 0; }
}

/* ================================================== HOW IT WORKS */

.how__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.how__step {
  padding: 32px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--bg-section);
  transition: border-color 0.2s var(--ease-soft);
}

.how__step:hover { border-color: var(--border); }

.how__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.how__step h3 {
  font-size: 18px;
  margin: 12px 0 8px;
}

.how__step p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 840px) {
  .how__grid { grid-template-columns: 1fr; }
}

/* ======================================================= PRIVACY */

.privacy {
  background: var(--bg-section);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.privacy__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.privacy__body {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 24px;
  line-height: 1.65;
}

.privacy__note {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.8;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  background: var(--bg-elevated);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.privacy__note code { color: var(--text-dim); }

/* Privacy diagram:
   Triangle layout with Browser at the top apex and Disk / Signed PDF at
   the bottom corners. Dashed edges trace Disk → Browser → Signed → back
   to Disk; each node's cherry contour pulses in that same order. All
   three nodes sit inside the YOUR COMPUTER container; no arrow ever
   exits the box. */
.privacy__diagram {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.privacy__box {
  position: relative;
  padding: 36px 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
}

.privacy__box-label {
  position: absolute;
  top: -9px;
  left: 20px;
  padding: 0 10px;
  background: var(--bg-section);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-mute);
}

.privacy__loop {
  width: 100%;
  height: auto;
  display: block;
}

/* Contour pulse: each node's border glows cherry-scarlet in sequence
   (Disk → Browser → Signed → loop). The cycle conveys meaning — the data
   keeps moving inside the client's computer, never leaving. So this is
   exempt from the "no infinite decorative animation" rule. 4.5 s total
   cycle; each node is active ~30 % of the cycle. */
.privacy__node rect {
  animation: privacy-pulse 4.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.privacy__node--disk rect    { animation-delay: 0s;   }
.privacy__node--browser rect { animation-delay: 1.5s; }
.privacy__node--signed rect  { animation-delay: 3s;   }

@keyframes privacy-pulse {
  0%, 30%, 100% {
    stroke: #27272A;
    filter: none;
  }
  5%, 25% {
    stroke: #B91C1C;
    filter: drop-shadow(0 0 10px rgba(185, 28, 28, 0.45));
  }
}

.diagram__note {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .privacy__node rect { animation: none; stroke: #27272A; filter: none; }
}

@media (max-width: 840px) {
  .privacy__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ======================================================= FEATURES */

.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(260px, auto);
  gap: 20px;
}

.card {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--bg-section);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
}

.card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

/* Text-only card (no illustration). Centers copy vertically so the box
   doesn't read as half-empty next to illustrated siblings. */
.card--quiet {
  justify-content: center;
}
.card--quiet .card__copy {
  padding: 36px 32px;
}
.card--quiet .card__copy h3 { font-size: 22px; }
.card--quiet .card__copy p  { font-size: 15px; }

.card__copy {
  padding: 28px 28px 16px;
}

.card__copy h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.card__copy p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
  max-width: 44ch;
}

.card__shot {
  flex: 1;
  overflow: hidden;
  position: relative;
  margin: 0 20px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  background: var(--bg);
  min-height: 160px;
}

.card__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.card__shot--illus {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #0F0F11;
}
.card__shot--illus .illus {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Text cycling illustration --- */
.illus-text__name tspan { opacity: 0; }
.illus-text__name--1 { animation: illus-text-cycle 10s 0s   infinite; }
.illus-text__name--2 { animation: illus-text-cycle 10s 2s   infinite; }
.illus-text__name--3 { animation: illus-text-cycle 10s 4s   infinite; }
.illus-text__name--4 { animation: illus-text-cycle 10s 6s   infinite; }
.illus-text__name--5 { animation: illus-text-cycle 10s 8s   infinite; }
@keyframes illus-text-cycle {
  0%, 20% { opacity: 1; }
  22%, 100% { opacity: 0; }
}
.illus-text__caret {
  animation: illus-text-caret 10s linear infinite;
  opacity: 0;
}
@keyframes illus-text-caret {
  0%, 100% { transform: translateX(40px); opacity: 1; }
  /* Every 2s the caret snaps to the end of a name */
  18%  { transform: translateX(220px); opacity: 1; }
  20%  { transform: translateX(40px);  opacity: 0; }
  38%  { transform: translateX(170px); opacity: 1; }
  40%  { transform: translateX(40px);  opacity: 0; }
  58%  { transform: translateX(190px); opacity: 1; }
  60%  { transform: translateX(40px);  opacity: 0; }
  78%  { transform: translateX(180px); opacity: 1; }
  80%  { transform: translateX(40px);  opacity: 0; }
  98%  { transform: translateX(240px); opacity: 1; }
}

/* --- Form filling illustration --- */
/* Stagger indices for form rows. Previously inline `style="--i: N"`
   on the SVG <g class="illus-form__row"> elements; moved to CSS to
   keep CSP `style-src 'self'` clean. Children inherit --i. */
.illus-form__rows .illus-form__row:nth-child(1) { --i: 0; }
.illus-form__rows .illus-form__row:nth-child(2) { --i: 1; }
.illus-form__rows .illus-form__row:nth-child(3) { --i: 2; }
.illus-form__rows .illus-form__row:nth-child(4) { --i: 3; }

.illus-form__fill {
  animation: illus-form-fill 6s var(--ease-out) infinite;
  animation-delay: calc(var(--i) * 0.6s);
}
@keyframes illus-form-fill {
  0%, 5%  { width: 0; }
  18%     { width: 260px; }
  85%     { width: 260px; opacity: 1; }
  95%     { width: 260px; opacity: 0; }
  100%    { width: 0; opacity: 0; }
}
.illus-form__check {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: illus-form-check 6s var(--ease-bounce) infinite;
  animation-delay: calc(var(--i) * 0.6s + 0.3s);
}
@keyframes illus-form-check {
  0%, 18%   { opacity: 0; transform: scale(0.3); }
  23%       { opacity: 1; transform: scale(1.15); }
  28%, 85%  { opacity: 1; transform: scale(1); }
  95%       { opacity: 0; transform: scale(1); }
  100%      { opacity: 0; }
}

/* --- No-auth pipeline illustration ---
   3 circles on a track (Open → Edit → Download). A cherry "progress"
   line sweeps from step 1 to step 3. At the end, the padlock on step 3
   shackle briefly opens, signaling "sign-in gate". Loops every 4.4s. */
.illus-noauth__progress {
  animation: illus-noauth-progress 4.4s var(--ease-out) infinite;
}
@keyframes illus-noauth-progress {
  0%   { x2: 70; opacity: 0; }
  8%   { x2: 70; opacity: 1; }
  40%  { x2: 200; }
  70%  { x2: 330; opacity: 1; }
  85%  { x2: 330; opacity: 1; }
  100% { x2: 330; opacity: 0; }
}

/* Stroke + drop-shadow pulse cycles through all three step circles so
   the cherry highlight visibly moves Open → Edit → Download, rather
   than sitting statically on Download. Each step owns the circle
   stroke via CSS (no hardcoded `stroke` on the <circle> in SVG). */
.illus-noauth__ring {
  stroke: #27272A;
  stroke-width: 1.5;
  animation: illus-noauth-step 4.4s var(--ease-soft) infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.illus-noauth__step--1 .illus-noauth__ring { animation-delay: 0.2s; }
.illus-noauth__step--2 .illus-noauth__ring { animation-delay: 1.5s; }
.illus-noauth__step--3 .illus-noauth__ring { animation-delay: 2.8s; }
@keyframes illus-noauth-step {
  0%, 18%, 100% {
    stroke: #27272A;
    stroke-width: 1.5;
    filter: none;
  }
  22%, 38% {
    stroke: #B91C1C;
    stroke-width: 1.8;
    filter: drop-shadow(0 0 8px rgba(185,28,28,0.75));
  }
}

.illus-noauth__shackle {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: illus-noauth-unlock 4.4s var(--ease-out) infinite;
}
@keyframes illus-noauth-unlock {
  0%, 70%  { transform: rotate(0deg) translateY(0); }
  78%      { transform: rotate(-25deg) translateY(-2px); }
  90%      { transform: rotate(-25deg) translateY(-2px); }
  100%     { transform: rotate(0deg) translateY(0); }
}

/* Illus reduced-motion freeze */
@media (prefers-reduced-motion: reduce) {
  .illus-text__name tspan,
  .illus-text__caret,
  .illus-form__fill,
  .illus-form__check,
  .illus-noauth__progress,
  .illus-noauth__ring,
  .illus-noauth__shackle { animation: none; }
  .illus-text__name--1 { opacity: 1; }
  .illus-form__fill  { width: 260px; }
  .illus-form__check { opacity: 1; }
  .illus-noauth__progress { stroke-dasharray: none; }
}

@media (max-width: 840px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .card__shot { min-height: 200px; }
}

/* ======================================================== PRICING */

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.plan {
  position: relative;
  padding: 36px 32px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--bg-section);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.plan--featured {
  border-color: var(--accent);
  /* Initial state mirrors the original static box-shadow. The breathing
     animation drives the glow strength via box-shadow steps below. */
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 60px -20px var(--accent-glow);
  animation: plan-breathe 9s ease-in-out infinite;
}

@keyframes plan-breathe {
  0%, 100% {
    box-shadow:
      0 0 0 1px var(--accent),
      0 0 60px -20px rgba(185, 28, 28, 0.40);
  }
  50% {
    box-shadow:
      0 0 0 1px var(--accent),
      0 0 80px -16px rgba(185, 28, 28, 0.58);
  }
}

@media (prefers-reduced-motion: reduce) {
  .plan--featured { animation: none; }
}

.plan__badge {
  position: absolute;
  top: -10px;
  right: 24px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--text);
  border-radius: 999px;
}

.plan__head h3 {
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 500;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan__num {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  font-feature-settings: 'tnum';
}

.plan__unit {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-dim);
}

.plan__billing {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 6px;
}

.plan__billing .mono { color: var(--text-dim); }

.plan__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.plan__list li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.plan__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 12px;
  height: 6px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

@media (max-width: 720px) {
  .pricing__grid { grid-template-columns: 1fr; }
}

.pricing__note {
  max-width: 720px;
  margin: 40px auto 0;
  padding: 20px 24px;
  border-left: 2px solid var(--accent);
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.65;
  background: var(--bg-section);
  border-radius: 0 var(--r-md, 8px) var(--r-md, 8px) 0;
}

/* =========================================================== FAQ */

.faq__list {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq__list details {
  border-bottom: 1px solid var(--border-soft);
  padding: 4px 0;
}

.faq__list details:first-child { border-top: 1px solid var(--border-soft); }

.faq__list summary {
  cursor: pointer;
  padding: 20px 40px 20px 0;
  font-size: 16px;
  font-weight: 500;
  position: relative;
  list-style: none;
  transition: color 0.15s var(--ease-soft);
}

.faq__list summary::-webkit-details-marker { display: none; }

.faq__list summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-mute);
  transition: transform 0.2s var(--ease-soft), color 0.15s var(--ease-soft);
}

.faq__list details[open] summary { color: var(--accent); }
.faq__list details[open] summary::after {
  content: "−";
  color: var(--accent);
}

.faq__list details p {
  padding: 0 40px 24px 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
  max-width: 70ch;
}

/* ========================================================== FOOTER */

.footer {
  border-top: 1px solid var(--border-soft);
  padding: 48px 0;
  background: var(--bg);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.footer__brand img { border-radius: 6px; }

.footer__links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-dim);
}

.footer__links a:hover { color: var(--text); }

.footer__meta {
  font-size: 13px;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

/* ========================================================== SELECT */

::selection {
  background: var(--accent);
  color: var(--text);
}

/* ====================================================== COMPARISON */

.comparison {
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
}

.comparison__lead {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: 40px;
  line-height: 1.6;
}

.comparison__table-wrap {
  max-width: 820px;
  margin: 0 auto;
  /* Reserve a min-height to prevent CLS while fonts load. */
  min-height: 320px;
}

.comparison__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison__table th,
.comparison__table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
}

.comparison__table thead th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  text-align: center;
}

.comparison__table thead th:first-child {
  text-align: left;
}

.comparison__table tbody th {
  color: var(--text);
  font-weight: 500;
  width: 38%;
}

.comparison__table tbody td {
  color: var(--text-dim);
  text-align: center;
}

.comparison__table .comparison__own {
  background: rgba(185, 28, 28, 0.04);
  color: var(--text);
}

.comparison__table thead th.comparison__own {
  color: var(--text);
  font-weight: 600;
}

.comparison__yes {
  color: var(--ok, #16A34A);
  font-weight: 500;
}

.comparison__no {
  color: var(--text-mute);
}

.comparison__footnote {
  max-width: 720px;
  margin: 28px auto 0;
  padding: 0 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-mute);
  line-height: 1.6;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 840px) {
  .comparison__table,
  .comparison__table thead,
  .comparison__table tbody,
  .comparison__table tr,
  .comparison__table th,
  .comparison__table td {
    display: block;
  }

  .comparison__table thead {
    /* Header row is decorative on mobile — row labels do the same job */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .comparison__table tbody tr {
    display: block;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    background: var(--bg-section);
    padding: 14px 16px;
    margin-bottom: 12px;
  }

  .comparison__table tbody th {
    width: auto;
    padding: 0 0 8px;
    border: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mute);
  }

  .comparison__table tbody td {
    padding: 6px 0;
    border: 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
  }

  .comparison__table tbody td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-mute);
  }

  .comparison__table tbody td.comparison__own {
    background: transparent;
    font-weight: 500;
  }

  .comparison__table tbody td.comparison__own::before {
    color: var(--accent);
  }
}

/* ============================================== SCROLL PROGRESS */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 60;        /* above nav (z-50) */
  pointer-events: none;
  /* No transition — driven directly by motion.scroll() each frame. */
}

@media (prefers-reduced-motion: reduce) {
  #scroll-progress { display: none; }
}

/* =================================================== SCROLL REVEAL */
/* Baseline reveal: fade + slide up. IntersectionObserver adds .in-view. */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Bento-card specific reveal: clip-path horizontal wipe ----
   Chromium skips IntersectionObserver firings for elements whose clip-path
   collapses the visible area to zero (cards never enter view → never get
   the `.in-view` class). So: keep the default `.reveal` opacity-based hide
   (IO observes it normally), and play the wipe as a one-shot keyframe
   when `.in-view` lands. The opacity+transform transition from the base
   `.reveal` rule runs alongside the wipe. */
.bento .card.reveal {
  /* no overrides — inherits opacity: 0; transform: translateY(22px) */
}
.bento .card.reveal.in-view {
  animation: bento-wipe 0.95s var(--ease-out) forwards;
}
@keyframes bento-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .bento .card.reveal.in-view {
    animation: none;
  }
}

/* Stagger children inside a .reveal-stagger container. */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms;   }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 90ms;  }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 270ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 340ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms; }

/* Reduced-motion: skip the reveal, render visible immediately. */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Word-by-word reveal on section H2s ----
   Real text-node spaces sit between each `.word` span (added by script.js),
   so copy-paste preserves the spacing. No `margin-right` here — it would
   compound with the real space. */
.section__h2 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s var(--ease-soft) calc(var(--word-i, 0) * 0.055s),
    transform 0.6s var(--ease-out) calc(var(--word-i, 0) * 0.055s);
  will-change: opacity, transform;
}
.section__h2.in-view .word {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section__h2 .word {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__image  { animation: none; transform: none; }
  .hero__h1 .word { animation: none; opacity: 1; transform: none; }
  .hero__h1 .char { opacity: 1 !important; transform: none !important; }
}
