/* =========================================================================
   Phase 1 public site — Light Organism design system (WOW / flagship pass).
   Source: MDJ_Light_Organism_DESIGN.md. Scope: #siteHeader, #siteRoot, #heroCanvas
   and body.site-* states ONLY — login/account/admin (the Light screens) untouched.
   Art direction: Gaia observatory meets ancient spirituality. Darkness dominates;
   Jerusalem is the one thing allowed to shine; motion never exceeds a resting heartbeat.
   ========================================================================= */
:root {
  --lo-canvas: #0a0d18;
  --lo-raised: #0e1322;
  --lo-line: #232a3d;
  --lo-gold: #c9a24b;
  --lo-gold-bright: #e3b84f;
  --lo-spark: #dfe7f5;
  --lo-spark-dim: #aebcd8;
  --lo-ivory: #f2ecda;
  --lo-body: #e8e2d0;
  --lo-muted: #8b93a8;
  --lo-faint: #5c6478;
  --lo-display: 'Cormorant Garamond', 'Frank Ruhl Libre', Georgia, serif;
  --lo-display-he: 'Frank Ruhl Libre', 'Cormorant Garamond', Georgia, serif;
  --lo-sans: 'Assistant', 'Heebo', 'Segoe UI', system-ui, sans-serif;
  /* two easings only — the whole site's motion speaks through these */
  --ease-organic: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-ignite: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- page-state plumbing ------------------------------------------------- */
body.site-page .topbar,
body.site-page .count-badge,
body.site-page .map-reset,
body.site-page .tagline,
body.site-page .addr-search { display: none !important; }
body.site-page #radial { pointer-events: none; }
body.site-page .radial-zoom,
body.site-page .rl-toggle,
body.site-page .radial-legend,
body.site-page .radial-card { display: none !important; }
body.viewing-screen #siteHeader,
body.viewing-screen #siteRoot,
body.viewing-screen #heroCanvas { display: none !important; }

/* hero canvas — opaque night over the map on the homepage; cross-fades to reveal the
   real instrument on /map (the story becomes the instrument). */
#heroCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 12; background: var(--lo-canvas);
  opacity: 0; pointer-events: none; transition: opacity 0.8s var(--ease-organic);
}
body.site-home #heroCanvas { opacity: 1; }
/* about/privacy: solid night, no map, no canvas */
body.site-about #heroCanvas { opacity: 1; }
body.site-about #siteRoot { background: var(--lo-canvas); }

/* =========================================================================
   Header — wordmark · sparse nav · EN/HE · quiet Login (secondary)
   ========================================================================= */
#siteHeader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.82) 0%, rgba(10, 13, 24, 0.5) 60%, rgba(10, 13, 24, 0) 100%);
  transition: background 0.5s var(--ease-organic);
}
body.site-about #siteHeader, body.site-map #siteHeader { background: rgba(10, 13, 24, 0.86); backdrop-filter: blur(12px); border-bottom: 0.5px solid var(--lo-line); }
#siteHeader .sh-inner { max-width: 1280px; margin: 0 auto; padding: 0 26px; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.sh-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: none; }
.sh-node { flex: none; }
.sh-wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.sh-name { font-family: var(--lo-display-he); font-weight: 500; letter-spacing: 0.3em; font-size: 14px; color: var(--lo-ivory); }
.sh-sub { letter-spacing: 0.56em; font-size: 8px; font-weight: 600; color: var(--lo-gold); margin-top: 3px; }

.sh-nav { display: flex; align-items: center; gap: clamp(16px, 2.8vw, 38px); }
.sh-nav a { position: relative; text-decoration: none; font-family: var(--lo-sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lo-muted); padding: 8px 2px; transition: color 0.3s var(--ease-organic); }
.sh-nav a:hover, .sh-nav a.active { color: var(--lo-ivory); }
.sh-nav a.active::after { content: ''; position: absolute; inset-inline: 50%; bottom: 0; width: 4px; height: 4px; margin-inline-start: -2px; border-radius: 50%; background: var(--lo-gold-bright); box-shadow: 0 0 8px 1px rgba(227, 184, 79, 0.55); }
.sh-nav a:focus-visible, .sh-lang button:focus-visible, .sh-login:focus-visible { outline: 1px solid var(--lo-gold); outline-offset: 4px; }

