/* Limud Yomi: site styles. Tokens mirror the app's palette (mobile/src/theme). */
:root {
  --paper: #FBFAF7;
  --paper-2: #F3F0E9;
  --parch: #EFE8DA;
  --surface: #FFFFFF;
  --ink: #211C16;
  --ink-soft: #6E6456;
  --ink-faint: #9A9184;
  --line: rgba(33,28,22,.12);
  --line-2: rgba(33,28,22,.06);
  --techeiles: #24476F;
  --techeiles-bright: #2E5C93;
  --techeiles-tint: rgba(36,71,111,.10);
  --gold: #AC7F27;
  --gold-bright: #C79A3D;
  --gold-tint: rgba(172,127,39,.14);
  --oxblood: #6E2B34;
  --done: #3D7350;
  --c-talmud: #6E2B34;
  --c-halakhah: #24476F;
  --c-mishnah: #8A5A2B;
  --c-tehillim: #1F6F8B;
  --c-chassidus: #57478A;
  --bezel: #1b1814;
  --shadow: 0 30px 60px -20px rgba(33,28,22,.35), 0 12px 24px -12px rgba(33,28,22,.25);
  --sky-top: #F3E3C3;
  --sky-bot: #E2A66B;
  --heat-0: #E6E1D8; --heat-1: #D5DEE8; --heat-2: #7C94B0; --heat-3: #24476F; --heat-4: #AC7F27;
  --grain: .05;

  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: "Assistant", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171410; --paper-2: #211D17; --parch: #231E17; --surface: #1F1B16;
    --ink: #F1EBDF; --ink-soft: #B7AC9A; --ink-faint: #857B6C;
    --line: rgba(241,235,223,.14); --line-2: rgba(241,235,223,.07);
    --techeiles: #8FB3DD; --techeiles-bright: #A9C6E8; --techeiles-tint: rgba(143,179,221,.14);
    --gold: #D6AE5C; --gold-bright: #E6C176; --gold-tint: rgba(214,174,92,.16);
    --oxblood: #D4838D;
    --c-talmud: #C46A76; --c-halakhah: #6E9BD0; --c-mishnah: #C9905A; --c-tehillim: #58AFCB; --c-chassidus: #9C8BD6;
    --bezel: #050403;
    --shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 12px 24px -12px rgba(0,0,0,.6);
    --sky-top: #1d2a3f; --sky-bot: #7a4a33;
    --heat-0: #2A251E; --heat-1: #33404F; --heat-2: #4A6A90; --heat-3: #8FB3DD; --heat-4: #D6AE5C;
    --grain: .08;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
main { overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
[dir="rtl"] h2 { letter-spacing: 0; }

/* language switching */
html[data-l="he"] .en, html[data-l="en"] .he { display: none !important; }

/* ── Top bar ── */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--techeiles); }
.brand-mark { width: 30px; height: 30px; color: var(--techeiles); }
.bar-links { display: flex; gap: 22px; margin-inline-start: auto; }
.bar-links a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-soft); transition: color .2s; }
.bar-links a:hover { color: var(--techeiles); }
.lang {
  font: 600 14px var(--sans); color: var(--ink); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px; transition: background .2s, border-color .2s;
}
.lang:hover { background: var(--paper-2); border-color: var(--gold); }
@media (max-width: 720px) { .bar-links { display: none; } .lang { margin-inline-start: auto; } }

