/* Layout idea: a fixed full-screen "movie screen" (#stage) that scroll scrubs through,
   with a thin HUD around the edges and subtitles in the lower third.
   The ending is a normal warm-paper page you scroll into. */
:root {
  --night: #0b0d12;        /* the dark theater around the film */
  --paper: #f7f1e6;        /* storybook paper, used for the ending */
  --ink: #1b1a17;          /* text on paper */
  --brass: #c9a25a;        /* the key, small highlights */
  --blue: #1f44c9;         /* flag blue, used sparingly */
  --white: #fffaf2;        /* warm white for subtitles */
  --muted: rgba(255, 250, 242, 0.62);

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Rubik', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--white);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; height: 100%; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- the diary opening (js/vault.js draws into this) ---------- */
#vault { position: fixed; inset: 0; z-index: 50; background: #f3ece2; }

/* ---------- the movie screen ---------- */
#stage {
  position: fixed; inset: 0;
  overflow: hidden;
  background: var(--night);
  z-index: 1;
}
.layer {
  position: absolute; inset: 0;
  will-change: transform, opacity, clip-path;
  visibility: hidden;
}
.layer video, .layer img, .layer .ph {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* soft vignette + bottom shade so subtitles always read */
.layer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,0.38) 100%),
    linear-gradient(to top, rgba(6,7,10,0.72) 0%, rgba(6,7,10,0) 38%);
}

