/* Torat Mayim — the page of a sefer: cream paper, navy ink, a gold rule. */
:root {
  --page: #F6F3EC;
  --paper: #FFFFFF;
  --ink: #1A1D26;
  --mute: #4A4E59;
  --line: #DDD6C6;
  --rule: #EFEAE0;
  --gold: #D9A441;
  --gold-deep: #A8761C;
  --gold-tint: #F3E3BF;
  --spring: #5DB0D9;
  --deep: #1F6A8F;
  --water-tint: #E4F1F8;
  --navy: #1A1D26;
  --cream: #F6F3EC;
  --torah: #2B4C9B;
  --navi: #A55A17;
  --mishna: #2C7352;
  --talmud: #8C2F39;
  --rashi: #1D6E73;
  --tosafot: #5A4785;
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rashi-font: "Noto Rashi Hebrew", "Frank Ruhl Libre", serif;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #121419;
    --paper: #1E2129;
    --ink: #ECE7DC;
    --mute: #A9ADB7;
    --line: #363A46;
    --rule: #2A2D36;
    --gold-tint: #3A3020;
    --deep: #6FB8DE;
    --water-tint: #1B2E3A;
    --gold-deep: #E2B65E;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 18px/1.6 var(--sans); }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
.he { font-family: var(--serif); direction: rtl; unicode-bidi: isolate; }
.rashi-script { font-family: var(--rashi-font); }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 22px/1 var(--serif); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand .he { color: var(--gold-deep); font-size: 20px; }
.top nav { display: flex; align-items: center; gap: 22px; font-size: 16px; }
.top nav a { text-decoration: none; color: var(--mute); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top nav .lang { font-weight: 700; letter-spacing: .06em; }
.pill { white-space: nowrap; background: var(--ink); color: var(--page) !important; padding: 8px 16px; border-radius: 999px; font-weight: 600; }
.pill:hover { background: var(--gold-deep); }
@media (max-width: 820px) { .top nav .wide { display: none; } }
@media (max-width: 420px) { .brand .he { display: none; } }

/* Hero: navy like the ark, a page of text fading behind. */
.hero { position: relative; overflow: hidden; background: var(--navy); color: var(--cream); padding: 72px 0 0; }
.hero-waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 110px; z-index: 0; }
.hero-grid { z-index: 1; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 75% 30%, rgba(217,164,65,.18), transparent 70%); }
.folio { position: absolute; inset: -10% -5% auto auto; width: 70%; height: 120%; direction: rtl; font: 400 22px/2 var(--serif); color: rgba(246,243,236,.07); overflow: hidden; text-align: justify; pointer-events: none; user-select: none; transform: translateY(var(--py, 0)); }
.folio b { color: rgba(217,164,65,.28); font-weight: 700; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: end; }
.hero-copy { padding-bottom: 88px; }
.kicker { font: 600 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); }
.hero h1 em { font-style: normal; color: var(--spring); }
.word-def { display: flex; align-items: baseline; gap: 14px; margin: 26px 0 0; font-size: 17px; color: rgba(246,243,236,.75); flex-wrap: wrap; }
.word-def .he { font-size: 30px; color: var(--cream); font-weight: 700; }
.hero-lede { margin-top: 22px; font-size: 20px; max-width: 34em; color: rgba(246,243,236,.86); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 14px; background: var(--gold); color: var(--navy); font-weight: 700; text-decoration: none; border: 0; }
.button:hover { background: #E8B85A; color: var(--navy); }
.button svg { width: 20px; height: 20px; }
.button .stack { display: flex; flex-direction: column; line-height: 1.1; }
.button .stack small { font-size: 11px; font-weight: 600; opacity: .8; }
.button.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(246,243,236,.35); }
.button.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: rgba(246,243,236,.08); color: rgba(246,243,236,.8); }
.hero-phone { align-self: end; justify-self: center; width: min(340px, 100%); margin-bottom: -60px; transform: translateY(var(--py, 0)); }

