/* ──────────────────────────────────────────────────────────────────────────
   Necory — necory.com
   Committed dark system built from the app's own tokens (Necory night
   #09090B, Necory Black #18181B, zinc hairlines, the dark-mode item-type
   accents). Signature motif: faint horizontal ledger rules under radial
   light. RTL-safe: logical properties only; Arabic letter-spacing is 0.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --bg: #09090B;
  --surface: #111113;
  --surface-2: #18181B;
  --border: #27272A;
  --border-strong: #3F3F46;

  --text: #FAFAFA;
  --text-2: #B4B4BB;
  --text-3: #71717A;

  /* App dark-mode item-type accents — used only where they carry meaning. */
  --acc-link: #FBBF24;
  --acc-pdf: #60A5FA;
  --acc-image: #F472B6;
  --acc-audio: #34D399;
  --acc-location: #F87171;
  --positive: #34D399;
  --negative: #F87171;

  /* Chat bubbles mirror the real app's dark theme: user = primaryContainerDark,
     AI = darkSurfaceVariant. Both dark, distinguished by shade + alignment +
     the AI brand-disc avatar (see app lib/.../message_bubble.dart). */
  --bubble-user: #27272A;
  --bubble-user-text: #FAFAFA;
  --bubble-ai: #1F1F23;
  --bubble-ai-text: #FAFAFA;

  --font-sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 9px;
  --container: 1120px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* z scale */
  --z-header: 40;
  --z-skip: 60;
}

/* ── Base ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
/* Raster media never forces horizontal overflow on small screens.
   (Inline SVG icons are explicitly sized and intentionally excluded.) */
img, video { max-width: 100%; }

html[lang="ar"] body { font-family: 'Noto Sans Arabic', var(--font-sans); }
html[dir="rtl"] * { letter-spacing: 0 !important; }

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p a, li a, td a { color: var(--text); }
img { max-width: 100%; height: auto; }
ul, ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
li { margin-block-end: 0.4em; }
strong { color: var(--text); font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--border); margin-block: 2.5rem; }

::selection { background: #FAFAFA; color: #09090B; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

.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;
}

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -56px;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: var(--z-skip);
  transition: top 0.15s var(--ease-out);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: transparent;
  border-block-end: 1px solid transparent;
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.site-header.scrolled {
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-block-end-color: var(--border);
}
.header-row {
  display: flex; align-items: center; gap: 18px;
  min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; text-decoration: none;
  color: var(--text); letter-spacing: -0.02em;
}
.brand img { display: block; border-radius: 7px; }

.site-nav { display: flex; gap: 2px; margin-inline-start: auto; }
/* :not(.btn) so the drawer's "Get Necory" CTA keeps its button styling —
   a bare `.site-nav a` rule outranks `.btn-primary` and would mute it to a
   grey, disabled-looking pill. */