/* placeholder shown until a clip exists */
.ph {
  display: grid; place-content: center; text-align: center; gap: 10px;
  padding: var(--gutter);
  background:
    radial-gradient(120% 90% at 30% 20%, var(--ph-a, #3b2f25) 0%, transparent 60%),
    radial-gradient(120% 90% at 80% 90%, var(--ph-b, #1d2738) 0%, transparent 60%),
    #12141a;
}
.ph .mono { color: var(--muted); }
.ph strong {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(28px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.02em;
}
.ph p { margin: 0 auto; max-width: 48ch; color: var(--muted); font-size: 15px; line-height: 1.5; }

.sketch { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#laptopOnly { display: none; }
@media (max-width: 899px), (hover: none) and (pointer: coarse) {
  #laptopOnly {
    display: grid; place-content: center; gap: 10px; text-align: center;
    position: fixed; inset: 0; z-index: 100; padding: 0 24px;
    background: #fbf8f1; color: #3a4a6b;
  }
  #laptopOnly .hand { margin: 0; font-family: 'Patrick Hand', cursive; font-size: 34px; }
  #laptopOnly p { margin: 0; font-size: 16px; }
}
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* ---------- storybook chapter pages ---------- */
.layer.is-page { background: #fbf8f1; backface-visibility: hidden; box-shadow: -30px 0 60px rgba(0,0,0,0.35); }
.layer.is-page::after { background: radial-gradient(ellipse at 45% 45%, transparent 60%, rgba(70,55,30,0.18) 100%); }
.paper {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 4vw, 64px);
  padding: 0 var(--gutter) 0 calc(var(--gutter) + clamp(56px, 9vw, 120px));
  --rule: clamp(44px, 5.4vw, 74px);              /* distance between the blue lines */
  /* layers, top to bottom: light falloff, red margin line, blue ruled lines, paper grain, paper */
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(0,0,0,0) 85%, rgba(80,60,30,0.10) 100%),
    linear-gradient(90deg, transparent calc(var(--gutter) + clamp(40px, 7vw, 96px)), rgba(240,150,160,0.6) 0, rgba(240,150,160,0.6) calc(var(--gutter) + clamp(40px, 7vw, 96px) + 1.5px), transparent 0),
    repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--rule) - 1.5px), rgba(140,170,220,0.45) calc(var(--rule) - 1.5px), rgba(140,170,220,0.45) var(--rule)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .38  0 0 0 0 .30  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    #fbf8f1;
  background-position: 0 0, 0 0, 0 0, 0 calc(50% + var(--rule) * 0.28), 0 0, 0 0;
  color: #3a4a6b;                                  /* soft navy pen */
}
.paper .chap {
  font-family: 'Patrick Hand', 'Comic Neue', 'Bradley Hand', cursive; font-weight: 500;
  font-size: clamp(22px, 2.2vw, 30px); line-height: var(--rule); color: #e58a9b;
  opacity: 0;
}
.paper .hand {
  margin: 0; text-align: left; max-width: 22ch;
  line-height: var(--rule);
  font-family: 'Patrick Hand', 'Comic Neue', 'Bradley Hand', cursive; font-weight: 700;
  font-size: calc(var(--rule) * 1.08); letter-spacing: 0;
  transform: none;
}
.ink-line { display: block; white-space: nowrap; clip-path: inset(-30% 100% -30% -2%); }
.ink-line .ch { display: inline-block; white-space: pre; }
.paper .ink { display: inline-block; padding-bottom: 0.12em; clip-path: inset(-30% 100% -30% -2%); }

/* the scene's key picture, taped into the notebook */
.taped { position: relative; margin: 0; justify-self: end; width: min(46vw, 620px); opacity: 0; transform-origin: 50% 40%; }
.taped .snap {
  background: #fff; padding: 12px 12px 34px;            /* like a printed photo with a white border */
  box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 18px 40px rgba(60,40,20,0.22);
  aspect-ratio: 16 / 10.4;
}
.taped .snap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.taped .snap.empty { background: #fff linear-gradient(135deg, #fde7ef, #e3f1ff); }
.taped .snap.empty img { display: none; }
/* two pieces of clipart washi tape on opposite corners */
.tape {
  position: absolute; width: 132px; height: 34px; opacity: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.35) 0 6px, transparent 6px 12px),
    rgba(255, 196, 214, 0.82);                          /* pink washi */
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 55%, 100% 82%, 97% 100%, 2% 96%, 0 70%, 4% 45%, 0 18%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.tape.tl { top: -12px; left: -34px; transform: rotate(-38deg); background-color: rgba(255, 196, 214, 0.82); }
.tape.br { bottom: 4px; right: -34px; transform: rotate(-38deg); background-color: rgba(178, 222, 246, 0.85); }
.words { display: grid; gap: 6px; justify-items: start; }
.paper .summary {
  margin: 6px 0 0; max-width: 34ch;
  font-family: 'Nanum Pen Script', 'Patrick Hand', 'Bradley Hand', cursive; font-size: clamp(26px, 2.3vw, 34px); line-height: 1.15;
  color: #6b7896; clip-path: inset(-20% 100% -20% -2%);
}
.paper .age-tag {
  position: absolute; top: clamp(28px, 6vh, 64px); left: calc(var(--gutter) + clamp(56px, 9vw, 120px));
  font-family: 'Nanum Pen Script', 'Patrick Hand', 'Bradley Hand', cursive; font-size: clamp(26px, 2.6vw, 38px);
  color: #3a4a6b; opacity: 0;
}

/* ---------- words on screen ---------- */
#captions, #notes { position: fixed; inset: 0; z-index: 3; pointer-events: none; }

/* spoken lines: centered low, big, like a line of dialogue in a film */
.line {
  position: absolute; left: 50%; bottom: calc(clamp(70px, 13vh, 130px) + env(safe-area-inset-bottom, 0px));
  display: grid; justify-items: center; gap: 6px; text-align: center;
  width: max-content; max-width: calc(100% - 2 * var(--gutter));
  opacity: 0; will-change: opacity, transform;
}
.line .said {
  font-family: var(--display); font-weight: 700; font-style: italic;
  font-size: clamp(34px, 5.4vw, 76px); line-height: 1; letter-spacing: -0.02em;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
.line .sub { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* handwritten margin notes: like someone scribbled the fact into the storybook */
.note {
  position: absolute; margin: 0;
  right: var(--gutter); top: calc(clamp(110px, 18vh, 170px) + env(safe-area-inset-top, 0px));
  max-width: min(320px, 70vw);
  font-family: 'Patrick Hand', 'Comic Neue', 'Bradley Hand', cursive; font-weight: 700;
  font-size: clamp(20px, 1.8vw, 26px); line-height: 1.15;
  color: #3a4a6b; background: #fff6c9;            /* a little sticky note */
  padding: 12px 16px 14px; border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  transform: rotate(-2deg); transform-origin: right top;
  text-shadow: none;
  opacity: 0;
}

/* CC: optional narration subtitles */
.cc {
  position: absolute; left: 50%; bottom: calc(clamp(56px, 8vh, 84px) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin: 0; width: min(46ch, calc(100% - 2 * var(--gutter)));
  text-align: center; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.4;
  background: rgba(8, 9, 12, 0.55); padding: 6px 12px; border-radius: 8px;
  opacity: 0;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  opacity: 0; transition: opacity .8s ease;
}
body.film-on #hud { opacity: 1; }
body.film-on.on-page #hud { opacity: 0.12; }
/* while a scene is still a doodle on white paper, words switch to pen ink */
#hud, .line .said, .line .sub { transition: color .6s ease, text-shadow .6s ease; }
body.on-paper #hud { color: #3a4a6b; }
body.on-paper #hud .age .mono, body.on-paper #hud .where .mono { color: #6b7896; }
body.on-paper #soundBtn, body.on-paper #filmBtn, body.on-paper #ccBtn { color: #3a4a6b; border-color: rgba(58,74,107,0.35); background: rgba(255,255,255,0.6); }
body.on-paper .progress { background: rgba(58,74,107,0.15); }
body.on-paper .line .said { color: #3a4a6b; text-shadow: none; font-family: 'Patrick Hand', cursive; font-style: normal; font-weight: 400; }
body.on-paper .line .sub { color: #6b7896; }
body.on-paper .layer::after { opacity: 0; }
.layer::after { transition: opacity .6s ease; }
#hud .age {
  position: absolute; left: var(--gutter); top: calc(var(--gutter) + env(safe-area-inset-top, 0px));
  display: grid; gap: 2px;
}
#hud .age .mono { color: var(--muted); }
.age-num {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 6vw, 84px); line-height: 0.9; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
#hud .where {
  position: absolute; right: var(--gutter); top: calc(var(--gutter) + env(safe-area-inset-top, 0px));
  display: grid; gap: 4px; text-align: right;
}
#hud .where .mono { color: var(--brass); }
#soundBtn, #filmBtn, #ccBtn {
  pointer-events: auto;
  position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.08); color: var(--white);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background .2s, border-color .2s;
}
#soundBtn { right: var(--gutter); }
#filmBtn { right: calc(var(--gutter) + 128px); }
#ccBtn { right: calc(var(--gutter) + 270px); }
#soundBtn:hover, #filmBtn:hover, #ccBtn:hover { background: rgba(255,255,255,0.16); }
#soundBtn[aria-pressed="true"], #filmBtn[aria-pressed="true"], #ccBtn[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); }
#soundBtn:focus-visible, #filmBtn:focus-visible, #ccBtn:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.progress {
  position: absolute; left: var(--gutter); right: calc(var(--gutter) + 340px);
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  height: 2px; background: rgba(255,255,255,0.14); border-radius: 2px; overflow: hidden;
}
#progressFill { height: 100%; width: 0; background: var(--brass); transform-origin: left; }
@media (max-width: 640px) {
  .progress { right: var(--gutter); bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  #filmBtn { right: auto; left: var(--gutter); }
  #ccBtn { right: calc(var(--gutter) + 128px); }
}

/* ---------- scroll track ---------- */
main { position: relative; z-index: 2; }
#track { width: 1px; }

/* ---------- the ending (warm paper) ---------- */
#ending {
  position: relative; z-index: 5;
  background: var(--paper); color: var(--ink);
  padding: clamp(48px, 8vh, 96px) var(--gutter) 64px;
  color-scheme: light;
}
#ending .wrap { max-width: 1120px; margin: 0 auto; display: grid; gap: clamp(28px, 4vw, 48px); }
#ending .eyebrow { color: #8a6a2f; margin: 0; }
#answer {
  margin: 0;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(34px, 5.6vw, 76px); line-height: 1.02; letter-spacing: -0.03em;
  text-wrap: balance; max-width: 18ch;
}
.reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border-top: 1px solid rgba(27,26,23,0.15); }
.reason { padding: 20px 20px 22px 0; border-bottom: 1px solid rgba(27,26,23,0.15); display: grid; gap: 6px; min-width: 0; }
.reason b { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; }
.reason span { color: #5d574c; font-size: 15px; line-height: 1.45; }

.companies { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.company {
  background: #fffaf1; border: 1px solid rgba(27,26,23,0.1); border-radius: 14px;
  padding: 20px; display: grid; gap: 8px; align-content: start; min-width: 0;
}
.company .mono { color: #8a6a2f; }
.company b { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.company span { color: #5d574c; font-size: 15px; line-height: 1.45; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 5vw, 64px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--blue); }
.stat span { color: #5d574c; font-size: 15px; }

.quote { margin: clamp(20px, 4vw, 40px) 0; padding: 0; }
.quote blockquote {
  margin: 0;
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(28px, 4.2vw, 56px); line-height: 1.1; letter-spacing: -0.02em;
  text-wrap: balance; max-width: 24ch;
}
.quote blockquote::before { content: "\201C"; color: var(--brass); }
.quote blockquote::after { content: "\201D"; color: var(--brass); }
.quote figcaption { margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #5d574c; }

.other-path {
  justify-self: start;
  font: 600 16px var(--body); color: var(--paper); background: var(--ink);
  border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.other-path:hover { transform: translateY(-2px); background: var(--blue); }
.other-path:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.credits {
  display: grid; justify-items: center; text-align: center; gap: 6px;
  padding-top: clamp(48px, 8vh, 96px); margin-top: clamp(24px, 4vh, 48px);
  border-top: 1px solid rgba(27,26,23,0.15);
}
.credits .film-by { margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(18px, 1.8vw, 24px); color: #5d574c; }
.credits .names { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 64px); letter-spacing: -0.02em; line-height: 1.05; }
.credits .names span { font-style: italic; font-weight: 500; color: var(--brass); }
.credits .small { margin: 18px 0 0; font-size: 14px; color: #5d574c; line-height: 1.5; }
.credits a { color: var(--blue); }

/* reveal on scroll, but readable by default */
.rise { transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.rise.pre { opacity: 0; transform: translateY(24px); }

@media (prefers-reduced-motion: reduce) {
  .rise, .rise.pre { transition: none; opacity: 1; transform: none; }
}

/* ---------- ending: fact pages + credits pages (notebook) ---------- */
.is-end .paper .hand { font-size: calc(var(--rule) * 0.74); max-width: 24ch; }
.is-end .facts { display: grid; gap: 4px; margin-top: 4px; }
.is-end .fact { margin: 0; max-width: 34ch; font-size: clamp(26px, 2.3vw, 36px); line-height: 1.1; color: #4f5d80; }
.has-source .fact:first-child { color: #e58a9b; }       /* the source line under the headline */
.end-credits .paper .hand { font-size: calc(var(--rule) * 0.9); }

/* Israeli pastel: soft flag-blue stripes, sand and lemon, pomegranate pink, a few doodles */
.paper.pastel {
  --sky: #a9d3f2; --sky-deep: #7fb6e3; --sand: #f6ead0; --lemon: #f7e7a4; --pom: #f4b6b0; --olive: #c5d6a6; --sea: #a8ddd6;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 55%),
    repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--rule) - 1.5px), rgba(127,182,227,0.35) calc(var(--rule) - 1.5px), rgba(127,182,227,0.35) var(--rule)),
    linear-gradient(160deg, #f4f9fd 0%, #fbf6ea 55%, #fdf1ef 100%);
  background-position: 0 0, 0 calc(50% + var(--rule) * 0.28), 0 0;
  color: #34507a;
}
.paper.pastel .chap { color: #e98f86; }
.paper.pastel .age-tag { color: #4a73a8; }
.paper.pastel .tape.tl { background-color: rgba(169, 211, 242, 0.9); }
.paper.pastel .tape.br { background-color: rgba(247, 231, 164, 0.92); }
.paper.pastel .stripe { position: absolute; left: 0; right: 0; height: clamp(10px, 1.4vh, 16px); background: var(--sky); opacity: 0.85; }
.paper.pastel .stripe.top { top: clamp(14px, 3vh, 30px); }
.paper.pastel .stripe.bottom { bottom: clamp(14px, 3vh, 30px); }
.paper.pastel .doodles {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.75;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'><g fill='none' stroke='%237fb6e3' stroke-width='3' stroke-linejoin='round'><path d='M45 12 L70 55 L20 55 Z'/><path d='M45 70 L20 27 L70 27 Z'/></g></svg>") no-repeat right 6% top 12% / 70px,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><circle cx='40' cy='42' r='22' fill='%23f4b6b0'/><path d='M33 20 l7 -9 l7 9 z' fill='%23e98f86'/><circle cx='34' cy='38' r='3' fill='%23fff' opacity='.7'/></svg>") no-repeat left 3% bottom 12% / 64px,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><circle cx='40' cy='40' r='14' fill='%23f7e7a4'/><g stroke='%23f2d56b' stroke-width='3' stroke-linecap='round'><path d='M40 8v10M40 62v10M8 40h10M62 40h10M17 17l7 7M56 56l7 7M63 17l-7 7M24 56l-7 7'/></g></svg>") no-repeat left 4% top 13% / 60px,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><path d='M20 64 C30 40 48 26 66 18' stroke='%23a3bd7e' stroke-width='3' fill='none'/><g fill='%23c5d6a6'><ellipse cx='32' cy='46' rx='9' ry='4' transform='rotate(-40 32 46)'/><ellipse cx='44' cy='34' rx='9' ry='4' transform='rotate(-40 44 34)'/><ellipse cx='56' cy='24' rx='9' ry='4' transform='rotate(-40 56 24)'/></g></svg>") no-repeat right 4% bottom 13% / 66px;
}
/* the Claude map: taller photo, Israel circled in red marker */
.taped.is-map { width: min(24vw, 330px); }
.taped.is-map .snap { aspect-ratio: auto; height: auto !important; position: relative; padding-bottom: 28px; }
.taped.is-map .snap img { position: static; height: auto; object-fit: contain; }
.taped .circle {
  position: absolute; width: 30%; left: calc(12px + (100% - 24px) * 0.555); top: calc(12px + (100% - 40px) * 0.35);
  overflow: visible; pointer-events: none;
}
.taped .circle path { fill: none; stroke: #e2392f; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); }

#ending .wrap { justify-items: center; text-align: center; gap: 16px; }
#ending .small { margin: 0; font-size: 15px; color: #5d574c; }
#ending a { color: var(--blue); }
.replay { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper); background: var(--ink); border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; }
.replay:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }


/* ---------- the title screen: a little pastel Israel (js/hero.js) ---------- */
#hero { position: fixed; inset: 0; z-index: 95; overflow: hidden; background: #fbf4ea; color: #24202b; font-family: var(--body); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 22px clamp(24px, 6vw, 96px); font-size: 14px; pointer-events: none; }
.hero-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.hero-logo i { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #8fc3ec, #5f9be0); box-shadow: inset 0 -6px 0 rgba(255,255,255,.35); }
.hero-by { color: #6d6878; }
.hero-copy { position: absolute; left: clamp(24px, 4.5vw, 72px); top: clamp(80px, 13vh, 130px); pointer-events: none; }
#hero h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(56px, 6.4vw, 104px); line-height: .98; letter-spacing: -0.035em; }
#hero h1 em { font-style: italic; font-weight: 400; color: #e9897a; }
.hero-info { position: absolute; left: clamp(24px, 4.5vw, 72px); bottom: clamp(28px, 5vh, 52px); max-width: 360px; pointer-events: none; }
.hero-info p { margin: 0 0 8px; font-size: 16px; line-height: 1.5; color: #4a4553; }
.hero-info small { font-size: 13px; color: #8a8494; }
.hero-play { position: absolute; left: 50%; bottom: clamp(36px, 8vh, 80px); transform: translateX(-50%); border: 0; cursor: pointer; padding: 20px 34px; border-radius: 999px; background: #24202b; color: #fff; font: 600 19px var(--body); box-shadow: 0 14px 34px rgba(36,32,43,.3); transition: background .2s ease, box-shadow .2s ease; animation: heroPulse 2.4s ease-in-out infinite; }
.hero-play:hover { background: #e9897a; }
@keyframes heroPulse { 50% { box-shadow: 0 14px 34px rgba(36,32,43,.3), 0 0 0 10px rgba(255,255,255,.35); } }
.hero-play span { margin-left: 8px; font-size: 11px; }
.hero-fact { position: absolute; right: clamp(24px, 6vw, 110px); top: clamp(76px, 12vh, 120px); z-index: 2; max-width: 290px; padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,.9); box-shadow: 0 14px 34px rgba(60,40,80,.14); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.hero-fact.swap { opacity: 0; transform: translateY(-6px); }
.hero-fact small { display: flex; align-items: center; gap: 6px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #5f9be0; }
.hero-fact small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8fc3ec; box-shadow: 0 0 0 4px rgba(143,195,236,.3); }
.hero-fact b { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; line-height: 1.35; color: #24202b; }
.hero-scroll { position: absolute; left: 50%; bottom: clamp(28px, 5vh, 52px); transform: translateX(-50%); display: inline-flex; align-items: center; padding: 12px 14px; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 10px 26px rgba(60,40,80,.14); font: 600 15px var(--body); color: #24202b; white-space: nowrap; pointer-events: none; }
.hero-scroll i { position: relative; width: 18px; height: 28px; border: 2px solid #24202b; border-radius: 10px; }
.hero-scroll i::after { content: ""; position: absolute; left: 50%; top: 5px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: #e9897a; animation: heroWheel 1.5s ease-in-out infinite; }
@keyframes heroWheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }
@keyframes heroBob { 50% { transform: translateY(5px); } }
.hero-tip { position: absolute; left: 0; top: 0; z-index: 3; max-width: 260px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: 0 12px 30px rgba(60,40,80,.16); font-size: 14px; line-height: 1.4; color: #4a4553; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.hero-tip.on { opacity: 1; }
.hero-tip b { display: block; font-family: var(--display); font-size: 17px; color: #24202b; margin-bottom: 2px; }
.hero-flash { position: absolute; inset: 0; background: #fbf8f1; opacity: 0; pointer-events: none; }

.hero-canvas { z-index: 1; }
.hero-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(251,244,234,.9) 0%, rgba(251,244,234,.55) 28%, rgba(251,244,234,0) 46%), linear-gradient(0deg, rgba(251,244,234,.6) 0%, rgba(251,244,234,0) 22%); }
.hero-coast { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; background: #f3e6cf; opacity: 0; pointer-events: none; will-change: opacity; }
.hero-top, .hero-copy, .hero-info, .hero-play, .hero-scroll, .hero-fact { z-index: 2; }
.hero-tip { z-index: 3; }
.hero-flash { z-index: 4; }