.sh-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.sh-lang { display: flex; align-items: center; gap: 8px; color: var(--lo-faint); font-size: 11px; }
.sh-lang button { background: none; border: 0; cursor: pointer; padding: 4px 2px; font-family: var(--lo-sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; color: var(--lo-muted); transition: color 0.3s var(--ease-organic); }
.sh-lang button:hover { color: var(--lo-ivory); }
.sh-lang button[aria-current='true'] { color: var(--lo-gold-bright); }
.sh-login { text-decoration: none; font-family: var(--lo-sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lo-spark); border: 0.5px solid var(--lo-line); border-radius: 7px; padding: 9px 17px; transition: border-color 0.3s var(--ease-organic), color 0.3s var(--ease-organic); white-space: nowrap; }
.sh-login:hover { border-color: var(--lo-gold); color: var(--lo-gold-bright); }

/* =========================================================================
   Site root — the scrolling page above the fixed organism
   ========================================================================= */
#siteRoot { position: fixed; inset: 0; z-index: 14; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; color: var(--lo-body); font-family: var(--lo-sans); }
#siteRoot::-webkit-scrollbar { width: 9px; }
#siteRoot::-webkit-scrollbar-thumb { background: var(--lo-line); border-radius: 6px; }
#siteRoot::-webkit-scrollbar-track { background: transparent; }

/* ---- HERO — Jerusalem (on the canvas) owns the upper third; text anchors low ---- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; padding: 90px 24px clamp(96px, 15vh, 190px); }
/* only a soft bottom vignette for text legibility — the sky above stays open */
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(140% 62% at 50% 118%, rgba(10, 13, 24, 0.86) 0%, rgba(10, 13, 24, 0.34) 40%, transparent 66%); }
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: 0.44em; text-transform: uppercase; color: var(--lo-muted); margin-bottom: 20px; }
.hero-primary { font-family: var(--lo-display); font-weight: 500; color: var(--lo-ivory); font-size: clamp(38px, 6vw, 68px); line-height: 1.08; letter-spacing: 0.005em; text-wrap: balance; }
.hero-secondary { font-family: var(--lo-display); font-weight: 500; color: var(--lo-spark-dim); font-size: clamp(16px, 2.1vw, 23px); letter-spacing: 0.02em; margin-top: 12px; opacity: 0.85; }
/* Hebrew is a first-class anchor: when the UI is Hebrew, the Hebrew line is the display H1
   and English becomes the quiet secondary. */
html[dir='rtl'] .hero-primary { font-family: var(--lo-display-he); font-weight: 700; font-size: clamp(36px, 5.6vw, 64px); letter-spacing: 0.02em; }
/* Hebrew dislikes positive tracking on small caps-style labels — reset it in RTL */
html[dir='rtl'] .hero-eyebrow, html[dir='rtl'] .ch-num, html[dir='rtl'] .sec-eyebrow, html[dir='rtl'] .obs-tag { letter-spacing: 0.04em; }
html[dir='rtl'] .ch-he, html[dir='rtl'] .vessel-hebrew { font-weight: 700; }
.hero-count { margin-top: clamp(30px, 5vh, 54px); }
.hero-count .hc-num { display: block; font-family: var(--lo-display); font-weight: 600; font-size: clamp(30px, 4vw, 44px); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; color: var(--lo-ivory); }
.hero-count .hc-lbl { display: block; margin-top: 9px; font-size: 10px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--lo-muted); }
.hero-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 9px; z-index: 1; pointer-events: none; }
.hero-cue .hc-line { width: 1px; height: 46px; background: linear-gradient(180deg, transparent, var(--lo-gold)); }
.hero-cue .hc-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--lo-gold-bright); animation: cue-pulse 4.8s var(--ease-organic) infinite; }
@keyframes cue-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; box-shadow: 0 0 10px 2px rgba(227, 184, 79, 0.4); } }

/* SplitText mask lines start hidden (JS reveals). Fallback if JS/GSAP absent: visible. */
.js-reveal { opacity: 1; }

/* =========================================================================
   The scroll body — six chapters, each with a distinct composition so the eye
   never recognises a repeating template.
   ========================================================================= */