.site-nav a:not(.btn) {
  text-decoration: none; color: var(--text-2);
  padding: 8px 13px; border-radius: 999px; font-size: 0.92rem; font-weight: 500;
  transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.site-nav a:not(.btn):hover { color: var(--text); background: rgba(250, 250, 250, 0.06); }
.site-nav a:not(.btn)[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  display: flex; gap: 2px; border: 1px solid var(--border-strong);
  background: rgba(250, 250, 250, 0.05);
  border-radius: 999px; padding: 3px;
}
.lang-switch a {
  text-decoration: none; color: var(--text-2); font-size: 0.8rem;
  font-weight: 600; padding: 5px 11px; border-radius: 999px; line-height: 1.4;
  transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.lang-switch a:hover { color: var(--text); background: rgba(250, 250, 250, 0.08); }
.lang-switch a[aria-current="true"] { color: var(--bg); background: var(--text); }

.nav-toggle {
  display: none; background: rgba(250, 250, 250, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: 12px; width: 44px; height: 44px; cursor: pointer;
  position: relative; color: var(--text);
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.nav-toggle:hover { background: rgba(250, 250, 250, 0.08); border-color: var(--text-3); }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ''; position: absolute; inset-inline-start: 11px;
  width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform 0.2s var(--ease-out), top 0.2s var(--ease-out);
}
.nav-toggle-bar { top: 20px; }
.nav-toggle-bar::before { top: -6px; inset-inline-start: 0; }
.nav-toggle-bar::after { top: 6px; inset-inline-start: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

/* Drawer-only block: the mobile CTA + full-size language picker. */
.nav-drawer-extras { display: none; }

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  /* Brand left, hamburger flush to the container edge. The header CTA is
     redundant with the drawer's full-width "Get Necory" button, so drop it
     on mobile: a clean two-element header (brand + menu) reads far more
     professional than a compact pill crammed against the toggle. */
  .header-actions { margin-inline-start: auto; gap: 0; }
  .header-actions .btn { display: none; }
  .site-nav {
    display: none;
    position: absolute; inset-inline: 0; top: 68px;
    flex-direction: column; gap: 2px;
    background: rgba(9, 9, 11, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-block-end: 1px solid var(--border);
    padding: 14px 24px 22px;
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
  }
  .site-nav.open { display: flex; }
  .site-nav > a:not(.btn) { padding: 13px 12px; font-size: 1.05rem; }
  /* The compact header language pills hand off to the drawer's full-size
     picker; the primary CTA stays visible in the header at every width. */
  .header-actions .lang-switch { display: none; }
  .nav-drawer-extras {
    display: flex; flex-direction: column; gap: 14px;
    border-block-start: 1px solid var(--border);
    margin-block-start: 12px; padding-block-start: 18px;
  }
  .nav-drawer-extras .btn { width: 100%; }
  .drawer-langs { display: flex; gap: 8px; }
  .drawer-langs a {
    flex: 1; text-align: center; text-decoration: none;
    padding: 12px 8px; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 600; font-size: 0.95rem;
  }
  .drawer-langs a[aria-current="true"] {
    background: var(--text); color: var(--bg); border-color: var(--text);
  }
}
/* ── Buttons & badges ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out),
              border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.btn-primary {
  background: var(--text); color: var(--bg);
  box-shadow: 0 0 0 0 rgba(250, 250, 250, 0);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px -8px rgba(250, 250, 250, 0.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text-3); background: rgba(250, 250, 250, 0.04); }
.btn-sm { padding: 9px 19px; font-size: 0.88rem; }

/* Interior page kicker — the one deliberate label style on the site. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; margin-block-end: 20px;
  background: rgba(250, 250, 250, 0.03);
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--acc-audio);
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section { padding-block: clamp(72px, 10vw, 128px); }
.section + .section { padding-block-start: 0; }
/* A bordered (alt) section keeps full padding on both sides of its border line,
   so its heading never hugs the divider. Applies going in and coming out. */
.section + .section-alt,
.section-alt + .section { padding-block-start: clamp(64px, 8vw, 104px); }
/* A page-head already provides bottom spacing, so the first section after it
   only needs a modest top gap (not a full section's worth). */
.page-head + .section { padding-block-start: clamp(24px, 3vw, 44px); }
.section-head { max-width: 660px; margin-block-end: clamp(36px, 5vw, 56px); }
.section-head p { color: var(--text-2); font-size: 1.1rem; }
.section-alt {
  background:
    linear-gradient(180deg, rgba(250,250,250,0.025), rgba(250,250,250,0) 45%),
    var(--surface);
  border-block: 1px solid var(--border);
}
.lede {
  color: var(--text-2);
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  line-height: 1.65; max-width: 34em;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative; overflow: clip;
  padding-block: clamp(64px, 9vw, 128px) clamp(72px, 9vw, 120px);
}
/* Ledger-rule motif: faint horizontal account lines under a radial light. */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(250, 250, 250, 0.045) 0 1px,
    transparent 1px 56px
  );
  -webkit-mask-image: radial-gradient(70% 68% at 50% 22%, #000 0%, transparent 78%);
  mask-image: radial-gradient(70% 68% at 50% 22%, #000 0%, transparent 78%);
}
.hero::after {
  content: ''; position: absolute; inset: -20% -10% auto;
  height: 70%; pointer-events: none;
  background: radial-gradient(46% 60% at 72% 30%, rgba(250, 250, 250, 0.07), transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 780px; margin-inline: auto; text-align: center;
}
.hero-inner .lede { margin-inline: auto; }
.hero-inner .store-badges,
.hero-inner .hero-note { justify-content: center; }

.hero h1 { margin-block-end: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 32px; }
.hero-note {
  margin-block-start: 22px; font-size: 0.88rem; color: var(--text-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.hero-note::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--positive); flex: none;
}

/* Orchestrated entrance (only when JS confirms; static otherwise). */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero [data-enter] {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  }
  html.js .hero.entered [data-enter] { opacity: 1; transform: none; }
  html.js .hero.entered [data-enter="2"] { transition-delay: 0.1s; }
  html.js .hero.entered [data-enter="3"] { transition-delay: 0.2s; }
  html.js .hero.entered [data-enter="4"] { transition-delay: 0.32s; }
  html.js .hero.entered [data-enter="5"] { transition-delay: 0.5s; }
}

/* ── Product-UI card (the signature) ────────────────────────────────────── */

.hero-stage { position: relative; max-width: 420px; margin-inline: auto; width: 100%; }

/* ── Product-UI card (no device mockup) ───────────────────────────────────────
   The chat / vault / balance shots sit in a plain floating app card: hairline
   border, layered soft shadow, a faint top sheen — sized to their content, not
   a phone silhouette. Professional and honest. Every .phone on the site (hero +
   previews) shares it with zero per-locale markup; RTL needs no special case. */
.phone {
  position: relative;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 6px -2px rgba(0, 0, 0, 0.5),
    0 40px 84px -44px rgba(0, 0, 0, 0.88),
    0 20px 44px -30px rgba(0, 0, 0, 0.55);
}
/* Faint top sheen so the card reads as a raised surface, not a flat box. */
.phone::before {
  content: ''; position: absolute; inset-block-start: 0; inset-inline: 0;
  height: 72px; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent);
}

.phone-screen {
  position: relative;
  flex: 1;
  background: var(--bg);
  border-radius: inherit;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.phone-top {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 18px 13px;
  border-block-end: 1px solid var(--border);
  font-size: 0.86rem; font-weight: 600; color: var(--text);
}
.phone-top img { border-radius: 6px; }
.chat-stream {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 18px 16px 16px; flex: 1;
}
.msg {
  max-width: 86%; padding: 10px 14px; border-radius: 16px;
  font-size: 0.92rem; line-height: 1.5; margin: 0;
}
/* Tails match the app: user points bottom-end, AI points top-start. */
.msg-user {
  align-self: flex-end;
  background: var(--bubble-user); color: var(--bubble-user-text);
  border-end-end-radius: 5px;
}
.msg-ai {
  align-self: flex-start;
  background: var(--bubble-ai); color: var(--bubble-ai-text);
  border-start-start-radius: 5px;
}
.msg-meta { align-self: center; font-size: 0.76rem; color: var(--text-3); margin: 0; padding-block: 2px; }

/* AI reply line = brand-disc avatar + bubble, exactly like the app's first
   bubble in a burst (light disc + dark mark in dark mode). */
.ai-line { display: flex; align-items: flex-start; gap: 8px; align-self: flex-start; max-width: 92%; }
.ai-line .msg-ai { align-self: auto; }
.ai-avatar {
  width: 27px; height: 27px; flex: none; border-radius: 50%;
  background: #FAFAFA; margin-block-start: 2px;
  display: flex; align-items: center; justify-content: center;
}
.ai-avatar img { width: 56%; height: 56%; display: block; }

/* Composer bar — completes the product shot. Decorative, never interactive. */
.phone-input {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 8px;
  border-block-start: 1px solid var(--border);
}
.phone-field {
  flex: 1; border: 1px solid var(--border-strong);
  background: var(--surface); border-radius: 999px;
  padding: 10px 16px; font-size: 0.85rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden;
}
.phone-send {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.phone-send svg { width: 16px; height: 16px; }


/* ── Scroll reveal (safe: hidden only after JS arms it) ─────────────────── */

@media (prefers-reduced-motion: no-preference) {
  html.js.reveal-armed [data-reveal] {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  }
  html.js.reveal-armed [data-reveal].in-view { opacity: 1; transform: none; }
}

/* ── Bento feature grid ─────────────────────────────────────────────────── */

.bento {
  display: grid; gap: 20px;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
@media (max-width: 700px) {
  .bento { grid-template-columns: 1fr; }
}

.tile {
  position: relative;
  background: linear-gradient(180deg, rgba(250,250,250,0.028), rgba(250,250,250,0) 38%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px 30px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.tile:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tile h3 { margin: 0; font-size: 1.06rem; }
.tile > p { margin: 0; color: var(--text-2); font-size: 0.94rem; }
.tile-visual { margin-block-start: auto; padding-block-start: 18px; }

.tile-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.76rem; font-weight: 600; color: var(--text-3);
  margin-block-end: 10px;
}
.tile-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 2px;
  background: var(--tag-color, var(--text-3));
}
.tag-note { --tag-color: var(--text); }
.tag-link { --tag-color: var(--acc-link); }
.tag-image { --tag-color: var(--acc-image); }
.tag-pdf { --tag-color: var(--acc-pdf); }
.tag-audio { --tag-color: var(--acc-audio); }
.tag-location { --tag-color: var(--acc-location); }

/* Ledger visual inside the wide tile. */
.ledger-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 6px;
  font-variant-numeric: tabular-nums;
}
.ledger-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding-block: 10px;
  border-block-end: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-2);
}
.ledger-row:last-child { border-block-end: 0; }
.ledger-row .amt { font-family: var(--font-mono); font-size: 0.86rem; }
/* Amounts always read left-to-right, even on the RTL Arabic page. */
.amt { direction: ltr; unicode-bidi: isolate; }
.amt-pos { color: var(--positive); }
.amt-neg { color: var(--negative); }
.ledger-total { font-weight: 600; color: var(--text); }
.ledger-total .amt { color: var(--positive); }
.ledger-verified {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.74rem; color: var(--text-3); padding-block: 10px;
}
.ledger-verified::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--positive);
}

/* Mini reminder pill visual. */
.notif {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px;
}
.notif-icon {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.notif-icon img { border-radius: 6px; }
.notif-body { font-size: 0.84rem; line-height: 1.45; color: var(--text-2); }
.notif-body strong { display: block; font-size: 0.86rem; }

/* Language pills — always in the page's own language, never mixed. */
.lang-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-pills span {
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 8px 15px; font-size: 0.86rem; font-weight: 550;
  color: var(--text-2); background: rgba(250, 250, 250, 0.03);
}

/* ── Memory layers ──────────────────────────────────────────────────────── */

/* Split section: on desktop the heading rides sticky beside the content,
   so the body fills the other column instead of leaving half the row dead. */
.split { display: grid; gap: 36px; }
@media (min-width: 900px) {
  .split {
    grid-template-columns: 0.82fr 1.18fr;
    gap: clamp(48px, 6vw, 88px);
    align-items: start;
  }
  .split .section-head { position: sticky; top: 108px; margin-block-end: 0; }
  .split .steps { max-width: none; }
}

.layers { display: grid; gap: 12px; }
.layer {
  background: linear-gradient(180deg, rgba(250,250,250,0.02), rgba(250,250,250,0)), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  transition: border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.layer:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.layer:nth-child(2) { margin-inline-start: clamp(0px, 2vw, 26px); }
.layer:nth-child(3) { margin-inline-start: clamp(0px, 4vw, 52px); }
.layer:nth-child(4) { margin-inline-start: clamp(0px, 6vw, 78px); }
@media (max-width: 680px) { .layer { margin-inline-start: 0 !important; } }
.layer .tile-tag { margin-block-end: 10px; }
.layer h3 { margin: 0 0 5px; font-size: 1.08rem; }
.layer p { margin: 0; color: var(--text-2); font-size: 0.95rem; }

/* ── Steps (How it works — a real sequence) ─────────────────────────────── */

.steps { display: grid; gap: 0; max-width: 760px; }
.step {
  display: grid; grid-template-columns: 64px 1fr; gap: 22px;
  padding-block: 30px;
}
.step + .step { border-block-start: 1px solid var(--border); }
@media (max-width: 560px) { .step { grid-template-columns: 44px 1fr; gap: 16px; } }
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600;
  color: var(--text);
}
.step h3 { margin-block-end: 6px; }
.step p { color: var(--text-2); margin: 0; }

/* ── Trust rows ─────────────────────────────────────────────────────────── */

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 800px) { .trust { grid-template-columns: 1fr; } }
.trust > div {
  border-block-start: 1px solid var(--border-strong);
  padding-block: 22px 8px;
  padding-inline-end: 28px;
}
.trust h3 { font-size: 1.02rem; margin-block-end: 6px; }
.trust p { color: var(--text-2); font-size: 0.94rem; margin: 0; }

/* ── Cards (legacy grid support on interior pages) ──────────────────────── */

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card {
  background: linear-gradient(180deg, rgba(250,250,250,0.025), rgba(250,250,250,0) 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.card h3 { margin-block-start: 14px; }
.card p { color: var(--text-2); font-size: 0.95rem; margin: 0; }
.card-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, currentColor 13%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.card-icon svg { width: 20px; height: 20px; }
.tone-ink { color: var(--text); }
.tone-link { color: var(--acc-link); }
.tone-pdf { color: var(--acc-pdf); }
.tone-image { color: var(--acc-image); }
.tone-audio { color: var(--acc-audio); }
.tone-location { color: var(--acc-location); }
.card .card-body { color: var(--text); }

/* ── Feature rows (features page) ───────────────────────────────────────── */

.feature-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px); align-items: start;
  padding-block: clamp(44px, 6vw, 72px);
}
.feature-row + .feature-row { border-block-start: 1px solid var(--border); }
@media (max-width: 800px) { .feature-row { grid-template-columns: 1fr; } }
.feature-row h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.feature-row .side p { color: var(--text-2); }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li {
  padding: 14px 0; border-block-start: 1px solid var(--border);
  color: var(--text-2); font-size: 0.96rem; margin: 0;
}
.feature-list li strong { color: var(--text); display: block; margin-block-end: 2px; }

/* ── Pricing ────────────────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 820px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.plan {
  background: linear-gradient(180deg, rgba(250,250,250,0.025), rgba(250,250,250,0) 35%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px; padding: 32px 30px;
  display: flex; flex-direction: column;
}
.plan-featured {
  border-color: var(--border-strong);
  box-shadow: 0 0 60px -18px rgba(250, 250, 250, 0.14);
}
.plan h3 { font-size: 1.05rem; margin: 0; }
.plan-price {
  font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em;
  margin-block: 12px 2px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.plan-price small { font-size: 0.95rem; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.plan-alt { font-size: 0.87rem; color: var(--text-3); margin-block-end: 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 8px; }
.plan li {
  padding: 11px 0; border-block-start: 1px solid var(--border);
  font-size: 0.94rem; color: var(--text-2); margin: 0;
  display: flex; gap: 11px; align-items: baseline;
}
.plan li::before { content: '·'; color: var(--text-3); font-weight: 700; flex: none; }
.plan-tag {
  align-self: flex-start; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 5px 12px; margin-block-end: 16px;
}
html[dir="rtl"] .plan-tag { text-transform: none; }

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.faq-list { max-width: 780px; }
.faq-list details {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-block-end: 14px;
  transition: border-color 0.2s var(--ease-out);
}
.faq-list details:hover, .faq-list details[open] { border-color: var(--border-strong); }
.faq-list summary {
  cursor: pointer; padding: 22px 28px; font-weight: 600; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+'; color: var(--text-3); font-weight: 400; font-size: 1.2rem; line-height: 1; flex: none;
}
.faq-list details[open] summary::after { content: '−'; }
.faq-list .faq-body { padding: 0 28px 22px; color: var(--text-2); }
.faq-list .faq-body p:last-child { margin: 0; }

/* ── CTA band ───────────────────────────────────────────────────────────── */

.cta-band {
  position: relative; overflow: clip;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 64px);
  text-align: center;
}
.cta-band::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(52% 90% at 50% 0%, rgba(250, 250, 250, 0.09), transparent 70%);
}
.cta-band > * { position: relative; }
.cta-band h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.cta-band p { color: var(--text-2); max-width: 480px; margin-inline: auto; }
.cta-band .btn-primary { margin-block-start: 14px; }