/* Phone frame */
.phone { margin: 0; position: relative; aspect-ratio: 1320 / 2868; border-radius: 13% / 6%; padding: 3.2%; background: #0B0D12; box-shadow: 0 0 0 1.5px #3A3F4C, 0 40px 80px -30px rgba(0,0,0,.6); }
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 11% / 5.1%; overflow: hidden; background: var(--cream); }
.phone .screen > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone .placeholder { display: grid; place-items: center; align-content: center; gap: 10px; background: var(--cream); color: var(--navy); text-align: center; padding: 20%; }
.phone .placeholder img { position: static; width: 46%; height: auto; border-radius: 22%; }
.phone .placeholder .he { font-size: 34px; font-weight: 700; }
.phone video.gone { display: none; }

/* Bands */
.band { position: relative; padding: 112px 0; }
.band-paper { background: var(--paper); border-block: 1px solid var(--rule); }
.section-head { max-width: 46em; margin-bottom: 56px; }
.section-head .kicker { color: var(--gold-deep); }
.section-head h2 { font-size: clamp(32px, 4.2vw, 52px); }
.lede { font-size: 20px; color: var(--mute); margin-top: 18px; }

/* The big number */
.stat { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; }
.stat-num { font: 800 clamp(96px, 16vw, 200px)/0.9 var(--serif); color: var(--deep); letter-spacing: -0.04em; }
.stat-num small { font-size: .4em; }
.stat h2 { font-size: clamp(28px, 3.4vw, 42px); }
.stat .lede { max-width: 34em; }
.bars { display: grid; gap: 14px; margin-top: 64px; }
.bar { display: grid; grid-template-columns: 120px 1fr 64px; gap: 16px; align-items: center; font-size: 16px; }
.bar .name { font-weight: 600; }
.bar .track { height: 12px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.bar .fill { height: 100%; width: calc(var(--v) * 1%); border-radius: inherit; background: var(--c); transform-origin: left; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.bar .pct { text-align: end; font-variant-numeric: tabular-nums; color: var(--mute); }
.bar .sub { grid-column: 2 / 4; margin-top: -8px; font-size: 14px; color: var(--mute); }
.reveal:not(.shown) .fill { transform: scaleX(0); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.band-paper .step { background: var(--page); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold-tint); color: var(--gold-deep); font: 700 18px/1 var(--serif); margin-bottom: 18px; }
.step h3 { font-size: 24px; margin-bottom: 8px; }
.step p { color: var(--mute); font-size: 17px; }
.step .he { display: block; font-size: 15px; color: var(--gold-deep); margin-bottom: 6px; direction: rtl; text-align: left; }

/* Modules */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.module { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; overflow: hidden; }
.module::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--c); }
.module header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--c); color: #fff; font: 700 28px/1 var(--serif); flex: none; }
.module h3 { font-size: 26px; }
.module h3 .he { display: block; font-size: 18px; color: var(--mute); font-weight: 500; text-align: left; }
.words { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.words li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed var(--rule); padding-bottom: 6px; }
.words .he { font-size: 24px; font-weight: 700; }
.words .en { font-size: 15px; color: var(--mute); text-align: end; }
.module .meta { font-size: 15px; color: var(--mute); }
.module .meta b { color: var(--ink); }

