/* Hikayra front door. Same family as the quiz: indigo night, saffron lamplight, pomegranate offset shadow,
   Reem Kufi display + Nunito body. Dark by default; light (warm paper day) follows the system setting. */
@font-face { font-family: "Reem Kufi Variable"; src: url(/fonts/reem-kufi-latin-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Nunito Variable"; src: url(/fonts/nunito-latin-wght-normal.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #120d36; --bg-top: #0d0a2c; --text: #fbecd0; --muted: #d6c8e6; --ink: #1b1238;
  --gold: #f6a823; --persimmon: #e5566b; --alarm: #ff8a8a; --good: #8fd14f;
  --panel: #241a55; --line: #0a0720; --accent: #f6a823;
  --btn-bg: #f6a823; --btn-text: #1b1238; --field: #120d36; --field-line: #d6c8e6;
  --d1: #2a1d63; --d2: #3b2a86; --d3: #0a0720; --moon: #fbecd0; --glow: rgba(246,168,35,.24);
  --stars-on: 1;
  --display: "Reem Kufi Variable", Georgia, serif; --body: "Nunito Variable", system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #fbe6c4; --bg-top: #f7d49a; --text: #1b1238; --muted: #4b3a63;
    --panel: #fff6e6; --line: #1b1238; --accent: #a3341f; --alarm: #a3341f; --good: #2d6e12;
    --btn-bg: #a3341f; --btn-text: #fff6e6; --field: #fffdf8; --field-line: #1b1238;
    --d1: #efc88a; --d2: #e0a766; --d3: #b5730c; --moon: #f6a823; --glow: rgba(246,168,35,.35);
    --stars-on: 0;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, var(--bg-top), var(--bg) 70%);
  color: var(--text); font: 500 18px/1.5 var(--body);
  min-height: 100vh; min-height: 100svh; overflow-x: hidden; position: relative;
}
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky::before { /* stars, dark only */
  content: ""; position: absolute; inset: 0; opacity: var(--stars-on);
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fbecd0 50%, transparent 51%), radial-gradient(1px 1px at 70% 12%, #fbecd0 50%, transparent 51%),
    radial-gradient(2px 2px at 85% 60%, #f6a823 50%, transparent 51%), radial-gradient(1px 1px at 40% 80%, #fbecd0 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 45%, #fbecd0 50%, transparent 51%), radial-gradient(1px 1px at 8% 62%, #fbecd0 50%, transparent 51%);
  background-size: 300px 300px; animation: twinkle 6s ease-in-out infinite alternate;
}
.sky::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60vw 50vh at 50% 35%, var(--glow), transparent 70%); }
.moon { position: absolute; top: 5vh; right: 8vw; width: clamp(48px, 7vw, 96px); fill: var(--moon); }
.dunes { position: absolute; left: 0; bottom: 0; width: 100%; height: 44vh; min-height: 200px; }
.d1 { fill: var(--d1); } .d2 { fill: var(--d2); } .d3 { fill: var(--d3); } 
@keyframes twinkle { from { opacity: calc(var(--stars-on) * .55); } to { opacity: var(--stars-on); } }

.stage { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px 22px; gap: 18px; }
.gate {
  position: relative; width: min(100%, 640px); text-align: center;
  background: var(--panel); border: 3px solid var(--line);
  border-radius: 320px 320px 28px 8px; /* the caravanserai arch */
  padding: 84px clamp(20px, 5vw, 56px) 30px;
  box-shadow: 8px 8px 0 var(--persimmon), 8px 8px 0 3px var(--line);
}
.lamp { position: absolute; top: 22px; left: 50%; width: 38px; filter: drop-shadow(0 0 14px var(--glow)); transform: translateX(-50%); }
.lamp .cord { stroke: var(--line); stroke-width: 2; fill: none; }
.lamp-body { fill: var(--gold); stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }
.flame { fill: var(--persimmon); transform-origin: 20px 38px; animation: flicker 2.4s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(.85, 1.08); } }
.kicker { margin: 30px 0 0; font: 700 .8rem/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.wordmark { margin: 10px 0 12px; font: 700 clamp(3.8rem, 14vw, 6.6rem)/1 var(--display); letter-spacing: .02em; color: var(--text); }
.promise { margin: 0 auto 14px; max-width: 24ch; font: 700 clamp(1.25rem, 4vw, 1.6rem)/1.25 var(--display); color: var(--accent); }
.teaser { margin: 0 auto 24px; max-width: 44ch; font-size: 1.05rem; color: var(--muted); }
.signup .row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type=email] {
  flex: 1 1 200px; min-width: 0; min-height: 52px; padding: 0 20px; font: inherit; color: var(--text);
  background: var(--field); border: 2px solid var(--field-line); border-radius: 99px 99px 99px 12px;
}
.signup input::placeholder { color: var(--muted); opacity: .85; }
.signup input:focus-visible, .signup button:focus-visible, .quiz a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.signup button {
  flex: 1 1 auto; min-height: 52px; padding: 0 24px; font: 700 1rem var(--body); cursor: pointer; white-space: nowrap;
  color: var(--btn-text); background: var(--btn-bg); border: 2px solid var(--line); border-radius: 99px 99px 99px 12px;
  box-shadow: 4px 4px 0 var(--line); transition: transform .12s, box-shadow .12s;
}
.signup button:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--line); }
.signup button:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--line); }
.signup button[disabled] { opacity: .7; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ts:empty { display: none; }
.ts { margin-top: 8px; display: flex; justify-content: center; }
.status { min-height: 1.5em; margin: 12px 0 0; font-weight: 700; font-size: .95rem; }
.status.err { color: var(--alarm); }
.fine { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.done { padding: 8px 0 6px; animation: rise .5s ease-out both; }
.done-title { margin: 0 0 8px; font: 700 1.7rem/1.1 var(--display); color: var(--accent); }
.done-text { margin: 0; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.quiz { margin: 0; padding: 8px 16px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 82%, transparent); font-size: .95rem; color: var(--muted); text-align: center; }
.quiz a { color: var(--text); font-weight: 700; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scene { position: fixed; right: 1.5vw; bottom: 0; width: min(46vw, 640px); z-index: -1; fill: var(--d3); overflow: visible; }
.scene .lantern { fill: var(--gold); animation: flicker 2.6s ease-in-out infinite alternate; }
.scene .door { opacity: .9; animation-duration: 4s; }
.scene .cord { stroke: var(--d3); stroke-width: 2; fill: none; }
@keyframes flicker { from { opacity: .75; } to { opacity: 1; } }
@media (max-width: 760px) {
  .scene { position: static; display: block; width: calc(100% + 32px); max-width: none; margin: auto -16px 0; z-index: auto; }
  .stage { padding-bottom: 0; }
  .gate { margin-top: auto; }
  .dunes .d3 { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 17px; }
  .gate { padding-top: 72px; border-radius: 200px 200px 24px 8px; }
  .lamp { top: 18px; }
  .kicker { margin-top: 22px; }
  .signup button { flex-basis: 100%; }
}
@media (max-height: 760px) and (min-width: 700px) { .gate { padding-top: 66px; } .wordmark { font-size: 4.6rem; } .teaser { margin-bottom: 16px; } .kicker { margin-top: 18px; } }
@media (prefers-reduced-motion: reduce) { .sky::before, .flame, .done, .scene .lantern { animation: none; } .signup button { transition: none; } }