/* ── Prose (legal & long-form) ──────────────────────────────────────────── */

.prose { max-width: 740px; }
.prose h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.prose h2 {
  font-size: 1.4rem; margin-block-start: 2.4em;
  padding-block-start: 1.2em; border-block-start: 1px solid var(--border);
}
/* The first heading has nothing above it — no divider line, no big top gap. */
.prose > h2:first-child {
  margin-block-start: 0; padding-block-start: 0; border-block-start: 0;
}
.prose h3 { font-size: 1.1rem; margin-block-start: 1.7em; }
.prose p, .prose li { color: var(--text-2); }
.prose li { margin-block-end: 0.55em; }
.prose .doc-meta {
  font-size: 0.88rem; color: var(--text-3); margin-block-end: 2.4em;
  font-family: var(--font-mono);
}
.prose table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
  margin-block: 1.2em 1.8em; display: block; overflow-x: auto;
  border-radius: var(--radius-sm);
}
.prose th, .prose td {
  text-align: start; padding: 11px 15px;
  border: 1px solid var(--border); vertical-align: top;
  color: var(--text-2); min-width: 130px;
}
.prose th { color: var(--text); font-weight: 600; background: var(--surface); }
.prose td { background: rgba(250, 250, 250, 0.012); }
.callout {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface);
  padding: 22px 28px; margin-block: 1.6em;
}
.callout p { margin: 0; }

