/* ===== Tzadit Hna — base theme ===== */
:root {
  --bg: #0c0b0a;
  --bg-2: #141210;
  --ink: #efe9dd;
  --ink-2: #b9b1a3;
  --ink-3: #7d766b;
  --gold: #d2a14a;
  --gold-2: #b08a3e;
  --red: #c1272d;
  --green: #2e7d4f;
  --line: rgba(239, 233, 221, 0.09);
  --card: rgba(255, 255, 255, 0.025);
  --serif-ar: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Times New Roman", serif;
  --sans-ar: "Tajawal", "Cairo", "Noto Sans Arabic", system-ui, sans-serif;
  --serif-lat: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans-lat: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --serif: var(--serif-ar);
  --sans: var(--sans-ar);
}
html[data-script="lat"] { --serif: var(--serif-lat); --sans: var(--sans-lat); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
html[dir="rtl"] body { font-size: 18px; }
body.locked { overflow: hidden; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0; }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
html[dir="rtl"] .mono { letter-spacing: 0.08em; font-family: var(--sans); font-size: 12px; }
.gold { color: var(--gold); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; color: var(--ink-3); }
.center { text-align: center; }
.hide { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(to bottom, rgba(12,11,10,0.95), rgba(12,11,10,0.6) 80%, transparent);
  backdrop-filter: blur(6px);
}
.brand { font-family: var(--serif); font-size: 22px; color: var(--ink); letter-spacing: 0.02em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--gold); font-weight: 500; }
.topbar .actions { display: flex; gap: 10px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; background: rgba(255,255,255,0.03);
  color: var(--ink-2); font-family: var(--sans); font-size: 14px;
  cursor: pointer; transition: all .25s ease;
}
.pill:hover { border-color: rgba(210,161,74,0.5); color: var(--ink); text-decoration: none; }
.pill.active { border-color: var(--gold); color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--gold); color: #1a1407; border: 0; border-radius: 999px;
  padding: 14px 28px; font-family: var(--sans); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s;
  box-shadow: 0 8px 30px rgba(210,161,74,0.25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(210,161,74,0.35); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; font-weight: 500; }
.btn.ghost:hover { border-color: rgba(210,161,74,0.5); }

/* ===== Landing ===== */
.landing { position: relative; overflow-x: hidden; }
.landing .stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.landing-grid {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px;
  padding: 60px 0 80px; align-items: center;
}
@media (max-width: 860px) { .landing-grid { grid-template-columns: 1fr; gap: 36px; padding-top: 30px; } }
.eyebrow { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.eyebrow .dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }
.headline { font-size: clamp(40px, 6.2vw, 72px); line-height: 1.12; margin-bottom: 20px; }
.headline em { font-style: italic; color: var(--gold); }
html[dir="rtl"] .headline em { font-style: normal; }
.lead { color: var(--ink-2); font-size: 18px; max-width: 520px; margin-bottom: 34px; }

.form { display: grid; gap: 18px; max-width: 540px; }
.field label { display: block; margin-bottom: 8px; }
.field input, .field select {
  width: 100%; background: rgba(255,255,255,0.035); border: 1px solid var(--line);
  color: var(--ink); border-radius: 12px; padding: 13px 15px; font-size: 16px; font-family: var(--sans);
  outline: none; transition: border-color .2s;
  appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 36px; }
html[dir="rtl"] .field select { background-position: 20px 50%, 15px 50%; }
.field input:focus, .field select:focus { border-color: rgba(210,161,74,0.6); }
.row { display: grid; grid-template-columns: 0.8fr 1.3fr 1fr; gap: 10px; }
.field input[inputmode="numeric"] { text-align: center; font-family: var(--mono); font-size: 17px; letter-spacing: .05em; }
.field input::placeholder { color: var(--ink-3); font-family: var(--sans); letter-spacing: 0; }