/* ── Hero: tzuras hadaf ── */
.daf {
  position: relative;
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0, 560px) minmax(0,1fr);
  gap: clamp(20px, 3vw, 44px);
  max-width: 1320px; margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) var(--gutter) clamp(40px, 6vw, 80px);
}
.perush {
  font-family: var(--serif); font-size: 15.5px; line-height: 1.75; color: var(--ink-soft);
  text-align: justify; hyphens: auto; margin-top: 150px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
html[data-l="en"] .perush { font-size: 15px; line-height: 1.7; }
.perush b { color: var(--ink); font-weight: 600; }
.perush-in b { color: var(--oxblood); }
.perush p { margin: 0; }
.perush .perush-h2 { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.perush { display: flex; flex-direction: column; row-gap: 16px; padding-bottom: 120px; }
.perush .perush-h { margin-bottom: -6px; }
.perush-h {
  font-family: var(--serif); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--gold); margin: 0 0 10px;
}
html[data-l="he"] .perush-h { letter-spacing: .04em; font-size: 16px; }
.perush p::first-letter { font-size: 1.6em; color: var(--ink); font-family: var(--serif); font-weight: 800; }

.gemara { text-align: center; display: flex; flex-direction: column; align-items: center; }
.petach {
  position: relative; display: inline-block;
  padding: 18px 34px 12px; margin-bottom: 26px;
  border: 1.5px solid var(--ink);
  background:
    radial-gradient(circle at 50% 50%, transparent 58%, var(--gold-tint) 59%, transparent 60%) 0 0/22px 22px,
    var(--paper);
}
.petach::before, .petach::after {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold); pointer-events: none;
}
.petach::after { inset: -8px; border-color: var(--line); }
.petach-word {
  font-family: var(--serif); font-weight: 900; font-size: clamp(56px, 9vw, 112px); line-height: 1;
  color: var(--ink); display: block;
}
.petach-word.en { font-size: clamp(44px, 6.4vw, 78px); letter-spacing: -.02em; white-space: nowrap; }
.lede { font-family: var(--serif); font-size: clamp(19px, 2vw, 23px); line-height: 1.55; color: var(--ink-soft); max-width: 30em; margin: 0 0 26px; text-wrap: balance; }
.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; margin-bottom: 48px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 700; font-size: 17px; padding: 14px 26px; border-radius: 100px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--techeiles); color: var(--paper); box-shadow: 0 10px 24px -10px var(--techeiles); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px var(--techeiles); }
.btn:active { transform: scale(.97); }
.free { font-size: 15px; font-weight: 600; color: var(--gold); }

@media (max-width: 1000px) {
  .perush { padding-bottom: 0; }
  .daf { grid-template-columns: 1fr 1fr; }
  .gemara { grid-column: 1 / -1; grid-row: 1; }
  .perush { margin-top: 0; padding-top: 0; border-top: 0; border-inline-start: 2px solid var(--gold-tint); padding-inline-start: 16px; }
}
@media (max-width: 640px) { .daf { grid-template-columns: 1fr; } }

/* ── Phone frame ── */
.phone {
  --w: 300px;
  width: var(--w); aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * .15); padding: calc(var(--w) * .03);
  background: linear-gradient(145deg, #3a342c, var(--bezel) 40%);
  box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(255,255,255,.08);
  position: relative;
}
.phone > img, .phone > .screen {
  width: 100%; height: 100%; border-radius: calc(var(--w) * .12); object-fit: cover; object-position: top;
  background: #FBFAF7;
}
.phone.crop { aspect-ratio: 1206 / 1700; }
.phone.crop > img { object-fit: cover; }