/* ── Page head (interior pages) ─────────────────────────────────────────── */

.page-head {
  position: relative; overflow: clip;
  padding-block: clamp(64px, 8vw, 104px) clamp(24px, 3vw, 40px);
}
.page-head::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(250, 250, 250, 0.04) 0 1px, transparent 1px 56px);
  -webkit-mask-image: radial-gradient(60% 90% at 30% 0%, #000, transparent 75%);
  mask-image: radial-gradient(60% 90% at 30% 0%, #000, transparent 75%);
}
.page-head .container { position: relative; }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.page-head p { color: var(--text-2); font-size: 1.12rem; max-width: 640px; }

/* ── Language showcase ──────────────────────────────────────────────────── */

.lang-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 800px) { .lang-cards { grid-template-columns: 1fr; } }
.lang-card {
  background: linear-gradient(180deg, rgba(250,250,250,0.02), rgba(250,250,250,0)), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.lang-card .msg { margin-block-start: 14px; max-width: 100%; display: inline-block; }
.lang-card h3 { font-size: 0.9rem; color: var(--text-3); font-weight: 600; margin: 0; }

/* ── Utility spacing (replaces inline styles) ───────────────────────────── */

.mt-xl { margin-block-start: 40px; }
.mt-lg { margin-block-start: 28px; }
.mt-md { margin-block-start: 24px; }
.text-xl { font-size: 1.3rem; }
.mx-auto { margin-inline: auto; }

/* Centered section intro variant. */
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center p { margin-inline: auto; }

/* ── Store badges (App Store / Google Play) ─────────────────────────────── */

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badges.center { justify-content: center; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 18px; border-radius: 14px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); text-decoration: none;
  transition: transform 0.16s var(--ease-out), border-color 0.16s var(--ease-out),
              background 0.16s var(--ease-out);
}
.store-btn:hover { transform: translateY(-2px); border-color: var(--text-3); background: #1f1f24; }
.store-btn:active { transform: translateY(0); }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-lines { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.14; }
html[dir="rtl"] .store-lines { align-items: flex-end; }
.store-top {
  font-size: 0.64rem; font-weight: 500; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.04em;
}
html[dir="rtl"] .store-top { text-transform: none; letter-spacing: 0; }
.store-name { font-size: 1.06rem; font-weight: 600; letter-spacing: -0.01em; }
html[dir="rtl"] .store-name { letter-spacing: 0; }

.hero-store { margin-block-start: 28px; }
.hero-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  margin-block-start: 18px; color: var(--text-2);
  text-decoration: none; font-weight: 550; font-size: 0.96rem;
  transition: color 0.15s var(--ease-out), gap 0.15s var(--ease-out);
}
.hero-secondary:hover { color: var(--text); gap: 9px; }
.hero-secondary svg { width: 16px; height: 16px; }
html[dir="rtl"] .hero-secondary svg { transform: scaleX(-1); }

