/* HEMA Space Passport — Kurdistan Astronomy Festival 2026 */

:root {
  --bg: #04070e;
  --bg-2: #0a1226;
  --panel: rgba(11, 19, 38, 0.74);
  --panel-solid: #0b1428;
  --line: rgba(160, 180, 225, 0.13);
  --line-2: rgba(160, 180, 225, 0.24);
  --text: #eef2fa;
  --soft: #c6cfe2;
  --muted: #8d9ab8;
  --dim: #5d6a88;
  --gold: #d6b56e;
  --gold-2: #f1dca6;
  --gold-3: #9c7a38;
  --cyan: #74d4ff;
  --ok: #8ff0c2;
  --danger: #ff8a7a;

  --sans: "Space Grotesk", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --radius: 14px;
  --gutter: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left), env(safe-area-inset-right));
  --topbar: 84px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(58, 143, 208, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(214, 181, 110, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
#starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { -webkit-tap-highlight-color: transparent; }
/* no double-tap zoom on buttons and choices */
button, .btn, .opt, a, label, input { touch-action: manipulation; }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--topbar);
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 7, 14, 0.85), rgba(4, 7, 14, 0.35));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; border-radius: 12px; }
.brand:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.brand-mark, .event-mark { width: 52px; height: 52px; display: grid; place-items: center; flex: none; }
.brand-mark svg, .brand-mark img, .event-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark img { filter: drop-shadow(0 4px 14px rgba(58, 143, 208, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; gap: 3px; }
.brand-text strong { font-size: 19px; letter-spacing: 0.26em; font-weight: 700; }
.brand-text small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.event-tag { display: flex; align-items: center; gap: 16px; padding-left: 24px; border-left: 1px solid var(--line-2); }
.event-text { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.event-text strong { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.event-facts { display: flex; gap: 18px; }
.fact { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.ico { width: 15px; height: 15px; flex: none; color: var(--gold); }
@media (max-width: 760px) {
  :root { --topbar: 68px; }
  .event-text, .brand-text small { display: none; }
  .event-tag { padding-left: 0; border-left: 0; }
  .brand-mark, .event-mark { width: 42px; height: 42px; }
}

/* ---------- screens ---------- */
main { position: relative; z-index: 1; }
.screen {
  display: none;
  min-height: calc(100dvh - var(--topbar));
  padding: clamp(24px, 5vh, 56px) var(--gutter) max(56px, calc(env(safe-area-inset-bottom) + 32px));
}
.screen.is-active { display: block; animation: enter .6s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.display {
  margin: 0;
  font-size: clamp(44px, min(8vw, 13vh), 124px); line-height: 0.92; font-weight: 700;
  letter-spacing: -0.01em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 35%, #b9c4dc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.display-accent {
  display: block;
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 45%, var(--cyan) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.display-sm { font-size: clamp(34px, 6vw, 76px); }
.lede { margin: 24px 0 0; font-size: clamp(17px, 1.6vw, 20px); color: var(--soft); line-height: 1.6; }
.gold { color: var(--gold-2); font-weight: 600; letter-spacing: 0.04em; }

.hero-chip {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 26px; padding: 5px 5px 5px 16px;
  border: 1px solid rgba(214, 181, 110, 0.35); border-radius: 999px;
  background: rgba(214, 181, 110, 0.07);
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-2);
}
.hero-chip b { padding: 5px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1a1305; font-weight: 600; }
.hero-chip.is-ok { border-color: rgba(143, 240, 194, 0.4); background: rgba(143, 240, 194, 0.07); color: var(--ok); }
.hero-chip.is-ok b { background: var(--ok); color: #06261a; }

/* ---------- welcome ---------- */
.screen-welcome.is-active { display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hero {
  width: 100%; max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center; gap: clamp(32px, 5vw, 80px);
}
.hero-copy { max-width: 620px; }
.hero-logo {
  display: block; width: clamp(84px, 12vh, 124px); height: auto; margin: 0 0 24px;
  filter: drop-shadow(0 12px 36px rgba(58, 143, 208, 0.4));
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: clamp(28px, 5vh, 44px); }
.hero-steps {
  list-style: none; margin: clamp(32px, 6vh, 52px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  position: relative;
}
/* the line joining the three step icons */
.hero-steps::before {
  content: ""; position: absolute; top: 25px; left: 26px; right: calc(33.33% - 26px); height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(116, 212, 255, 0.6));
  opacity: .55;
}
.hero-steps li { position: relative; display: grid; gap: 4px; align-content: start; }
.step-ico {
  width: 52px; height: 52px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #1b2a52, #0a1226);
  border: 1px solid rgba(214, 181, 110, 0.55);
  box-shadow: 0 0 0 6px rgba(4, 7, 14, 0.9), 0 10px 30px -10px rgba(214, 181, 110, 0.5);
  color: var(--gold-2);
}
.step-ico svg { width: 24px; height: 24px; }
.hero-steps b { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.hero-steps strong { font-size: 17px; font-weight: 600; }
.hero-steps small { font-size: 13.5px; line-height: 1.45; color: var(--muted); }

.hero-visual { position: relative; perspective: 1800px; }
.hero-glow {
  position: absolute; inset: -12% -8%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(58, 143, 208, 0.35), transparent 70%), radial-gradient(closest-side at 70% 70%, rgba(214, 181, 110, 0.18), transparent 70%);
  filter: blur(20px);
}
.specimen {
  transform: rotateY(-14deg) rotateX(6deg) rotateZ(-2deg);
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: rotateY(-14deg) rotateX(6deg) rotateZ(-2deg) translateY(0); }
  50% { transform: rotateY(-10deg) rotateX(4deg) rotateZ(-1deg) translateY(-12px); }
}
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 44px;
  width: 100%; max-width: 1360px; margin: clamp(28px, 4vh, 48px) auto 0; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-meta .fact { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { max-width: 720px; margin: 0 auto; }
  .hero-logo { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-steps { text-align: left; max-width: 640px; margin-left: auto; margin-right: auto; }
  .hero-visual { max-width: 720px; width: 100%; margin: 0 auto; }
  .specimen { animation: none; transform: none; }
}
@media (max-width: 640px) {
  .hero-steps { grid-template-columns: 1fr; gap: 22px; }
  .hero-steps::before { top: 26px; bottom: 26px; left: 26px; right: auto; width: 1px; height: auto; background: linear-gradient(180deg, var(--gold), rgba(116, 212, 255, 0.6)); }
  .hero-steps li { grid-template-columns: 52px 1fr; column-gap: 16px; row-gap: 2px; }
  .step-ico { grid-row: span 3; margin-bottom: 0; }
  .hero-meta { flex-direction: column; align-items: center; }
  .hero-cta .btn-xl { width: 100%; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); text-decoration: none; text-align: center;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: rgba(214, 181, 110, 0.6); background: rgba(214, 181, 110, 0.06); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, input:focus-visible, .opt input:focus-visible + .opt-body { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn-primary {
  border: 0; color: #1a1305; font-weight: 600;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-3));
  box-shadow: 0 10px 40px -10px rgba(214, 181, 110, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover { background: linear-gradient(135deg, #fff0c8, var(--gold-2) 50%, var(--gold)); box-shadow: 0 14px 50px -10px rgba(214, 181, 110, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-xl { min-height: 64px; padding: 0 38px; font-size: clamp(14px, 1.4vw, 16px); }
.btn-lg { min-height: 58px; padding: 0 32px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- panel / forms ---------- */
.panel {
  max-width: 1040px; margin: 0 auto;
  padding: clamp(22px, 4vw, 52px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.progress { list-style: none; margin: 0 0 34px; padding: 0; display: flex; align-items: center; gap: 10px; }
.progress li { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--dim); font-size: 14px; font-weight: 500; }
.progress li:last-child { flex: 0 0 auto; }
.progress li:not(:last-child)::after { content: ""; flex: 1; height: 1px; min-width: 16px; background: var(--line-2); }
.progress i {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-2); font-style: normal; font-family: var(--mono); font-size: 13px;
}
.progress span { white-space: nowrap; }
.progress .is-current { color: var(--text); }
.progress .is-current i { border-color: var(--gold); color: #1a1305; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 0 0 4px rgba(214, 181, 110, 0.15); }
.progress .is-done { color: var(--muted); }
.progress .is-done i { border-color: rgba(143, 240, 194, 0.5); color: var(--ok); }
.progress .is-done::after { background: linear-gradient(90deg, rgba(143, 240, 194, 0.5), rgba(214, 181, 110, 0.5)) !important; }
@media (max-width: 560px) { .progress span { display: none; } .progress { margin-bottom: 26px; } }

.title { margin: 0; font-size: clamp(28px, 3.6vw, 42px); font-weight: 600; letter-spacing: -0.01em; }
.hint { margin: 8px 0 32px; color: var(--muted); font-size: 16px; }

.field-label {
  display: block; margin-bottom: 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.field-label em { font-style: normal; color: var(--dim); letter-spacing: 0.1em; margin-left: 6px; }
.field { display: block; }
.fields { display: grid; gap: 22px; align-content: start; }
.name-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; }
@media (max-width: 900px) { .name-grid { grid-template-columns: 1fr 1fr; } .name-grid .field:last-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .name-grid, .info-grid { grid-template-columns: 1fr; } }
input[type="text"] {
  width: 100%; height: 58px; padding: 0 18px;
  background: rgba(3, 7, 16, 0.6);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 19px; font-weight: 500;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: var(--dim); font-weight: 400; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 181, 110, 0.12); }
.field-error { display: none; margin-top: 8px; color: var(--danger); font-size: 14px; }
.invalid .field-error { display: block; }
.invalid input[type="text"] { border-color: var(--danger); }

.grid-personal { display: grid; grid-template-columns: 260px 1fr; gap: clamp(24px, 4vw, 52px); }
@media (max-width: 720px) { .grid-personal { grid-template-columns: 1fr; } }

/* photo */
.photo-field { display: flex; flex-direction: column; }
.photo-frame {
  position: relative; display: block; aspect-ratio: 3 / 4; width: 100%; max-width: 260px;
  border-radius: 14px; background: linear-gradient(180deg, #111d3c, #070d1e);
  border: 1px solid rgba(214, 181, 110, 0.35);
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.photo-frame:hover { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 181, 110, 0.1); }
.photo-field:focus-within .photo-frame { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(116, 212, 255, 0.5); }
@media (max-width: 720px) { .photo-frame { max-width: 220px; margin: 0 auto; } .photo-field .field-label { text-align: center; } }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; display: block; }
.photo-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.photo-empty svg { width: 72px; height: 72px; }
.corner { position: absolute; width: 20px; height: 20px; border: 2px solid var(--gold-2); }
.corner.tl { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -7px; right: -7px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -7px; left: -7px; border-right: 0; border-top: 0; }
.corner.br { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
.photo-upload-btn { width: 100%; max-width: 260px; margin-top: 18px; min-height: 48px; font-size: 13px; letter-spacing: 0.12em; }
.photo-upload-btn .ico { width: 18px; height: 18px; }
@media (max-width: 720px) { .photo-upload-btn { max-width: 220px; margin-left: auto; margin-right: auto; } }

.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.nav-row .btn-primary { min-width: 220px; }
@media (max-width: 520px) { .nav-row .btn-primary { min-width: 0; flex: 1; } }

/* ---------- identity ---------- */
.block { border: 0; margin: 0 0 38px; padding: 0; min-width: 0; }
.block legend { display: flex; align-items: center; gap: 14px; padding: 0; margin-bottom: 16px; font-size: clamp(18px, 2vw, 22px); font-weight: 600; }
.block-idx {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none;
  border: 1px solid rgba(214, 181, 110, 0.5); border-radius: 8px;
  font-family: var(--mono); font-size: 13px; color: var(--gold);
}
.block.invalid legend { color: var(--danger); }

.dest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .dest-grid { grid-template-columns: repeat(2, 1fr); } }
.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
#mission-options { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .chip-grid, #mission-options { grid-template-columns: repeat(2, 1fr); } }

.opt { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-body {
  position: relative; height: 100%;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: rgba(3, 7, 16, 0.45);
  transition: border-color .2s, background .2s, transform .15s var(--ease), box-shadow .2s;
}
.opt:hover .opt-body { border-color: rgba(214, 181, 110, 0.5); background: rgba(214, 181, 110, 0.04); }
.opt input:checked + .opt-body {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(214, 181, 110, 0.14), rgba(214, 181, 110, 0.04));
  box-shadow: 0 0 0 1px var(--gold), 0 12px 40px -18px rgba(214, 181, 110, 0.7);
}
.opt input:checked + .opt-body::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231a1305' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.opt:active .opt-body { transform: scale(0.985); }

.dest .opt-body { display: flex; flex-direction: column; align-items: center; padding: 12px 10px 16px; text-align: center; }
.dest canvas { width: 104px; height: 104px; transition: transform .4s var(--ease); }
.dest:hover canvas, .dest input:checked + .opt-body canvas { transform: scale(1.06); }
.dest strong { margin-top: 4px; font-size: 18px; font-weight: 600; }
.dest small { margin-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
@media (max-width: 480px) { .dest canvas { width: 84px; height: 84px; } .dest strong { font-size: 16px; } }

.chip .opt-body { display: flex; align-items: center; min-height: 58px; padding: 10px 36px 10px 16px; font-size: 16px; font-weight: 500; line-height: 1.3; }

.callsign-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
@media (max-width: 600px) { .callsign-row { grid-template-columns: 1fr; } }
#f-callsign { font-family: var(--mono); font-size: 22px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-2); }
#f-callsign.pulse { animation: pulse .5s var(--ease); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(214, 181, 110, 0.25); } }

/* ---------- generating ---------- */
.screen-generating.is-active { display: grid; place-items: center; }
.gen-inner { width: min(560px, 100%); text-align: center; }
.gen-inner .title { font-family: var(--mono); font-size: clamp(16px, 2.4vw, 22px); font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; }
.gen-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 36px; }
.gen-ring i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--gold); animation: spin 1.4s linear infinite; }
.gen-ring i:nth-child(2) { inset: 16px; border-top-color: var(--cyan); animation-duration: 2s; animation-direction: reverse; }
.gen-ring i:nth-child(3) { inset: 32px; border-top-color: var(--gold-2); animation-duration: 3s; }
.gen-ring span { position: absolute; inset: 62px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--gold-2), var(--gold-3)); box-shadow: 0 0 30px rgba(214, 181, 110, 0.6); }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-progress { height: 3px; margin: 28px 0 24px; border-radius: 3px; background: var(--line); overflow: hidden; }
.gen-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--cyan)); transition: width .5s var(--ease); }
.gen-log { list-style: none; margin: 0; padding: 0; text-align: left; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--muted); display: grid; gap: 10px; }
.gen-log li { display: flex; justify-content: space-between; gap: 16px; animation: enter .35s var(--ease) both; }
.gen-log li b { flex: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ok); }
.gen-log li:not(.done) b::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
.gen-log li.done b::before { content: "✓"; }

/* ---------- issued ---------- */
.issued-head { text-align: center; max-width: 900px; margin: 0 auto; }
.issued-head .lede { margin-top: 18px; }
.passport-stage {
  position: relative; display: block; width: 100%; max-width: 1120px; margin: clamp(28px, 5vh, 48px) auto 0; padding: 0;
  border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in; perspective: 1600px; border-radius: 2.2%/3.1%;
}
.passport-stage:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.zoom-hint {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: rgba(4, 7, 14, 0.78); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--soft);
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.passport-stage:hover .zoom-hint, .passport-stage:focus-visible .zoom-hint { opacity: 1; transform: none; }
@media (pointer: coarse) {
  .zoom-hint { position: static; margin: 14px auto 0; width: max-content; opacity: 1; transform: none; display: flex; }
}
.passport-canvas {
  display: block; width: 100%; height: auto; border-radius: 2.2%/3.1%;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(214, 181, 110, 0.2), 0 0 80px -20px rgba(116, 212, 255, 0.25);
}
.screen-issued.is-active .passport-canvas { animation: reveal 1.1s var(--ease) both .15s; }
@keyframes reveal { from { opacity: 0; transform: rotateX(18deg) translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
.issued-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
@media (max-width: 600px) { .issued-actions { flex-direction: column; } .issued-actions .btn { width: 100%; } }

/* ---------- full-screen passport viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 50;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(2, 4, 10, 0.94); color: var(--text); overflow: hidden;
}
.viewer[open] { display: block; }
.viewer:not([open]) { display: none; } /* older browsers without <dialog> support */
.viewer::backdrop { background: rgba(2, 4, 10, 0.9); }
.viewer img {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(94vw, 90vh * 1.4286); width: min(94vw, 90dvh * 1.4286); height: auto; max-width: none; max-height: none;
  border-radius: 1.6%/2.3%; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8); cursor: zoom-out;
}
/* portrait phones: turn the passport sideways so it fills the screen (1600×1120 card = 1.4286 : 1) */
@media (orientation: portrait) and (max-width: 820px) {
  .viewer img { width: min(86vh, 92vw * 1.4286); width: min(86dvh, 92vw * 1.4286); transform: translate(-50%, -50%) rotate(90deg); }
}
.viewer-close {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(11, 19, 38, 0.9); color: var(--text); cursor: pointer;
}
.viewer-close svg { width: 22px; height: 22px; }

/* ---------- small phones ---------- */
@media (max-width: 480px) {
  .panel { border-radius: 20px; padding: 22px 16px 24px; }
  .screen { padding-top: 20px; }
  .title { font-size: 26px; }
  .hint { font-size: 15px; margin-bottom: 24px; }
  .hero-chip { font-size: 10.5px; letter-spacing: 0.12em; padding-left: 12px; }
  .lede { font-size: 16px; }
  .btn { padding: 0 20px; letter-spacing: 0.1em; }
  .btn-xl { min-height: 58px; padding: 0 22px; }
  .block legend { font-size: 17px; }
  .chip .opt-body { min-height: 54px; font-size: 15px; padding: 10px 32px 10px 12px; }
  .dest .opt-body { padding: 10px 6px 12px; }
  .dest small { font-size: 10px; letter-spacing: 0.04em; }
  #f-callsign { font-size: 19px; letter-spacing: 0.12em; }
  .nav-row { margin-top: 28px; padding-top: 20px; }
  .nav-row .btn { padding: 0 18px; }
  .gen-log { font-size: 12px; }
  .gen-log li span { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .chip-grid, #mission-options { grid-template-columns: 1fr; }
  .nav-row .btn { font-size: 12px; letter-spacing: 0.06em; padding: 0 14px; white-space: nowrap; }
  .hero-chip b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }

/* ---------- footer ---------- */
.site-footer {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 20px var(--gutter) max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--dim);
}
.footer-admin {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s;
}
.footer-admin:hover { color: var(--gold-2); border-color: var(--gold); }
.footer-admin:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.footer-admin .ico { width: 15px; height: 15px; color: inherit; }
@media (max-width: 480px) { .site-footer { justify-content: center; text-align: center; } }