/* custom dropdown */
.dd { position: relative; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(255,255,255,0.035); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 13px 15px; font-size: 16px; font-family: var(--sans); cursor: pointer; text-align: start; transition: border-color .2s; }
.dd-btn:hover, .dd.open .dd-btn { border-color: rgba(210,161,74,0.6); }
.dd-btn .ph { color: var(--ink-3); }
.dd-btn .chev { color: var(--ink-3); font-size: 11px; transition: transform .2s; flex: none; }
.dd.open .dd-btn .chev { transform: rotate(180deg); }
.dd-panel { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); z-index: 60; min-width: 100%; width: max-content; max-width: min(92vw, 420px); background: linear-gradient(180deg, #1a1812, #121009); border: 1px solid rgba(210,161,74,0.4); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(0,0,0,0.6); display: none; overflow: hidden; }
.dd.open .dd-panel { display: block; animation: ddin .16s ease; }
@keyframes ddin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-search { width: 100%; background: rgba(255,255,255,0.04); border: 0; border-bottom: 1px solid var(--line); color: var(--ink); padding: 12px 15px; font-size: 15px; font-family: var(--sans); outline: none; }
.dd-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.dd-list::-webkit-scrollbar { width: 8px; } .dd-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }
.dd-item { padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.dd-item .sub { color: var(--ink-3); font-size: 12px; }
.dd-item:hover, .dd-item.hl { background: rgba(210,161,74,0.12); color: var(--ink); }
.dd-item.sel { color: var(--gold); }
.dd-empty { padding: 14px; color: var(--ink-3); font-size: 14px; }
.dd-group { padding: 8px 12px 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .15em; color: var(--gold); text-transform: uppercase; }
html[dir="rtl"] .dd-group { font-family: var(--sans); font-size: 12px; letter-spacing: 0; }
.dd-item .flag { font-size: 15px; margin-inline-end: 6px; }
.dd-loading { padding: 10px 12px; color: var(--ink-3); font-size: 13px; }
.dd.grid .dd-panel { width: 360px; }
.dd.grid .dd-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; max-height: none; }
.dd.grid .dd-item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid transparent; }
.dd.grid .dd-item:hover, .dd.grid .dd-item.hl { border-color: rgba(210,161,74,0.3); }
.dd.grid .dd-item.sel { background: rgba(210,161,74,0.14); border-color: rgba(210,161,74,0.5); }
.dd-item .num, .dd-btn .num { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--gold); margin-inline-end: 8px; }
.dd-btn .num { font-size: 12px; }
.dd.grid .dd-item > span { display: flex; align-items: baseline; gap: 8px; }
@media (max-width: 480px) { .dd.grid .dd-panel { width: min(92vw, 360px); } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--ink-2); padding: 11px 18px; font-family: var(--sans); font-size: 15px; cursor: pointer; }
.seg button.active { background: rgba(210,161,74,0.15); color: var(--gold); }
.form .btn { justify-self: start; margin-top: 6px; }
.form-note { color: var(--ink-3); font-size: 13px; }