/* Stories */
.stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.story { background: var(--page); border: 1px solid var(--line); border-radius: 26px; padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.story.dark { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.story svg { width: 200px; height: 125px; }
.story .kicker { color: var(--deep); margin: 0; }
.story.dark .kicker { color: var(--gold); }
.story h3 { font-size: 28px; }
.story p { color: var(--mute); font-size: 18px; }
.story.dark p { color: rgba(246,243,236,.78); }
.story .quote { font-size: 23px; line-height: 1.55; color: var(--ink); text-align: left; }
.story.dark .quote { color: var(--cream); }
@media (max-width: 820px) { .stories { grid-template-columns: 1fr; } }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; list-style: none; padding: 0; margin: 0; }
.gallery p { margin-top: 18px; font-size: 16px; color: var(--mute); }
.gallery p b { display: block; color: var(--ink); font: 700 20px/1.3 var(--serif); margin-bottom: 4px; }
.band-paper .module { background: var(--page); }
@media (max-width: 980px) {
  .gallery { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: min(240px, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
  .gallery li { scroll-snap-align: start; }
}

/* Reel */
.band-night { background: var(--navy); color: var(--cream); overflow: hidden; }
.reel { display: grid; grid-template-columns: 1fr 360px; gap: 72px; align-items: center; }
.reel h2 { font-size: clamp(32px, 4.2vw, 52px); }
.reel h2 em { font-style: normal; color: var(--gold); }
.reel .lede { color: rgba(246,243,236,.78); }
.reel .kicker { color: var(--gold); }
.reel-list { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; color: rgba(246,243,236,.86); }
.reel-list li { display: flex; gap: 12px; }
.reel-list li::before { content: "✦"; color: var(--gold); }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.feature { padding: 28px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.band-paper .feature { background: var(--page); }
.feature .ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-tint); color: var(--gold-deep); margin-bottom: 18px; }
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 22px; margin-bottom: 8px; }
.feature p { color: var(--mute); font-size: 17px; }
.feature .demo { margin-top: 14px; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.feature .demo .he { font-size: 26px; font-weight: 700; }
.feature .demo .rashi-script { font-size: 26px; }
.feature .demo small { font-size: 13px; color: var(--mute); }

/* Sources */
.sources { width: 100%; border-collapse: collapse; font-size: 16px; }
.sources th, .sources td { text-align: start; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sources th { font: 600 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.sources td:first-child { font-weight: 600; white-space: nowrap; }
.sources td:last-child { color: var(--mute); }
.sources-note { margin-top: 22px; font-size: 16px; color: var(--mute); max-width: 52em; }
@media (max-width: 640px) {
  .sources thead { display: none; }
  .sources tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .sources td { display: block; border: 0; padding: 2px 0; white-space: normal !important; }
}

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font: 700 20px/1.3 var(--serif); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-deep); font-size: 26px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 20px; color: var(--mute); display: grid; gap: 10px; }
.faq-more { margin-top: 28px; color: var(--mute); }

/* Outro */
.outro { background: var(--navy); color: var(--cream); text-align: center; padding: 120px 0; overflow: hidden; }
.outro img.mark { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 28px; }
.outro .he { font-size: clamp(30px, 4vw, 44px); color: var(--gold); display: block; margin-bottom: 10px; }
.outro h2 { font-size: clamp(34px, 4.6vw, 58px); margin-bottom: 32px; }
.outro .cta { justify-content: center; }
.outro .chips { justify-content: center; }

/* Footer */
.foot { padding: 40px 0 56px; border-top: 1px solid var(--rule); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.foot nav { display: flex; gap: 22px; font-size: 16px; }
.foot nav a { text-decoration: none; color: var(--mute); }
.credit { font-size: 15px; color: var(--mute); width: 100%; }

/* Docs (privacy, support) */
.doc-hero { background: var(--navy); color: var(--cream); padding: 72px 0 64px; }
.doc-hero h1 { font-size: clamp(38px, 5vw, 60px); }
.doc-hero .he { display: block; font-size: 24px; color: var(--gold); margin-top: 10px; direction: rtl; text-align: left; }
.doc { padding: 56px 0 96px; }
.doc h2 { font-size: 28px; margin: 44px 0 12px; }
.doc p, .doc li { color: var(--mute); margin-bottom: 12px; }
.doc ul { padding-inline-start: 22px; }
.doc .meta { font-size: 15px; }
.summary { background: var(--gold-tint); border-radius: var(--radius); padding: 22px 24px; margin-top: 20px; }
.summary p { color: var(--ink); margin: 0; }
.doc .faq { margin-top: 18px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .reel { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 24px; }
  .hero-phone { width: min(300px, 80%); margin-bottom: -80px; }
  .reel-stage { width: min(320px, 85%); justify-self: center; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .modules, .features { grid-template-columns: repeat(2, 1fr); }
  .stat { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .band { padding: 80px 0; }
  .hero { padding-top: 48px; }
  .steps, .modules, .features { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 84px 1fr 52px; gap: 10px; }
  .folio { width: 120%; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar .fill { transition: none; }
  html { scroll-behavior: auto; }
}
