/* Layout: a winding road of eight stations down the page (two-column grid, node alternating sides), each station page is a four-step checklist.
   Kit identity shared with the passport: navy ink, sun amber, teal, stamp red, warm paper. */
:root {
  --bg: #FFF6E0; --paper: #FFFDF6; --ink: #12355B; --ink-soft: #46617D; --line: rgba(18,53,91,.18);
  --sun: #FFB400; --sun-deep: #E2572B; --teal: #1F8F8F; --stamp: #B8431C; --chip: #F6EBCF; --band: #12355B; --band-ink: #FFF6E0; --road: #F2C25C;
  --f-display: 'Cairo', 'Tajawal', system-ui, sans-serif; --f-body: 'Tajawal', 'Cairo', system-ui, sans-serif;
  --r: 18px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1E31; --paper: #142A43; --ink: #EAF1F8; --ink-soft: #A9BDD2; --line: rgba(234,241,248,.16);
  --sun: #FFC233; --sun-deep: #FF8457; --teal: #3CC2C2; --stamp: #FF8A5C; --chip: #1D3757; --band: #0A1626; --band-ink: #FFF6E0; --road: #8A6A1E; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0E1E31; --paper: #142A43; --ink: #EAF1F8; --ink-soft: #A9BDD2; --line: rgba(234,241,248,.16);
  --sun: #FFC233; --sun-deep: #FF8457; --teal: #3CC2C2; --stamp: #FF8A5C; --chip: #1D3757; --band: #0A1626; --band-ink: #FFF6E0; --road: #8A6A1E; color-scheme: dark }

* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.6; direction: rtl }
a { color: inherit }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.25; text-wrap: balance; margin: 0 }
:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 3px; border-radius: 8px }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.wrap { max-width: 760px; margin: 0 auto }

/* ---------- top band ---------- */
.band { background: var(--band); color: var(--band-ink); padding-block: 18px 22px }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 13.5px; letter-spacing: .02em; opacity: .85; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap }
.brand a { text-decoration: none }
.band h1 { font-weight: 900; font-size: clamp(30px, 7vw, 46px); color: var(--sun); margin-top: 8px }
.band .lead { margin: 4px 0 0; font-size: 17px; opacity: .92; max-width: 60ch }
.suns { display: flex; gap: 6px; margin-top: 14px; align-items: center; flex-wrap: wrap }
.suns i { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed rgba(255,246,224,.45); display: block }
.suns i.on { background: var(--sun); border: 2px solid var(--sun); box-shadow: 0 0 0 3px rgba(255,180,0,.25) }
.suns span { font-family: var(--f-display); font-weight: 800; font-size: 15px; margin-inline-start: 8px; color: var(--sun) }
.cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; background: var(--sun); color: #12355B; font-family: var(--f-display); font-weight: 800; font-size: 17px; text-decoration: none; padding: 10px 18px; border-radius: 999px; box-shadow: 0 4px 0 rgba(0,0,0,.25) }
.cta:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25) }