.site-body { position: relative; background: var(--lo-canvas); }
.site-body::before { content: ''; position: absolute; top: -220px; left: 0; right: 0; height: 220px; background: linear-gradient(180deg, transparent, var(--lo-canvas)); pointer-events: none; }
.chapter { position: relative; max-width: 1120px; margin: 0 auto; padding: clamp(90px, 13vh, 168px) 26px; }
.ch-num { font-family: var(--lo-sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.4em; color: var(--lo-muted); text-transform: uppercase; }
.ch-num .cn-star { color: var(--lo-gold); margin-inline-end: 10px; }
.ch-title { font-family: var(--lo-display); font-weight: 500; color: var(--lo-ivory); font-size: clamp(28px, 3.8vw, 44px); line-height: 1.16; margin: 14px 0 0; text-wrap: balance; }
.ch-he { font-family: var(--lo-display-he); color: var(--lo-gold); font-size: 16px; letter-spacing: 0.1em; margin-top: 10px; opacity: 0.8; }
.ch-body { color: var(--lo-body); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.9; max-width: 56ch; }
.ch-body.serif { font-family: var(--lo-display); font-size: clamp(18px, 1.7vw, 21px); line-height: 1.8; }
.ch-question { font-family: var(--lo-display); font-style: italic; color: var(--lo-ivory); font-size: clamp(20px, 2.3vw, 28px); line-height: 1.55; max-width: 40ch; }

/* chapter 02 — asymmetric: motif right, doctrine left, the question below */
.ch-signal { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(30px, 5vw, 72px); align-items: center; }
.ch-signal .cs-copy { text-align: start; }
.ch-signal .cs-art { position: relative; min-height: 260px; }
.ch-question-wrap { margin-top: clamp(40px, 6vh, 72px); text-align: center; }

/* chapter 03 — the geography of light: an instrument panel that reads from the horizon up */
.ch-geo { text-align: center; }
.geo-instrument { position: relative; margin: 46px auto 0; max-width: 720px; }
.geo-readout { display: flex; justify-content: center; gap: clamp(22px, 5vw, 64px); flex-wrap: wrap; margin-top: 30px; }
.geo-cell { text-align: center; }
.geo-cell .gk { font-size: 10px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--lo-muted); }
.geo-cell .gv { font-family: var(--lo-sans); font-size: clamp(20px, 2.4vw, 30px); font-weight: 600; color: var(--lo-ivory); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'lnum' 1, 'tnum' 1; letter-spacing: 0.03em; margin-top: 8px; unicode-bidi: isolate; }

/* chapter 04 — the vessel: symmetric, meditative (a diamond is symmetric by nature) */
.ch-vessel { text-align: center; }
.vessel-art { margin: 10px auto 30px; max-width: 340px; }
.vessel-hebrew { font-family: var(--lo-display-he); color: var(--lo-gold-bright); font-size: clamp(20px, 2.4vw, 30px); letter-spacing: 0.14em; margin-top: 34px; opacity: 0.9; }

/* ---- meanings shared bits ---- */
.ch-center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.motif { color: var(--lo-gold); }

/* =========================================================================
   Chapter 05 — Observation Records as an instrument readout (not cards)
   ========================================================================= */
.ch-obs { text-align: center; }
.obs-eyebrow-row { text-align: center; }
.obs-stage { position: relative; max-width: 760px; margin: 52px auto 0; padding: 0; }
.obs-record { position: relative; text-align: start; }
.obs-record[hidden] { display: none; }
.obs-lightno { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 0.5px solid var(--lo-line); }
.obs-lightno .ol-k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--lo-muted); }
.obs-lightno .ol-v { font-family: var(--lo-display); font-size: clamp(28px, 4vw, 44px); font-weight: 600; color: var(--lo-gold-bright); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'lnum' 1, 'tnum' 1; letter-spacing: 0.04em; }
.obs-diagram { width: 100%; height: clamp(130px, 20vw, 168px); margin: 8px 0; display: block; }
.obs-meta { display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; align-items: center; padding: 16px 0; border-top: 0.5px solid var(--lo-line); border-bottom: 0.5px solid var(--lo-line); }
.obs-meta .om-cell .om-k { font-size: 10px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--lo-muted); }
.obs-meta .om-cell .om-v { font-family: var(--lo-sans); font-size: 17px; font-weight: 600; color: var(--lo-ivory); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'lnum' 1, 'tnum' 1; letter-spacing: 0.02em; margin-top: 5px; unicode-bidi: isolate; }
.obs-bearing { display: flex; align-items: center; gap: 12px; grid-row: span 2; }
.obs-dial { flex: none; }
.obs-blessing { font-family: var(--lo-display); font-size: clamp(19px, 2.2vw, 26px); line-height: 1.7; color: var(--lo-body); margin-top: 22px; }
html[dir='rtl'] .obs-blessing, .obs-blessing[dir='rtl'] { font-family: var(--lo-display-he); }
.obs-blessing-lang { display: block; margin-top: 12px; font-size: 10px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--lo-faint); }
.obs-dots { display: flex; justify-content: center; gap: 9px; margin-top: 42px; }
.obs-dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--lo-line); transition: background 0.3s var(--ease-organic); }
.obs-dots button[aria-current='true'] { background: var(--lo-gold-bright); }
.obs-samplenote { text-align: center; color: var(--lo-faint); font-size: 12px; line-height: 1.7; max-width: 60ch; margin: 34px auto 0; }
.obs-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--lo-faint); border: 0.5px solid var(--lo-line); border-radius: 999px; padding: 4px 10px; }