/* certificate preview on landing */
.cert-preview { position: relative; perspective: 1200px; }
.paper {
  background: #f1e9d7; color: #2a2419; border-radius: 6px;
  padding: 36px 30px; box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(0,0,0,0.05);
  transform: rotate(-2deg); transition: transform .6s ease;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.012) 0 2px, transparent 2px 4px);
}
.cert-preview:hover .paper { transform: rotate(0deg) translateY(-4px); }
.paper .tape { position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-1deg); width: 90px; height: 24px; background: rgba(255,255,255,0.5); border: 1px solid rgba(0,0,0,0.05); }
.paper .mono { color: #8a7b5c; }
.paper .big { font-family: var(--serif); font-size: 30px; color: #3b3225; margin: 6px 0 14px; }
.paper .line { border-top: 1px dashed rgba(0,0,0,0.15); margin: 14px 0; }
.paper .val { font-family: var(--serif); font-size: 19px; color: #5b4d35; font-style: italic; }
html[dir="rtl"] .paper .val { font-style: normal; }
.paper .stamp { display: inline-block; border: 2px solid var(--red); color: var(--red); border-radius: 6px; padding: 2px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; transform: rotate(-6deg); opacity: .8; }

.samples { position: relative; z-index: 1; padding: 30px 0 80px; }
.samples h3 { font-size: 26px; margin-bottom: 18px; }
.samples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .samples-grid { grid-template-columns: 1fr; } }
.sample {
  display: block; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
  background: var(--card); color: var(--ink); transition: border-color .25s, transform .25s;
}
.sample:hover { border-color: rgba(210,161,74,0.5); transform: translateY(-3px); text-decoration: none; }
.sample .n { font-family: var(--mono); color: var(--gold); font-size: 12px; margin-bottom: 10px; }
.sample .t { font-family: var(--serif); font-size: 22px; margin-bottom: 8px; }

/* ===== Intro overlay ===== */
#intro {
  position: fixed; inset: 0; z-index: 100; background: #050507;
  transition: opacity 1.4s ease;
}
#intro.fading { opacity: 0; pointer-events: none; }
#intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#intro .overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#intro .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.75) 100%); pointer-events: none; }
#intro .caption { margin-top: 34px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; letter-spacing: .25em; text-transform: uppercase; transition: opacity .8s; min-height: 16px; }
html[dir="rtl"] #intro .caption { letter-spacing: .1em; font-family: var(--sans); font-size: 12px; }
#intro .title { margin-top: 22px; font-family: var(--serif); font-size: clamp(34px, 5.4vw, 60px); color: var(--ink); text-align: center; transition: opacity .9s, transform .9s; padding: 0 20px; line-height: 1.2; text-shadow: 0 2px 30px rgba(0,0,0,0.8); }
#intro .sub { margin-top: 10px; color: var(--ink-2); font-size: 16px; transition: opacity .9s; text-align: center; padding: 0 20px; text-shadow: 0 2px 20px rgba(0,0,0,0.8); }
#intro .textout { opacity: 0; transform: translateY(6px); }
#intro .reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; transition: opacity 1.2s ease; padding: 0 20px; pointer-events: none; }
#intro .reveal.on { opacity: 1; pointer-events: auto; }
#intro .reveal .date { font-family: var(--serif); font-size: clamp(34px, 5.6vw, 60px); line-height: 1.15; text-shadow: 0 2px 30px rgba(0,0,0,0.9); }
#intro .reveal .place { margin: 14px 0 26px; }
#intro .reveal .born { font-family: var(--serif); font-size: clamp(38px, 6.6vw, 74px); color: var(--gold); line-height: 1.15; text-shadow: 0 2px 40px rgba(0,0,0,0.9); margin-bottom: 40px; }
#intro .skip { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); pointer-events: auto; transition: opacity .6s; }
#intro .skip.off { opacity: 0; pointer-events: none; }
#intro .ftr { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: .15em; opacity: .6; }

/* ===== Story page ===== */
.story-hero { position: relative; text-align: center; padding: 90px 0 70px; }
.story-hero .brandline { margin-bottom: 26px; }
.story-hero h1 { font-size: clamp(42px, 7vw, 84px); line-height: 1.1; margin: 10px 0 22px; }
.story-hero h1 .name { color: var(--gold); }
.story-hero .when-hero { font-family: var(--serif); font-size: 24px; color: var(--ink-2); }
.story-hero .where { margin-top: 8px; }

section.chapter { padding: 70px 0; border-top: 1px solid var(--line); }
.chapter .kicker { margin-bottom: 12px; }
.chapter h2 { font-size: clamp(30px, 4.4vw, 48px); margin-bottom: 14px; }
.chapter .intro { color: var(--ink-2); font-size: 18px; max-width: 680px; margin-bottom: 30px; }
.chapter .intro b { color: var(--ink); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; background: var(--card); position: relative; overflow: hidden; }
.stat .ico { font-size: 20px; color: var(--gold); margin-bottom: 8px; }
.stat .num { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; color: var(--ink); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
html[dir="rtl"] .stat .num { text-align: right; }
.stat .num.long { font-size: clamp(20px, 1.9vw, 28px); letter-spacing: -0.01em; }
.stat .num.xlong { font-size: clamp(17px, 1.5vw, 22px); letter-spacing: -0.02em; }
.stat .lbl { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.stat .mono { margin-bottom: 8px; display: block; }
.live { font-family: var(--mono); font-size: 22px; color: var(--gold); letter-spacing: .05em; margin: 10px 0 24px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: 20px; padding: 26px; background: var(--card); }
.card h3 { font-size: 24px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--ink-3); font-size: 13px; }
.kv .v { color: var(--ink); font-family: var(--serif); font-size: 20px; text-align: end; }
.weather-big { display: flex; align-items: center; gap: 22px; margin-bottom: 14px; }
.weather-big .emoji { font-size: 64px; line-height: 1; }
.weather-big .temp { font-family: var(--serif); font-size: 56px; line-height: 1; }
.weather-big .desc { color: var(--ink-2); }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.badge.warn { border-color: rgba(210,161,74,0.4); color: var(--gold); }

/* moon */
.moon { width: 120px; height: 120px; border-radius: 50%; background: #1b1a18; position: relative; overflow: hidden; box-shadow: 0 0 40px rgba(239,233,221,0.08), inset 0 0 20px rgba(0,0,0,0.6); flex: none; }
.moon svg { width: 100%; height: 100%; display: block; }
.skyrow { display: flex; gap: 26px; align-items: center; }

/* receipt */
.receipt { background: #f4efe3; color: #2b261d; max-width: 440px; margin: 0 auto; padding: 30px 26px; border-radius: 4px; box-shadow: 0 30px 70px rgba(0,0,0,0.6); font-family: var(--mono); font-size: 13px; position: relative; }
.receipt:before, .receipt:after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background: radial-gradient(circle, transparent 5px, #f4efe3 6px) 0 0 / 14px 14px repeat-x; }
.receipt:before { top: -6px; transform: rotate(180deg); }
.receipt:after { bottom: -6px; }
.receipt .head { text-align: center; font-family: var(--serif); font-size: 22px; letter-spacing: .1em; margin-bottom: 4px; }
.receipt .sub { text-align: center; color: #7a6f5a; font-size: 11px; margin-bottom: 18px; }
.receipt .item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(0,0,0,0.15); }
.receipt .item .nm { font-family: var(--sans); font-size: 14px; }
.receipt .item .pr { white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.receipt .tot span:last-child { direction: ltr; unicode-bidi: isolate; }
.receipt .item .pr .now { color: #a8782a; }
.receipt .tot { display: flex; justify-content: space-between; font-weight: 700; padding: 12px 0 6px; font-size: 14px; }
.receipt .note { color: #7a6f5a; font-size: 11px; text-align: center; margin-top: 14px; font-family: var(--sans); line-height: 1.5; }
.receipt .thanks { text-align: center; letter-spacing: .2em; margin-top: 14px; font-size: 11px; }

/* news */
.news-list { display: grid; gap: 12px; }
.news { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); align-items: start; }
.news .tag { font-family: var(--mono); font-size: 10px; letter-spacing: .15em; color: var(--gold); border: 1px solid rgba(210,161,74,0.35); border-radius: 999px; padding: 4px 10px; white-space: nowrap; margin-top: 3px; }
html[dir="rtl"] .news .tag { font-family: var(--sans); font-size: 12px; letter-spacing: 0; }
.news .tag.world { color: var(--ink-2); border-color: var(--line); }
.news .txt { font-size: 17px; line-height: 1.6; }
.news .txt a { color: var(--ink-2); font-size: 13px; margin-inline-start: 8px; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.person { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--card); }
.person .av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, rgba(210,161,74,0.35), rgba(193,39,45,0.25)); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 22px; color: var(--ink); flex: none; }
.person .nm { font-family: var(--serif); font-size: 19px; }
.person .ds { color: var(--ink-3); font-size: 13px; }

/* lists */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--ink-2); background: var(--card); }
.chip.gold { border-color: rgba(210,161,74,0.4); color: var(--gold); }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 70px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.tl .y { font-family: var(--mono); color: var(--gold); font-size: 13px; padding-top: 4px; }
.tl .t { color: var(--ink); }

/* certificate */
.certificate { background: #f1e9d7; color: #2a2419; border-radius: 6px; padding: 44px 40px; max-width: 620px; margin: 0 auto; box-shadow: 0 30px 80px rgba(0,0,0,0.6); position: relative; background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.012) 0 2px, transparent 2px 4px); }
.certificate .frame { position: absolute; inset: 12px; border: 1px solid rgba(90,70,40,0.35); border-radius: 3px; pointer-events: none; }
.certificate .frame:after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(90,70,40,0.2); }
.certificate .mono { color: #8a7b5c; }
.certificate .cname { font-family: var(--serif); font-size: 44px; color: #3b3225; margin: 10px 0 4px; }
.certificate .cline { border-top: 1px dashed rgba(0,0,0,0.18); margin: 16px 0; }
.certificate .cval { font-family: var(--serif); font-size: 22px; color: #5b4d35; }
.certificate .cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-top: 10px; text-align: start; }
.certificate .cgrid .mono { font-size: 10px; }
.certificate .cstar { position: absolute; bottom: 24px; inset-inline-end: 30px; width: 74px; height: 74px; border: 2px solid var(--red); border-radius: 50%; color: var(--red); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; transform: rotate(-12deg); opacity: .75; text-align: center; line-height: 1.3; }
.cert-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* sources */
.sources { color: var(--ink-3); font-size: 13px; line-height: 1.8; }
footer.site { border-top: 1px solid var(--line); padding: 44px 0 64px; color: var(--ink-3); font-size: 13px; text-align: center; position: relative; z-index: 1; }
footer.site .brand { font-size: 22px; display: inline-block; margin-bottom: 8px; }
footer.site .credit { margin-top: 16px; color: var(--ink-2); font-size: 15px; }
footer.site .credit .who { font-family: var(--serif); font-size: 22px; color: var(--gold); margin-inline-start: 4px; }
footer.site .social { display: flex; justify-content: center; gap: 12px; margin: 16px 0 18px; }
footer.site .social a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; color: var(--ink-2); font-size: 14px; transition: border-color .25s, color .25s, transform .25s; }
footer.site .social a:hover { border-color: rgba(210,161,74,0.6); color: var(--gold); transform: translateY(-2px); text-decoration: none; }
footer.site .social svg { width: 18px; height: 18px; }
footer.site .small + .small { margin-top: 4px; }

.fade-in { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.fade-in.vis { opacity: 1; transform: none; }

/* ===== icons (Lucide) ===== */
.kicker { display: flex; align-items: center; gap: 10px; }
.kicker svg { width: 18px; height: 18px; color: var(--gold); flex: none; filter: drop-shadow(0 0 8px rgba(210,161,74,0.45)); }
.stat .ico svg { width: 24px; height: 24px; color: var(--gold); }
.weather-big .emoji svg { width: 64px; height: 64px; color: var(--gold); animation: float 4.5s ease-in-out infinite; }
.inl svg { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 6px; color: var(--gold); }

/* ===== motion ===== */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes moonglow { 0%, 100% { box-shadow: 0 0 40px rgba(239,233,221,0.08), inset 0 0 20px rgba(0,0,0,0.6); } 50% { box-shadow: 0 0 70px rgba(239,233,221,0.18), inset 0 0 20px rgba(0,0,0,0.6); } }
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-14px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.vis .card, .vis .stat, .vis .news, .vis .person, .vis .chip, .vis .gtile, .vis .tl { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms); }
.vis .receipt { animation: print 1.1s ease-out both; }
.story-hero h1 { animation: rise 1.1s cubic-bezier(.2,.7,.2,1) both; }
.story-hero .when-hero, .story-hero .where, .story-hero .cta-hero { animation: rise 1.1s .25s cubic-bezier(.2,.7,.2,1) both; }
.moon { animation: moonglow 6s ease-in-out infinite; }
.stat .ico { display: inline-flex; }
.vis .stat .ico { animation: pulse 2.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 300ms); }
.news:hover, .person:hover, .gtile:hover { border-color: rgba(210,161,74,0.4); transform: translateY(-2px); transition: transform .25s, border-color .25s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== photos ===== */
.news { grid-template-columns: auto 1fr; }
.news.has-img { grid-template-columns: auto 1fr 88px; }
.news .th { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; background: rgba(255,255,255,0.04); transition: transform .3s; }
.news .th:hover { transform: scale(1.06); }
.person .av { overflow: hidden; position: relative; }
.person .av img { width: 100%; height: 100%; object-fit: cover; }
.portrait { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(210,161,74,0.45); background: rgba(255,255,255,0.04); flex: none; }
.kv .v.has-portrait { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.posters { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 12px; }
.posters a { display: block; text-align: center; color: var(--ink-2); font-size: 12px; max-width: 110px; }
.posters img { height: 130px; width: 92px; object-fit: cover; border-radius: 8px; display: block; margin: 0 auto 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: transform .3s; }
.posters img:hover { transform: translateY(-4px) scale(1.03); }
.artwork { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,0.5); float: inline-end; margin-inline-start: 14px; }
.hero-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 18px; margin-top: 22px; border: 1px solid var(--line); }

/* ===== legend ===== */
.legend { max-width: 760px; margin: 0 auto; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.7; }
.legend .lg-line { margin: 0 0 14px; opacity: 0; transform: translateY(8px); transition: opacity .6s, transform .6s; min-height: 1em; color: var(--ink); }
.legend .lg-line.on { opacity: 1; transform: none; }
.legend .lg-born { color: var(--gold); font-size: 1.35em; margin: 22px 0; }

/* ===== main CTA ===== */
.cta-hero { margin-top: 34px; display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.cta-hero .btn { font-size: 19px; padding: 18px 36px; animation: pulse 3s ease-in-out infinite; }
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; justify-content: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(12,11,10,0.98), rgba(12,11,10,0.85)); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .4s ease; }
.cta-bar.on { transform: none; }
.cta-bar .btn { padding: 12px 24px; font-size: 15px; }

/* ===== video studio ===== */
#studio { position: fixed; inset: 0; z-index: 250; background: rgba(5,5,7,0.92); display: none; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(6px); }
#studio.on { display: flex; }
.studio-box { position: relative; width: min(96vw, 980px); max-height: 94vh; overflow: auto; border: 1px solid rgba(210,161,74,0.35); border-radius: 22px; background: #121009; padding: 22px 24px 20px; display: grid; grid-template-columns: auto 1fr; gap: 10px 26px; align-items: start; }
.studio-box .x { position: absolute; top: 14px; inset-inline-end: 16px; }
.studio-box .mono { grid-column: 1 / -1; }
.studio-box h3 { grid-column: 1 / -1; font-size: 28px; margin: 0 0 6px; }
.studio-stage { width: min(42vh, 330px); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
.studio-stage canvas, .studio-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.studio-bar { align-self: center; }
.studio-bar .prog { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 10px; }
.studio-bar .prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .25s linear; }
.studio-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
@media (max-width: 720px) { .studio-box { grid-template-columns: 1fr; justify-items: center; } .studio-stage { width: min(80vw, 300px); } }

/* ===== symbol tiles (zodiac, birthstone, Chinese year, weekday) ===== */
.sym-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 960px) { .sym-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sym-grid { grid-template-columns: 1fr; } }
.sym { border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px 20px; background: var(--card); text-align: center; position: relative; overflow: hidden; }
.sym .pic { width: 124px; height: 124px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 62px; background: radial-gradient(circle at 35% 30%, rgba(210,161,74,0.28), rgba(255,255,255,0.03) 70%); border: 1px solid rgba(210,161,74,0.35); overflow: hidden; position: relative; box-shadow: 0 16px 40px rgba(0,0,0,0.45); }
.sym .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sym .pic .glyph { position: relative; z-index: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6)); }
.sym .pic.has-img .glyph { position: absolute; bottom: 6px; inset-inline-end: 8px; font-size: 22px; z-index: 2; }
.sym .nm { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.sym .mean { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.sym .mono { display: block; margin-bottom: 10px; }
.sym .sub { color: var(--ink-3); font-size: 12px; margin-top: 8px; }

/* ===== purchasing-power KPI ===== */
.kpi { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; border: 1px solid rgba(210,161,74,0.35); border-radius: 20px; padding: 26px 28px; background: linear-gradient(135deg, rgba(210,161,74,0.10), rgba(255,255,255,0.02)); max-width: 760px; margin: 0 auto 26px; }
.kpi .side { text-align: center; }
.kpi .big { font-family: var(--serif); font-size: clamp(30px, 4vw, 48px); line-height: 1.05; color: var(--ink); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.kpi .big.gold { color: var(--gold); }
.kpi .arrow { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--gold); }
.kpi .arrow svg { width: 34px; height: 34px; }
html[dir="rtl"] .kpi .arrow svg { transform: scaleX(-1); }
.kpi .mult { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--gold); white-space: nowrap; }
.kpi .foot { grid-column: 1 / -1; text-align: center; color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 560px) { .kpi { grid-template-columns: 1fr; } .kpi .arrow svg { transform: rotate(90deg); } html[dir="rtl"] .kpi .arrow svg { transform: rotate(90deg); } }

/* ===== two receipts side by side ===== */
.receipts { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .receipts { grid-template-columns: 1fr; } }
.receipts .receipt { margin: 0 auto; }
.receipt.world { background: #e7ecf3; color: #1f2733; }
.receipt.world:before, .receipt.world:after { background: radial-gradient(circle, transparent 5px, #e7ecf3 6px) 0 0 / 14px 14px repeat-x; }
.receipt.world .item { border-bottom-color: rgba(0,0,0,0.12); }
.receipt.world .item .pr .now { color: #1f6fb2; }
.receipt .item .eur { display: block; font-size: 11px; color: #6f7a88; direction: ltr; text-align: inherit; }
html[dir="rtl"] .receipt .item .eur { text-align: left; }
.receipt .item .sub { display: block; font-size: 11px; color: #7a6f5a; font-family: var(--sans); }

/* ===== news date chips ===== */
.when { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--gold); border: 1px solid rgba(210,161,74,0.3); border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; direction: ltr; }
html[dir="rtl"] .when { font-family: var(--sans); font-size: 12px; direction: rtl; }
.when.before { color: var(--ink-2); border-color: var(--line); }
.when .d { font-weight: 600; }
.when .sep { opacity: .5; }

/* ===== lightbox ===== */
.clickable { cursor: zoom-in; }
#lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(5,5,7,0.9); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 24px; backdrop-filter: blur(6px); }
#lightbox.on { display: flex; }
#lightbox img { max-width: 92vw; max-height: 72vh; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,0.8); animation: rise .35s ease both; background: #111; transition: opacity .35s; }
#lightbox.loading img { opacity: 0; position: absolute; }
#lightbox .spin { display: none; flex-direction: column; align-items: center; gap: 14px; color: var(--ink-2); font-size: 14px; }
#lightbox.loading .spin { display: flex; }
#lightbox .spin i { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(210,161,74,0.2); border-top-color: var(--gold); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* page images: soft shimmer until the bytes arrive */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
img.ph { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
img.ph.ld { animation: none; background: none; }
#lightbox .cap { margin-top: 16px; text-align: center; max-width: 720px; }
#lightbox .cap .nm { font-family: var(--serif); font-size: 26px; }
#lightbox .cap .ds { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
#lightbox .cap .pill { margin-top: 12px; }
#lightbox .x { position: absolute; top: 18px; inset-inline-end: 22px; }

/* ===== NASA picture ===== */
.apod { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .apod { grid-template-columns: 1fr; } }
.apod img { width: 100%; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.6); display: block; }
.apod .expl { color: var(--ink-2); font-size: 15px; line-height: 1.7; direction: ltr; text-align: left; font-family: var(--sans-lat); max-height: 320px; overflow: auto; padding-inline-end: 6px; }
.apod h3 { font-size: 26px; margin-bottom: 8px; }

/* ===== astrology wheel ===== */
.wheel { display: flex; justify-content: center; }
.wheel svg { width: 100%; max-width: 440px; height: auto; }
.wheel .sg { fill: rgba(239,233,221,0.55); font-size: 14px; font-family: var(--sans); }
.wheel .sgl { fill: rgba(239,233,221,0.35); font-size: 8px; font-family: var(--sans); }
.wheel .pb { fill: var(--gold); }
.wheel .pn { fill: #e9e2d2; }
.wheel .pt { font-size: 10px; font-family: var(--mono); fill: #0c0b0a; font-weight: 700; }
.wheel-legend { display: flex; gap: 18px; justify-content: center; margin-top: 10px; color: var(--ink-2); font-size: 13px; }
.wheel-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.astro-table .kv .v { font-size: 17px; }
.astro-table .mv { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ===== map ===== */
#map { height: 420px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #0c0b0a; }
.map-layers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.leaflet-container { font-family: var(--sans); }
.leaflet-control-attribution { background: rgba(12,11,10,0.75) !important; color: var(--ink-3) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--gold) !important; }
.leaflet-bar a { background: #16140f !important; color: var(--ink) !important; border-bottom-color: var(--line) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #16140f; color: var(--ink); }
.marker-pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(210,161,74,0.35); animation: ring 2.2s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(210,161,74,0.6); } 100% { box-shadow: 0 0 0 26px rgba(210,161,74,0); } }

/* ===== global prices ===== */
.gtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 760px) { .gtiles { grid-template-columns: 1fr; } }
.gtile { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--card); }
.gtile .ico svg { width: 26px; height: 26px; color: var(--gold); }
.gtile .big { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin-top: 8px; }
.gtile .now { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.gtable { width: 100%; border-collapse: collapse; }
.gtable th { text-align: start; color: var(--ink-3); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.gtable td { padding: 10px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 19px; }
.gtable td:first-child { font-family: var(--sans); font-size: 15px; color: var(--ink-2); }
.gtable td.n { direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }
.bm { display: flex; align-items: center; gap: 10px; }
.bm .bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }

@media print {
  body { background: #fff; color: #000; }
  .topbar, #intro, section.chapter:not(.print-me), footer.site, .cert-actions, .story-hero { display: none !important; }
  .certificate { box-shadow: none; margin: 0 auto; }
}
@media (max-width: 640px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row .field:last-child { grid-column: 1 / -1; }
  .skyrow { flex-direction: column; align-items: flex-start; }
  .weather-big .temp { font-size: 44px; }
}