/* ---------- road ---------- */
.road { padding-block: 26px 10px }
.row { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px }
.row .side { display: flex; flex-direction: column; align-items: center; min-width: 0 }
.row .rd { flex: 1; min-height: 18px; border-inline-start: 6px dashed var(--road); width: 0; margin-inline-start: 6px }
.row.flip .side { order: 2 }
.row.flip .card { order: 1 }
.conn { display: block; width: 100%; height: 54px }
.conn path { fill: none; stroke: var(--road); stroke-width: 6; stroke-dasharray: 12 10; stroke-linecap: round }
.node { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 3px solid var(--line); color: var(--ink-soft); position: relative; text-decoration: none; flex: none; transition: transform .15s }
.node:hover { transform: scale(1.05) }
.node svg { width: 52%; height: 52% }
.node .num { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--band); color: var(--band-ink); font-family: var(--f-display); font-weight: 800; font-size: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--bg) }
.node.visited { border-color: var(--sun); color: var(--ink) }
.node.done { background: var(--teal); border-color: var(--teal); color: #fff }
.node.stamped { background: var(--paper); border: 5px double var(--stamp); color: var(--stamp); transform: rotate(-8deg) }
.node.next { border-color: var(--sun-deep); color: var(--sun-deep); box-shadow: 0 0 0 6px rgba(226,87,43,.18) }
@media (prefers-reduced-motion: no-preference) { .node.next { animation: glow 1.8s ease-in-out infinite } }
@keyframes glow { 50% { box-shadow: 0 0 0 12px rgba(226,87,43,.06) } }
.card { min-width: 0; align-self: start; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-decoration: none; display: block; color: var(--ink) }
.card:hover { border-color: var(--sun) }
.card .eb { font-family: var(--f-display); font-weight: 700; font-size: 12.5px; color: var(--ink-soft); letter-spacing: .02em }
.card h2 { font-size: 18.5px; font-weight: 800; margin: 2px 0 4px }
.card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.45 }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.chip { font-size: 12.5px; font-weight: 700; background: var(--chip); color: var(--ink); border-radius: 999px; padding: 2px 10px; white-space: nowrap }
.chip.sun { background: var(--sun); color: #12355B }
.chip.st-done { background: var(--teal); color: #fff }
.chip.st-stamped { background: var(--stamp); color: #fff }
.chip.st-next { background: var(--sun-deep); color: #fff }
.finish { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-bottom: 8px }
.finish .node { border-style: dashed; color: var(--sun-deep) }
.finish b { font-family: var(--f-display); font-size: 18px }
.finish small { color: var(--ink-soft); font-size: 14px }

/* ---------- footer links ---------- */
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-block: 18px 34px }
.more a { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-decoration: none; min-width: 0 }
.more a:hover { border-color: var(--sun) }
.more b { font-family: var(--f-display); font-size: 16px; display: block }
.more span { font-size: 13.5px; color: var(--ink-soft); display: block; line-height: 1.4 }
@media (max-width: 560px) { .more { grid-template-columns: 1fr } .node { width: 76px; height: 76px } .card h2 { font-size: 16.5px } .card p { font-size: 13.5px } }

/* ---------- station page ---------- */
.topnav { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 14.5px }
.topnav a { text-decoration: none; background: rgba(255,246,224,.12); padding: 4px 12px; border-radius: 999px }
.hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-top: 14px }
.hero .node { width: 96px; height: 96px; background: var(--paper); color: var(--ink) }
.hero .eb { font-family: var(--f-display); font-weight: 700; font-size: 14px; color: var(--sun) }
.hero h1 { color: var(--band-ink); font-size: clamp(26px, 6vw, 40px); margin-top: 0 }
.q { margin: 14px 0 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(18px, 4vw, 22px); color: var(--sun) }
.band .chips .chip { background: rgba(255,246,224,.14); color: var(--band-ink) }
.band .chips .chip.sun { background: var(--sun); color: #12355B }
.steps { list-style: none; margin: 0; padding: 22px 0 6px; display: flex; flex-direction: column; gap: 16px; counter-reset: s }
.step { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; counter-increment: s }
.step > h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800 }
.step > h2::before { content: counter(s); font-size: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--band); color: var(--band-ink); display: grid; place-items: center; flex: none }
.step > h2 small { font-family: var(--f-body); font-weight: 500; font-size: 14.5px; color: var(--ink-soft) }
.step p { margin: 8px 0 0 }
.vid { margin-top: 12px; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; max-width: 100% }
.vid video { width: 100%; height: 100%; display: block }
.soon { margin-top: 10px; padding: 12px 14px; border: 2px dashed var(--line); border-radius: 14px; color: var(--ink-soft); font-size: 15px }
.tries { margin: 10px 0 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px }
.bring { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px }
.bring div { background: var(--chip); border-radius: 12px; padding: 8px 12px; min-width: 0 }
.bring b { font-family: var(--f-display); font-size: 14px; display: block }
.bring span { font-size: 14.5px }
@media (max-width: 520px) { .bring { grid-template-columns: 1fr } }
.note { font-size: 14.5px; color: var(--ink-soft) }
.play { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 12px; background: var(--chip); border-radius: 14px; padding: 12px 14px; text-decoration: none }
.play b { font-family: var(--f-display); font-size: 18px; display: block }
.play span { font-size: 14.5px; color: var(--ink-soft) }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-display); font-weight: 800; font-size: 16px; border: none; border-radius: 999px; padding: 9px 18px; cursor: pointer; text-decoration: none; background: var(--band); color: var(--band-ink) }
.btn.sun { background: var(--sun); color: #12355B }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line) }
.btn.ok { background: var(--teal); color: #fff }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px }
.pager { display: flex; justify-content: space-between; gap: 10px; padding-block: 12px 34px; flex-wrap: wrap }
.pager a { min-width: 0 }

/* ---------- parents / qr ---------- */
.sec { padding-block: 20px 6px }
.sec h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px }
.tbl { overflow-x: auto; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r) }
table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 14.5px }
th, td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top }
th { font-family: var(--f-display); font-size: 13.5px; color: var(--ink-soft); background: var(--chip) }
tr:last-child td { border-bottom: none }
td a { font-weight: 700 }
.code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 26px; font-weight: 700; letter-spacing: .08em; direction: ltr; display: inline-block; background: var(--chip); padding: 4px 14px; border-radius: 12px; font-variant-numeric: tabular-nums }
.field { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px }
.field input { font: 700 18px ui-monospace, Menlo, monospace; direction: ltr; padding: 7px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); width: 13ch; text-transform: uppercase }
.msg { margin-top: 8px; font-size: 15px; font-weight: 700 }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 16px }
.qrs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }
.qr { background: #fff; color: #12355B; border: 2px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; min-width: 0; break-inside: avoid }
.qr .code-img { width: 150px; height: 150px; margin: 6px auto; display: grid; place-items: center }
.qr .code-img img, .qr .code-img canvas { width: 150px !important; height: 150px !important }
.qr b { font-family: var(--f-display); display: block; font-size: 15px }
.qr small { display: block; font-size: 11.5px; direction: ltr; word-break: break-all; color: #46617D }
@media (max-width: 620px) { .qrs { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media print { .band, .noprint { display: none !important } body { background: #fff } .qrs { grid-template-columns: repeat(3, 1fr) } }