/* ── App preview (faithful in-app UI, presented in the clean panel) ─────── */

.preview-row {
  display: flex; justify-content: center; align-items: stretch;
  gap: clamp(16px, 3vw, 28px);
}
.preview-row .phone { max-width: 340px; flex: 1 1 0; }
@media (max-width: 860px) {
  .preview-row { flex-wrap: wrap; }
  .preview-row .phone { flex: 1 1 280px; max-width: 360px; }
  .preview-row .phone-side-2 { display: none; }
}
@media (max-width: 560px) {
  .preview-row .phone-side-1 { display: none; }
  .preview-row .phone { max-width: 360px; margin-inline: auto; }
}

/* Vault list screen — each item is its own bordered card, and the leading
   icon uses the app's exact per-type tint background + accent colour
   (lib/.../vault_item_card.dart _bgColor / _iconColor, dark mode). */
.vault-list { display: flex; flex-direction: column; padding: 12px; gap: 8px; flex: 1; }
.vault-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.vi-icon {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.vi-icon svg { width: 19px; height: 19px; }
.vi-note { background: #27272A; color: #FAFAFA; }
.vi-link { background: #422006; color: #FBBF24; }
.vi-pdf { background: #1E3A5F; color: #60A5FA; }
.vi-image { background: #4A1025; color: #F472B6; }
.vi-audio { background: #064E3B; color: #34D399; }
.vi-location { background: #4A1010; color: #F87171; }
.vault-item .vi-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vault-item .vi-text strong { font-size: 0.88rem; color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-item .vi-text span { font-size: 0.75rem; color: var(--text-3); }

/* Balances screen */
.balance-list { display: flex; flex-direction: column; padding: 10px 14px 16px; flex: 1;
  font-variant-numeric: tabular-nums; }
.balance-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-block-end: 1px solid var(--border);
}
.balance-row:last-child { border-block-end: 0; }
.balance-who { display: flex; flex-direction: column; gap: 2px; }
.balance-who strong { font-size: 0.92rem; color: var(--text); font-weight: 550; }
.balance-who span { font-size: 0.74rem; color: var(--text-3); }
.balance-row .amt { font-family: var(--font-mono); font-size: 0.9rem; }

/* ── Testimonials / illustrative voices ─────────────────────────────────── */

.voices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .voices { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }
.voice {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(250,250,250,0.025), rgba(250,250,250,0) 40%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
}
.voice-quote { color: var(--text); font-size: 1rem; line-height: 1.6; margin: 0 0 20px; }
.voice-quote::before { content: '\201C'; color: var(--text-3); font-size: 1.4rem; margin-inline-end: 1px; }
.voice-by { margin-block-start: auto; display: flex; flex-direction: column; gap: 2px; }
.voice-by strong { font-size: 0.88rem; color: var(--text); font-weight: 600; }
.voice-by span { font-size: 0.8rem; color: var(--text-3); }
.section-note { font-size: 0.85rem; color: var(--text-3); margin-block-start: 14px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  position: relative; overflow: clip;
  border-block-start: 1px solid var(--border);
  padding-block: clamp(56px, 7vw, 92px) clamp(28px, 4vw, 44px);
  margin-block-start: clamp(72px, 10vw, 128px);
  background: var(--bg);
}
/* Ambient light rising from the top edge, echoing the CTA band. */
.site-footer::before {
  content: ''; position: absolute; inset-block-start: 0; inset-inline: 0;
  height: 320px; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgba(250, 250, 250, 0.05), transparent 62%);
}

.footer-top {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.5fr 1.3fr;
  gap: clamp(40px, 6vw, 88px);
  padding-block-end: clamp(40px, 5vw, 60px);
}
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; gap: 44px; } }

.footer-brand .brand { font-size: 1.2rem; }
.footer-tagline {
  color: var(--text-2); font-size: 1.02rem; line-height: 1.6;
  max-width: 32ch; margin-block: 16px 22px;
}
.footer-apps { display: flex; flex-wrap: wrap; gap: 10px; }
.app-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 15px; font-size: 0.83rem; color: var(--text-2);
  background: var(--surface);
}
.app-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--acc-link); flex: none;
}

.footer-nav {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px;
}
@media (max-width: 480px) { .footer-nav { grid-template-columns: 1fr 1fr; } }
.footer-nav nav { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.footer-nav h2 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--text-3); margin: 0 0 5px; font-weight: 650;
}
html[dir="rtl"] .footer-nav h2 { text-transform: none; letter-spacing: 0; }
.footer-nav a {
  color: var(--text-2); text-decoration: none; font-size: 0.94rem;
  transition: color 0.15s var(--ease-out);
}
.footer-nav a:hover { color: var(--text); }

.footer-bottom {
  position: relative; z-index: 1;
  border-block-start: 1px solid var(--border);
  padding-block: 24px;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 14px 20px;
  font-size: 0.85rem; color: var(--text-3);
}
.footer-bottom p { margin: 0; }
.footer-bottom > p:last-child a {
  color: var(--text-2); text-decoration: none;
  transition: color 0.15s var(--ease-out);
}
.footer-bottom > p:last-child a:hover { color: var(--text); }

/* ── 404 ────────────────────────────────────────────────────────────────── */

.error-page { text-align: center; padding-block: clamp(96px, 16vw, 180px); }
.error-code { font-family: var(--font-mono); color: var(--text-3); font-size: 0.95rem; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