/* =========================================================================
   Chapter 06 — CTA: the ignition moment. One act, maximal darkness.
   ========================================================================= */
.ch-cta { text-align: center; padding-top: clamp(110px, 18vh, 220px); padding-bottom: clamp(110px, 18vh, 220px); }
.cta-orbit { margin: 0 auto 34px; color: var(--lo-gold); }
.cta-title { font-family: var(--lo-display); font-weight: 500; color: var(--lo-ivory); font-size: clamp(30px, 4.4vw, 52px); line-height: 1.12; text-wrap: balance; }
.cta-sub { color: var(--lo-muted); font-size: 16px; line-height: 1.75; max-width: 44ch; margin: 18px auto 0; }
/* the one primary act — a fill that "radiates light" (warm→deep gold + inner sheen),
   not a flat SaaS gold. */
.btn-ignite { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-top: 40px; cursor: pointer; border: 0; border-radius: 8px; background: linear-gradient(178deg, #edca6b 0%, var(--lo-gold-bright) 46%, #cba13f 100%); color: #1b160a; font-family: var(--lo-sans); font-size: 15.5px; font-weight: 700; letter-spacing: 0.03em; padding: 17px 44px; transition: box-shadow 0.5s var(--ease-organic), transform 0.4s var(--ease-ignite), filter 0.4s var(--ease-organic); box-shadow: inset 0 1px 0 rgba(255, 247, 224, 0.4), inset 0 -1px 2px rgba(120, 84, 20, 0.35), 0 0 0 0 rgba(227, 184, 79, 0); }
.btn-ignite:hover { filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255, 247, 224, 0.5), 0 0 44px 4px rgba(227, 184, 79, 0.34); }
.btn-ignite::after { content: ''; position: absolute; inset: -2px; border-radius: 10px; border: 0.5px solid var(--lo-gold-bright); opacity: 0; transform: scale(0.9); transition: opacity 0.5s var(--ease-organic), transform 0.6s var(--ease-ignite); pointer-events: none; }
.btn-ignite:hover::after { opacity: 0.6; transform: scale(1.12); }
.btn-ignite:focus-visible { outline: 1px solid var(--lo-ivory); outline-offset: 5px; }
.cta-hint { margin-top: 20px; color: var(--lo-faint); font-size: 12.5px; letter-spacing: 0.03em; }

/* =========================================================================
   Footer — the quiet signature
   ========================================================================= */
.site-footer { border-top: 0.5px solid var(--lo-line); background: var(--lo-canvas); }
.site-footer .sf-inner { max-width: 1060px; margin: 0 auto; padding: 50px 26px 60px; text-align: center; }
.sf-node { display: block; margin: 0 auto 22px; color: var(--lo-gold); }
.sf-sig { color: var(--lo-muted); font-size: 13px; letter-spacing: 0.02em; line-height: 1.8; }
.sf-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; }
.sf-links a, .sf-links button { background: none; border: 0; cursor: pointer; padding: 2px; text-decoration: none; font-family: var(--lo-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--lo-faint); transition: color 0.3s var(--ease-organic); }
.sf-links a:hover, .sf-links button:hover { color: var(--lo-gold-bright); }

