/* =========================================================
   Synagogue Beth Yossef — landing page
   Light warm parchment outside the book, engraved gold on night inside.
   ========================================================= */

:root {
  --parchment: #F7F1E6;
  --parchment-2: #EFE5D3;
  --paper-card: rgba(250, 245, 236, 0.93);
  --ink: #2A2118;
  --ink-soft: #66574A;
  --line: rgba(120, 90, 50, 0.22);
  --gold: #B8893B;
  --gold-deep: #8E6526;
  --gold-light: #E9CD8C;
  --navy: #1E2A4A;
  --night: #0B0906;
  --night-card: rgba(12, 9, 5, 0.58);
  --cream: #F4E9D2;
  --todo-bg: rgba(214, 120, 60, 0.14);
  --todo-ink: #B4552A;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;

  --header-h: 72px;
  --gutter: clamp(16px, 4vw, 56px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
address { font-style: normal; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--parchment); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Typography ---------- */
.eyebrow {
  margin: 0 0 14px;
  font: 600 11.5px/1.4 var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow--gold { color: var(--gold-light); opacity: 0.9; }

.title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.title em { font-style: italic; color: var(--gold-deep); }
.title--xl { font-size: clamp(48px, 6.4vw, 96px); line-height: 0.98; }

.lead { font-size: clamp(17px, 1.35vw, 20px); color: var(--ink-soft); max-width: 34ch; margin: 0; }
.small { font-size: 13.5px; line-height: 1.55; opacity: 0.82; }

/* Engraved gold */
.gold, .title.gold, .title.gold em {
  background: linear-gradient(176deg, #FBEFC6 0%, #E7C677 30%, #B98A36 58%, #F1D894 82%, #C49A48 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.title.gold { filter: drop-shadow(0 0 18px rgba(233, 196, 110, 0.22)); }

.todo {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px dashed currentColor;
  background: var(--todo-bg);
  color: var(--todo-ink);
  font: 600 12px/1.6 var(--sans);
  letter-spacing: 0.04em;
  -webkit-text-fill-color: currentColor;
}
.card--night .todo { color: #F2A672; background: rgba(242, 166, 114, 0.12); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 24px;
  border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--parchment);
  font: 500 15px/1 var(--sans); text-decoration: none;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.btn:hover { transform: translateY(-1px); background: #3B2F23; }
.btn--small { min-height: 40px; padding: 10px 18px; font-size: 14px; }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--parchment); }
.btn--gold {
  background: linear-gradient(180deg, #EBCF8B, #B98A36); border-color: transparent;
  color: #1C140A; font-weight: 600;
}
.btn--gold:hover { background: linear-gradient(180deg, #F4DDA2, #C89B45); }
.btn--ghost { background: transparent; border-color: rgba(233, 205, 140, 0.5); color: var(--cream); }
.btn--ghost:hover { background: rgba(233, 205, 140, 0.12); }
.btn[aria-disabled="true"] { cursor: not-allowed; opacity: .75; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.actions--center { justify-content: center; }
.link-gold { color: var(--gold-light); text-decoration: none; border-bottom: 1px solid rgba(233,205,140,.4); }

/* ---------- Loader ---------- */
.loader { display: none; }
.js .loader {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 90;
  background: var(--parchment);
  transition: opacity .7s ease, visibility .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { text-align: center; }
.loader__name { font: 500 40px/1 var(--serif); margin: 0 0 22px; }
.loader__bar { display: block; width: 200px; height: 1px; background: var(--line); margin: 0 auto 16px; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.loader__pct { margin: 0; font: 600 11px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  color: var(--ink);
  transition: color .5s ease, background .5s ease;
}
.site-header.is-solid { background: rgba(247, 241, 230, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.site-header.is-dark { color: var(--cream); background: transparent; }
.site-header.is-dark .btn { background: transparent; border-color: rgba(233,205,140,.55); color: var(--cream); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 22px/1 var(--serif); letter-spacing: .01em; }
.brand__star { width: 22px; height: 22px; color: var(--gold); }
.nav { display: flex; gap: 30px; }
.nav a { text-decoration: none; font-size: 14px; font-weight: 500; opacity: .82; }
.nav a:hover { opacity: 1; }

/* =========================================================
   FILM — default (no JS / reduced motion): readable flow
   ========================================================= */
.film { position: relative; }
.stage { position: relative; height: 62vh; min-height: 360px; overflow: hidden; background: var(--night); }
.stage__media, .stage__media canvas, .stage__poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__poster { object-fit: cover; object-position: 40% 50%; }
.stage__media canvas { display: none; }
.stage__vignette, .stage__wash, .ornaments, .scroll-hint { display: none; }

.chapters { padding: 32px var(--gutter) 64px; display: grid; gap: 24px; max-width: 1100px; margin: 0 auto; }
.chapter--hero { padding: calc(var(--header-h) + 24px) 0 8px; order: -1; }
.chapter--dive { text-align: center; padding: 40px 0 8px; }
.card { border-radius: 20px; padding: clamp(24px, 3vw, 40px); }
.card--paper { background: var(--parchment-2); border: 1px solid var(--line); }
.card--night { background: var(--night); color: var(--cream); border: 1px solid rgba(233, 205, 140, .22); }
.card--night .title em { font-style: italic; }
.card p { margin: 0 0 12px; }

/* Lists */
.people { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 10px; }
.people li { display: grid; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.people strong { font: 600 21px/1.2 var(--serif); }
.people span { font-size: 14px; color: var(--ink-soft); }

.rows { margin: 6px 0 16px; display: grid; }
.rows > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid rgba(233, 205, 140, 0.18);
}
.rows dt { font-size: 15px; color: rgba(244, 233, 210, .86); }
.rows dd { margin: 0; text-align: right; white-space: nowrap; }
.rows dd small { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(233, 205, 140, .75); margin-right: 6px; }
.rows dd .gold { font: 500 30px/1 var(--serif); }
.rows--tight dd .gold { font-size: 24px; }
.rows--tight > div { padding: 8px 0; }
.rows--stack > div { display: block; }
.rows--stack dt { font: 500 22px/1.2 var(--serif); color: var(--gold-light); margin-bottom: 4px; }
.rows--stack dd { text-align: left; white-space: normal; font-size: 15px; line-height: 1.55; color: rgba(244,233,210,.82); }
.rows a, .card--night .small a, .contact-list a { color: var(--gold-light); text-decoration: none; }

.feasts { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 4px; }
.feasts li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid rgba(233,205,140,.18); }
.feasts .gold { font: 500 34px/1.1 var(--serif); }
.feasts small { font-size: 13.5px; color: rgba(244,233,210,.75); text-align: right; }

.contact-list p { display: grid; margin: 0 0 12px; font-size: 17px; }
.contact-list .label { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(233,205,140,.7); margin-bottom: 2px; }

/* =========================================================
   FILM — scroll-scrubbed mode (JS on, motion allowed)
   ========================================================= */
.film-on .film { height: var(--track, 1100vh); }
.film-on .stage {
  position: sticky; top: 0;
  height: 100vh; height: 100lvh; min-height: 0;
  background: var(--parchment);
}
.film-on .stage__poster { display: none; }
.film-on .stage__media canvas { display: block; }
.film-on .stage__vignette {
  display: block; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(8,6,3,.55) 100%),
    linear-gradient(180deg, rgba(8,6,3,.35) 0%, transparent 22%, transparent 70%, rgba(8,6,3,.45) 100%);
}
.film-on .stage__wash { display: block; position: absolute; inset: 0; background: var(--parchment); opacity: 0; pointer-events: none; }
.film-on .ornaments { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: 0; }
.ornament { position: absolute; color: var(--gold-light); will-change: transform; }
.ornament svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 10px rgba(233, 196, 110, .35)); }

.film-on .scroll-hint {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%);
  margin: 0; font: 600 10.5px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-soft);
}
.scroll-hint span { width: 1px; height: 34px; background: linear-gradient(var(--gold), transparent); animation: hint 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Chapters live inside the sticky stage */
.film-on .chapters { position: absolute; inset: 0; padding: 0; margin: 0; max-width: none; display: block; pointer-events: none; }
.film-on .chapter {
  position: absolute; opacity: 0; visibility: hidden;
  will-change: opacity, transform, filter;
}
.film-on .chapter.is-live { visibility: visible; pointer-events: auto; }
.film-on [data-step] { will-change: opacity, filter, transform; }

.film-on .chapter--hero {
  left: var(--gutter); top: 0; bottom: 0; width: min(40vw, 560px);
  display: flex; flex-direction: column; justify-content: center; padding: var(--header-h) 0 0;
}
.film-on .chapter--dive {
  left: 0; right: 0; top: 50%; translate: 0 -50%; text-align: center; padding: 0 var(--gutter);
}
.film-on .chapter--dive .title { text-shadow: none; }

.film-on .card {
  top: 50%; left: var(--gutter);
  width: min(460px, 38vw);
  translate: 0 -50%;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.film-on .card[data-side="right"] { left: auto; right: var(--gutter); }
.film-on .card--paper { background: var(--paper-card); box-shadow: 0 30px 60px -30px rgba(40, 25, 10, .45); }
/* Inside the book: no card — the text is engraved straight onto the scene */
.film-on .card--night {
  background: none; border: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  width: min(560px, 44vw); padding: 0;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .65);
}
.film-on .card--night::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -22% -28%;
  background: radial-gradient(closest-side, rgba(6, 4, 2, .78), rgba(6, 4, 2, .45) 55%, transparent);
}
.film-on .card--night .gold, .film-on .card--night .title.gold { text-shadow: none; }
.film-on .card--night .rows > div,
.film-on .card--night .feasts li { border-bottom-color: rgba(233, 205, 140, .28); }

/* ---------- Final CTA ---------- */
.cta {
  position: relative; text-align: center;
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(80px, 10vw, 140px);
  background: radial-gradient(70% 60% at 50% 0%, #FBF6EC 0%, var(--parchment) 70%);
}
.cta__ornament { width: 74px; height: 74px; color: var(--gold); margin: 0 auto 28px; opacity: .85; }
.cta .lead { margin: 0 auto; max-width: 46ch; }
.cta .title--xl { margin-bottom: 22px; }

/* ---------- Footer ---------- */
.footer { background: var(--parchment-2); border-top: 1px solid var(--line); padding: 64px var(--gutter) calc(28px + var(--safe-b)); font-size: 15px; color: var(--ink-soft); }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1fr; gap: 40px; max-width: 1240px; margin: 0 auto; }
.footer p { margin: 0 0 10px; }
.footer a { text-decoration: none; color: var(--ink); }
.footer a:hover { color: var(--gold-deep); }
.footer__brand { font: 600 30px/1 var(--serif); color: var(--ink); margin-bottom: 14px !important; }
.footer__social { display: flex; gap: 18px; margin-top: 16px !important; }
.footer__hours { list-style: none; margin: 0; padding: 0; }
.footer__hours li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.footer__hours li span:last-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.footer__bottom { max-width: 1240px; margin: 48px auto 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .nav { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .brand { font-size: 20px; }
  .title { font-size: 32px; margin-bottom: 12px; }
  .title--xl { font-size: 46px; }
  .eyebrow { font-size: 10.5px; letter-spacing: .28em; margin-bottom: 10px; }

  .film-on .chapter--hero {
    left: 16px; right: 16px; width: auto; bottom: auto;
    top: calc(var(--header-h) + 3svh); padding: 0; justify-content: flex-start;
  }
  .film-on .chapter--hero .lead { font-size: 15.5px; }
  .film-on .card,
  .film-on .card--night {
    top: auto; bottom: calc(14px + var(--safe-b)); left: 12px; right: 12px; width: auto;
    translate: 0 0; padding: 20px 20px 16px; border-radius: 18px;
    max-height: calc(100svh - var(--header-h) - 28px - var(--safe-b));
  }
  .film-on .card[data-side="right"] { left: 12px; right: 12px; }
  .film-on .card--night { background: none; padding: 0 6px; bottom: calc(22px + var(--safe-b)); }
  .film-on .card--night::before { inset: -40% -12px -30%; background: linear-gradient(180deg, transparent, rgba(6, 4, 2, .82) 32%, rgba(6, 4, 2, .9)); }
  .card p { font-size: 14.5px; margin-bottom: 9px; }
  .small { font-size: 12.5px; }
  .people { gap: 4px; margin-bottom: 8px; }
  .people li { padding-bottom: 6px; }
  .people strong { font-size: 18px; }
  .people span { font-size: 13px; }
  .rows > div { padding: 8px 0; }
  .rows dt { font-size: 13.5px; }
  .rows dd .gold { font-size: 24px; }
  .rows--tight dd .gold { font-size: 19px; }
  .rows--tight > div { padding: 6px 0; }
  .rows--stack > div { padding: 7px 0; }
  .rows--stack dt { font-size: 18px; }
  .rows--stack dd { font-size: 13.5px; line-height: 1.45; }
  .feasts .gold { font-size: 27px; }
  .feasts small { font-size: 12.5px; }
  .contact-list p { font-size: 15.5px; margin-bottom: 8px; }
  .actions { margin-top: 12px; gap: 8px; }
  .actions .btn { min-height: 44px; padding: 10px 16px; font-size: 14px; }

  .cta .actions .btn { width: 100%; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .footer { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  .btn { transition: none; }
}