/* the drawn Today screen (always the app's light theme, like a screenshot) */
.screen.today {
  --s: calc(var(--w) / 402); /* one device point */
  position: relative; overflow: hidden; text-align: start; color: #211C16;
  padding: calc(52 * var(--s)) calc(20 * var(--s)) 0; font-size: calc(14 * var(--s));
}
.island { position: absolute; top: calc(11 * var(--s)); inset-inline: 0; margin: auto; width: calc(124 * var(--s)); height: calc(36 * var(--s)); border-radius: 40px; background: #000; }
.t-status { position: absolute; top: calc(16 * var(--s)); inset-inline-start: calc(46 * var(--s)); font: 600 calc(16 * var(--s)) var(--sans); }
[dir="rtl"] .t-status { inset-inline-start: auto; inset-inline-end: calc(46 * var(--s)); }
.t-head { display: flex; justify-content: space-between; align-items: flex-end; margin: calc(18 * var(--s)) 0 calc(12 * var(--s)); }
.t-title { font: 800 calc(34 * var(--s)) / 1 var(--serif); }
.t-date { color: #6E6456; font-size: calc(13 * var(--s)); margin-top: calc(4 * var(--s)); }
.t-streak { border: 1.5px solid #AC7F27; background: rgba(172,127,39,.13); color: #AC7F27; border-radius: 100px; padding: calc(4 * var(--s)) calc(12 * var(--s)); font-weight: 800; display: flex; gap: 4px; font-size: calc(14 * var(--s)); }
.t-ded { display: flex; gap: calc(10 * var(--s)); align-items: center; background: #F1E9DB; border: 1.2px solid #AC7F27; border-radius: calc(16 * var(--s)); padding: calc(9 * var(--s)) calc(12 * var(--s)); margin-bottom: calc(10 * var(--s)); }
.t-ded-ic { background: #fff; border-radius: calc(10 * var(--s)); width: calc(32 * var(--s)); height: calc(32 * var(--s)); display: grid; place-items: center; color: #AC7F27; flex: none; }
.t-ded-k { color: #AC7F27; font-weight: 800; font-size: calc(9.5 * var(--s)); letter-spacing: .06em; text-transform: uppercase; }
.t-ded-v { font-family: var(--serif); font-weight: 600; font-size: calc(13 * var(--s)); }
.t-card { background: #fff; border: 1px solid rgba(33,28,22,.08); border-radius: calc(18 * var(--s)); }
.t-hero { display: flex; align-items: center; gap: calc(14 * var(--s)); padding: calc(12 * var(--s)); margin-bottom: calc(12 * var(--s)); }
.ring { width: calc(104 * var(--s)); height: calc(104 * var(--s)); flex: none; }
.ring-bg { fill: none; stroke: #E8E5DF; stroke-width: 9; }
.ring-fg { fill: none; stroke: #24476F; stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); }
.ring-n { font: 800 34px var(--serif); text-anchor: middle; fill: #211C16; }
.ring-l { font: 800 8.5px var(--sans); text-anchor: middle; fill: #6E6456; letter-spacing: .06em; }
.t-hero-txt { font: 800 calc(19 * var(--s)) / 1.25 var(--serif); }
.t-sun { font: 400 calc(10.5 * var(--s)) var(--sans); color: #6E6456; margin-top: calc(8 * var(--s)); }
.t-list { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(8 * var(--s)); }
.t-list li { display: flex; align-items: center; gap: calc(10 * var(--s)); background: #fff; border: 1px solid rgba(33,28,22,.08); border-radius: calc(16 * var(--s)); padding: calc(10 * var(--s)) calc(12 * var(--s)); }
.t-list i { width: calc(4 * var(--s)); align-self: stretch; border-radius: 4px; background: var(--c); flex: none; }
.t-list div { flex: 1; min-width: 0; }
.t-list b { display: block; font-size: calc(15 * var(--s)); font-weight: 800; line-height: 1.2; }
.t-list small { color: #6E6456; font-size: calc(12 * var(--s)); }
/* the screen keeps light-theme colors even in dark mode */
.screen.today .t-list li i { background: var(--c); }
.screen.today { --c-talmud: #6E2B34; --c-halakhah: #24476F; --c-mishnah: #8A5A2B; --c-tehillim: #1F6F8B; --c-chassidus: #57478A; }
.chk {
  flex: none; font-style: normal; font-weight: 800; font-size: calc(12 * var(--s));
  border-radius: 100px; padding: calc(6 * var(--s)) calc(14 * var(--s)); min-width: calc(60 * var(--s)); text-align: center;
  background: #24476F; color: #fff; transition: background .35s, color .35s;
}
.chk::after { content: "למד"; }
html[data-l="en"] .chk::after { content: "Learn"; }
.chk.on { background: rgba(61,115,80,.15); color: #3D7350; }
.chk.on::after { content: "✓ נלמד"; }
html[data-l="en"] .chk.on::after { content: "✓ Done"; }
.phone-hero { --w: min(340px, 82vw); transform: rotate(-2deg); }
.t-tabs { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-around; padding: calc(8 * var(--s)) 0 calc(26 * var(--s)); background: rgba(251,250,247,.94); border-top: 1px solid rgba(33,28,22,.08); }
.t-tabs > span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: calc(10.5 * var(--s)); font-weight: 700; color: #9A9184; }
.t-tabs svg { width: calc(24 * var(--s)); height: calc(24 * var(--s)); color: #9A9184; }
.t-tabs .on, .t-tabs .on svg { color: #24476F; }
.phone-hero::after { /* gold halo */
  content: ""; position: absolute; inset: -40px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--gold-tint), transparent);
}

/* ── Marquee ── */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--paper-2); padding: 16px 0; }
.marquee-track { display: flex; gap: 38px; width: max-content; animation: slide 60s linear infinite; }
[dir="rtl"] .marquee-track { animation-name: slide-rtl; }
.marquee span { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.marquee span:nth-child(odd) { color: var(--ink); font-weight: 800; }
.marquee span::after { content: "✦"; color: var(--gold); font-size: 12px; margin-inline-start: 38px; vertical-align: middle; }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes slide-rtl { to { transform: translateX(50%); } }

/* ── Numbers ── */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1200px; margin: 0 auto; padding: 64px var(--gutter); gap: 24px; }
.num { text-align: center; }
.num b { display: block; font-family: var(--serif); font-weight: 900; font-size: clamp(44px, 6vw, 72px); line-height: 1; color: var(--techeiles); font-variant-numeric: tabular-nums; }
.num:last-child b { color: var(--gold); }
.num span { font-size: 16px; color: var(--ink-soft); font-weight: 600; }
@media (max-width: 720px) { .numbers { grid-template-columns: 1fr 1fr; row-gap: 36px; } }

/* ── Chapters ── */
.chapter {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 6vw, 96px);
  max-width: 1200px; margin: 0 auto; padding: clamp(56px, 9vw, 120px) var(--gutter);
  border-top: 1px solid var(--line-2);
}
.chapter.flip .chapter-txt { order: 2; }
.kicker { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
html[data-l="he"] .kicker { letter-spacing: .02em; font-size: 16px; }
.num-he {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  font: 800 24px var(--serif); color: var(--paper); background: var(--oxblood);
  border-radius: 50%; letter-spacing: 0;
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--oxblood);
}
.chapter h2 { font-size: clamp(34px, 4.6vw, 58px); margin-bottom: 20px; text-wrap: balance; }
.chapter p { color: var(--ink-soft); font-size: 19px; margin: 0 0 18px; max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.ticks li::before { content: ""; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--techeiles-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%232E5C93' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/15px no-repeat; }

.chapter-fig { position: relative; margin: 0; display: grid; place-items: center; min-height: 420px; }
.chapter-fig .phone { --w: min(320px, 74vw); transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.tilt-l { transform: rotate(-3deg); }
.tilt-r { transform: rotate(3deg); }
.chapter-fig:hover .tilt-l, .chapter-fig:hover .tilt-r { transform: rotate(0) translateY(-6px); }
.pair { grid-template-areas: "a"; }
.pair .phone { grid-area: a; }
.pair .phone:first-child { z-index: 2; transform: translateX(calc(var(--dir, 1) * -22%)) rotate(-3deg); }
.pair .phone.back { transform: translateX(calc(var(--dir, 1) * 26%)) rotate(4deg) scale(.9); filter: saturate(.85); opacity: .96; }
[dir="rtl"] .pair { --dir: -1; }
.pair:hover .phone:first-child { transform: translateX(calc(var(--dir, 1) * -26%)) rotate(-4deg) translateY(-6px); }
.pair:hover .phone.back { transform: translateX(calc(var(--dir, 1) * 30%)) rotate(6deg) scale(.9); }

.gloss {
  position: absolute; font: 700 15px var(--serif); color: var(--oxblood);
  background: var(--paper); border: 1px solid var(--oxblood); padding: 4px 14px; border-radius: 100px;
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.3);
  animation: bob 5s ease-in-out infinite;
}
.gloss-a { top: 22%; inset-inline-start: 2%; }
.gloss-b { bottom: 24%; inset-inline-end: 2%; animation-delay: -2.5s; color: var(--techeiles); border-color: var(--techeiles); }
@keyframes bob { 50% { transform: translateY(-8px); } }

@media (max-width: 860px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter.flip .chapter-txt { order: 0; }
  .chapter-fig .phone { --w: min(280px, 64vw); }
}

/* ── Progress board (drawn) ── */
.board {
  width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 28px; padding: 22px; box-shadow: var(--shadow); transform: rotate(1.5deg);
}
.board-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.board-stats div { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.board-stats b { display: block; font: 800 32px/1 var(--serif); }
.board-stats .g b { color: var(--gold); }
.board-stats span { font-size: 13px; color: var(--ink-soft); }
.board-shas { border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 18px; }
.bs-k { font-size: 12px; font-weight: 800; color: var(--oxblood); letter-spacing: .08em; text-transform: uppercase; }
.bs-t { font: 800 24px var(--serif); margin: 2px 0 12px; }
.bar-track { height: 10px; background: var(--paper-2); border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--oxblood); border-radius: 10px; transition: width 1.6s cubic-bezier(.2,.8,.2,1) .2s; }
.in .bar-fill { width: var(--w); }
.bs-f { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; direction: ltr; }
[dir="rtl"] .heat { direction: rtl; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--heat-0); transform: scale(.4); opacity: 0; transition: transform .4s, opacity .4s; }
.in .heat i { transform: none; opacity: 1; }
.heat i.l1 { background: var(--heat-1); } .heat i.l2 { background: var(--heat-2); } .heat i.l3 { background: var(--heat-3); } .heat i.l4 { background: var(--heat-4); }
.heat-legend { display: flex; gap: 5px; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--ink-faint); margin-top: 10px; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; }
.heat-legend .l0 { background: var(--heat-0); } .heat-legend .l1 { background: var(--heat-1); } .heat-legend .l2 { background: var(--heat-2); } .heat-legend .l3 { background: var(--heat-3); } .heat-legend .l4 { background: var(--heat-4); }

/* ── Sunset band ── */
.sunset { position: relative; height: clamp(360px, 48vw, 540px); overflow: hidden; color: #FBFAF7; }
.sun-arc { position: absolute; inset: 0; width: 100%; height: 100%; }
.sun { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 60px 20px color-mix(in srgb, var(--gold-bright) 45%, transparent); left: 30%; top: 40%; }
.sunset::after { content: ""; position: absolute; inset: auto 0 0 0; height: 16.7%; background: #211C16; }
.sunset-txt { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; padding: 0 var(--gutter) clamp(24px, 4vw, 40px); }
.quote { font: 700 clamp(26px, 4vw, 48px)/1.2 var(--serif); color: var(--ink); margin-bottom: auto; margin-top: clamp(40px, 7vw, 80px); text-wrap: balance; }
.sunset-txt p { margin: 0; font-size: 17px; opacity: .9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .quote { color: #F1EBDF; } }
.sunset-txt p { color: #FBFAF7; }

/* ── Shabbos sheets (drawn) ── */
.sheets { position: relative; width: min(360px, 80vw); aspect-ratio: 210 / 297; }
.sheet {
  position: absolute; inset: 0; background: #FFFDF8; color: #211C16; border-radius: 4px;
  box-shadow: 0 20px 40px -18px rgba(33,28,22,.45), 0 0 0 1px rgba(33,28,22,.06);
  padding: 9% 10%; transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.s3 { transform: rotate(-7deg) translate(-8%, 2%); }
.s2 { transform: rotate(4deg) translate(6%, -2%); }
.s1 { transform: rotate(-1deg); }
.chapter-fig:hover .s3 { transform: rotate(-11deg) translate(-16%, 3%); }
.chapter-fig:hover .s2 { transform: rotate(8deg) translate(14%, -3%); }
.sh-h { font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #AC7F27; border-bottom: 1px solid rgba(33,28,22,.15); padding-bottom: 8px; margin-bottom: 12px; }
.sh-ref { font: 800 22px var(--serif); color: #6E2B34; text-align: center; direction: rtl; }
.sh-text { direction: rtl; text-align: justify; font: 400 clamp(14px, 1.6vw, 17px)/1.8 var(--serif); margin: 10px 0 12px; }
.sh-lines { height: 40%; background: repeating-linear-gradient(to bottom, rgba(33,28,22,.13) 0 2px, transparent 2px 14px); mask-image: linear-gradient(#000 60%, transparent); -webkit-mask-image: linear-gradient(#000 60%, transparent); }
.s2 .sh-lines, .s3 .sh-lines { height: 80%; }
.candles { position: absolute; bottom: -4%; inset-inline-end: -16%; display: flex; gap: 14px; z-index: 3; }
.candles i { position: relative; width: 20px; height: 120px; border-radius: 3px; background: linear-gradient(90deg, #efe6d4, #fff, #e6dbc4); box-shadow: 0 10px 20px -8px rgba(0,0,0,.4); }
.candles i::before { content: ""; position: absolute; top: -26px; left: 50%; width: 12px; height: 22px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6c9, #F7B733 50%, rgba(231,110,20,.3) 75%, transparent 76%); filter: blur(.3px); animation: flicker 2.3s ease-in-out infinite; transform-origin: 50% 100%; }
.candles i:nth-child(2)::before { animation-delay: -1.1s; }
.candles i::after { content: ""; position: absolute; top: -40px; left: 50%; width: 60px; height: 60px; margin-left: -30px; border-radius: 50%; background: radial-gradient(closest-side, rgba(247,183,51,.35), transparent); }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 30% { transform: scale(1.06,.95) rotate(2deg); } 60% { transform: scale(.95,1.05) rotate(-1deg); } }

.flame { position: absolute; width: 180px; height: 180px; inset-inline-end: 6%; top: 8%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, var(--gold-tint), transparent); animation: bob 6s ease-in-out infinite; }

/* ── More ── */
.more { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 8vw, 110px) var(--gutter); border-top: 1px solid var(--line-2); }
.more-h { font-size: clamp(30px, 4vw, 46px); margin-bottom: 36px; text-align: center; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid var(--ink); }
.m { padding: 22px 22px 26px; border-bottom: 1px solid var(--line); }
.m:not(:nth-child(3n)) { border-inline-end: 1px solid var(--line); }
.m b { font: 800 21px var(--serif); display: block; margin-bottom: 4px; }
.m p { margin: 0; color: var(--ink-soft); font-size: 16px; }
@media (max-width: 820px) {
  .more-grid { grid-template-columns: 1fr 1fr; }
  .m:not(:nth-child(3n)) { border-inline-end: 0; }
  .m:nth-child(odd) { border-inline-end: 1px solid var(--line); }
}
@media (max-width: 520px) { .more-grid { grid-template-columns: 1fr; } .m:nth-child(odd) { border-inline-end: 0; } }

/* ── Klal Yisrael ── */
.klal { padding: 0 var(--gutter); }
.klal-in {
  max-width: 1100px; margin: 0 auto; background: #211C16; color: #FBFAF7; border-radius: 36px;
  padding: clamp(32px, 6vw, 72px); position: relative; overflow: hidden;
}
.klal-in::before { content: ""; position: absolute; width: 520px; height: 520px; inset-inline-end: -160px; top: -220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(199,154,61,.28), transparent); }
.klal-k { color: #C79A3D; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
html[data-l="he"] .klal-k { letter-spacing: .02em; font-size: 17px; }
.klal h2 { font-size: clamp(34px, 5vw, 64px); margin: 8px 0 14px; }
.klal p { color: rgba(251,250,247,.72); max-width: 36em; margin: 0 0 28px; }
.klal-bar { height: 14px; border-radius: 14px; background: rgba(255,255,255,.12); overflow: hidden; }
.klal-fill { height: 100%; width: 0; border-radius: 14px; background: linear-gradient(90deg, #AC7F27, #E6C176, #AC7F27); background-size: 200% 100%; animation: shimmer 4s linear infinite; transition: width 2s cubic-bezier(.2,.8,.2,1) .3s; }
[dir="rtl"] .klal-fill { margin-inline-start: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.klal-f { display: flex; justify-content: space-between; margin-top: 10px; font-size: 15px; color: rgba(251,250,247,.72); }

/* ── Download ── */
.download { text-align: center; padding: clamp(80px, 12vw, 160px) var(--gutter); }
.dl-mark { width: 84px; height: 84px; color: var(--techeiles); margin: 0 auto 18px; display: block; }
.download h2 { font-size: clamp(40px, 6.4vw, 84px); margin-bottom: 14px; text-wrap: balance; }
.download p { color: var(--ink-soft); font-size: 20px; margin: 0 0 34px; }
.stores { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.store {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; text-align: start;
  background: var(--ink); color: var(--paper); border-radius: 16px; padding: 12px 24px 12px 20px;
  font: 700 21px/1.1 var(--sans); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.store svg { width: 28px; height: 28px; }
.store small { display: block; font-size: 12px; font-weight: 600; opacity: .75; }
a.store:hover { transform: translateY(-3px); }
.store.soon { background: transparent; color: var(--ink-soft); border: 1.5px dashed var(--line); }

/* ── Footer ── */
.foot { border-top: 1px solid var(--line); padding: 36px var(--gutter) 48px; display: flex; flex-wrap: wrap; gap: 18px 36px; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 15px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font: 800 20px var(--serif); color: var(--ink); }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a { text-decoration: none; }
.foot-legal { flex-basis: 100%; margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-faint); max-width: 70em; }
.foot-legal a { color: inherit; }
.foot-links a:hover { color: var(--techeiles); text-decoration: underline; }

/* ── Reveal on scroll ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.phone-hero.reveal.in { transform: rotate(-2deg); }
.chapter-fig.reveal.in { transform: none; }
.d1 { transition-delay: .12s; } .d2 { transition-delay: .24s; } .d3 { transition-delay: .36s; }
.no-js .reveal { opacity: 1; transform: none; }

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