/* ---- about / privacy ---- */
.about-page { padding-top: 128px; min-height: 100svh; }
.about-lead { font-family: var(--lo-display); font-size: clamp(22px, 2.6vw, 32px); line-height: 1.5; color: var(--lo-ivory); max-width: 24ch; }
.about-prose { max-width: 60ch; margin: 34px auto 0; text-align: start; }
.about-prose p { color: var(--lo-body); font-size: 16.5px; line-height: 2; margin: 0 0 22px; }
.letter-card { position: relative; max-width: 640px; margin: 58px auto 0; padding: 44px 42px 38px; background: var(--lo-raised); border: 0.5px solid var(--lo-line); border-radius: 12px; text-align: start; }
.letter-card .lc-tag { position: absolute; top: 16px; inset-inline-end: 16px; font-size: 9px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--lo-faint); border: 0.5px solid var(--lo-line); border-radius: 999px; padding: 4px 10px; }
.letter-card .lc-body { font-family: var(--lo-display); font-style: italic; color: var(--lo-body); font-size: 17.5px; line-height: 2; }
.letter-card .lc-sign { margin-top: 28px; font-family: var(--lo-display-he); color: var(--lo-gold-bright); font-size: 20px; letter-spacing: 0.08em; }

/* =========================================================================
   /map — the observatory instrument. Controls recede until needed; the map is the star.
   ========================================================================= */
body.site-map .topbar { top: 66px; padding: 12px 20px; justify-content: center; direction: ltr; background: linear-gradient(180deg, rgba(10, 13, 24, 0.55) 0%, rgba(10, 13, 24, 0) 100%); overflow-x: auto; scrollbar-width: none; }
body.site-map .topbar::-webkit-scrollbar { display: none; }
body.site-map .topbar .brand, body.site-map #navBtns, body.site-map #langDrop { display: none !important; }
body.site-map .modes { background: rgba(14, 19, 34, 0.72); border: 0.5px solid var(--lo-line); backdrop-filter: blur(10px); opacity: 0.72; transition: opacity 0.4s var(--ease-organic); }
body.site-map .modes:hover { opacity: 1; }
body.site-map .modes button.on { background: var(--lo-gold); color: #14213e; }
body.site-map .addr-search { top: 128px; }
body.site-map .count-badge { background: rgba(14, 19, 34, 0.78); border: 0.5px solid var(--lo-line); backdrop-filter: blur(10px); }
body.site-map .count-badge b { color: var(--lo-gold-bright); }
body.site-map .tagline { bottom: 22px; color: var(--lo-muted); font-size: 13px; }
body.site-map .btn.gold.view-toggle { background: transparent; border: 0.5px solid var(--lo-line); color: var(--lo-spark); box-shadow: none; font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; }
body.site-map .btn.gold.view-toggle:hover { border-color: var(--lo-gold); color: var(--lo-gold-bright); filter: none; }
body.site-map .radial-zoom { bottom: 22px; }
/* observation panel over the map (map micro-interaction popups get the LO treatment) */
body.site-map .maplibregl-popup.mdj-popup .maplibregl-popup-content { background: linear-gradient(180deg, #10182c, #0b1120); border: 0.5px solid var(--lo-line); border-top: 2px solid var(--lo-gold); box-shadow: 0 22px 60px rgba(2, 4, 10, 0.7); }

/* =========================================================================
   Motion discipline + responsive
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  #siteRoot { scroll-behavior: auto; }
  .hero-cue .hc-dot { animation: none; opacity: 0.8; }
  #heroCanvas { transition: none; }
}
@media (max-width: 900px) {
  #siteHeader .sh-inner { padding: 0 16px; gap: 10px; }
  .sh-sub { display: none; }
  .sh-name { font-size: 12.5px; letter-spacing: 0.22em; }
  .sh-nav { gap: 14px; }
  .sh-nav a { font-size: 10px; letter-spacing: 0.14em; }
  .sh-login { padding: 7px 12px; font-size: 10px; }
  .ch-signal { grid-template-columns: 1fr; gap: 26px; }
  .ch-signal .cs-art { min-height: 200px; order: -1; }
}
@media (max-width: 560px) {
  #siteHeader .sh-inner { height: 56px; }
  .sh-wordmark { display: none; }
  .sh-actions { gap: 12px; }
  .hero { padding-bottom: clamp(80px, 12vh, 120px); }
  .obs-meta { grid-template-columns: 1fr; gap: 14px; }
  .obs-bearing { grid-row: auto; }
  .letter-card { padding: 32px 22px 28px; }
  body.site-map .topbar { top: 56px; }
  body.site-map .addr-search { top: 116px; width: calc(100vw - 24px); }
}
