/* ============================================================
   UK Youth AI Literacy Programme — Design System
   ============================================================ */

:root {
  --bg: #0a0b0f;
  --bg-elev: #10121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.055);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --ink: #f4f4f0;
  --ink-dim: #a7abb8;
  --ink-faint: #6b7080;
  --accent: #8ab4ff;
  --accent-2: #c5a3ff;
  --accent-3: #7ee8c7;
  --gold: #e8c87e;
  --grad: linear-gradient(120deg, #8ab4ff 0%, #c5a3ff 50%, #7ee8c7 100%);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(138, 180, 255, 0.35); color: #fff; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- Grain + ambient glow ---------- */
.grain::before {
  content: "";
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.aurora {
  position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
}
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.55;
}
.aurora span:nth-child(1) { width: 560px; height: 560px; background: rgba(90, 120, 255, 0.22); top: -180px; left: -120px; }
.aurora span:nth-child(2) { width: 480px; height: 480px; background: rgba(168, 120, 255, 0.16); top: 60px; right: -140px; }
.aurora span:nth-child(3) { width: 420px; height: 420px; background: rgba(60, 200, 160, 0.12); bottom: -160px; left: 35%; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }

.display {
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.display em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.12; }
.h3 { font-size: 1.35rem; line-height: 1.3; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-dim); max-width: 62ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 11, 15, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--stroke);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: #0a0b0f;
  flex-shrink: 0;
}
.brand small { display: block; font-weight: 400; font-size: 0.68rem; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 0.88rem; color: var(--ink-dim);
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.nav-links a.active { color: var(--ink); background: rgba(255,255,255,0.08); }
.nav-links a.cta {
  color: #0a0b0f; background: var(--ink); font-weight: 600; margin-left: 8px;
}
.nav-links a.cta:hover { background: #fff; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--stroke); border-radius: 10px;
  width: 42px; height: 42px; cursor: pointer; color: var(--ink);
  font-size: 1.1rem; line-height: 1;
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: fixed; top: 74px; left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: rgba(16, 18, 26, 0.97); backdrop-filter: blur(20px);
    border: 1px solid var(--stroke); border-radius: var(--radius);
    padding: 12px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 16px; }
  .nav-links a.cta { margin-left: 0; text-align: center; margin-top: 6px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 190px 0 110px;
  border-bottom: 1px solid var(--stroke);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0 0; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  font-size: 0.8rem; color: var(--ink-dim);
  background: rgba(255,255,255,0.03);
}
.chip b { color: var(--ink); font-weight: 600; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px; border-radius: 999px; font-size: 0.95rem; font-weight: 600;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
  cursor: pointer; border: none; font-family: var(--font-body);
}
.btn-primary { background: var(--ink); color: #0a0b0f; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255,255,255,0.14); background: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--stroke-strong); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); transform: translateY(-2px); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Sections ---------- */
.section { padding: 110px 0; position: relative; }
.section + .section { border-top: 1px solid var(--stroke); }
.section-head { margin-bottom: 64px; display: grid; gap: 18px; max-width: 760px; }

/* ---------- Stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--stroke); border: 1px solid var(--stroke); border-radius: var(--radius);
  overflow: hidden; margin-top: 80px;
}
.stat { background: var(--bg-elev); padding: 30px 26px; }
.stat .num {
  font-family: var(--font-display); font-size: 2.4rem; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .label { font-size: 0.83rem; color: var(--ink-faint); margin-top: 10px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: background 0.35s, border-color 0.35s, transform 0.35s var(--ease);
  position: relative; overflow: hidden;
}
.card:hover { background: var(--bg-card-hover); border-color: var(--stroke-strong); transform: translateY(-3px); }
.card .icon {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 22px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: rgba(138, 180, 255, 0.1);
  border: 1px solid rgba(138, 180, 255, 0.2);
}
.card h3 { margin-bottom: 12px; }
.card p { color: var(--ink-dim); font-size: 0.94rem; }
.card .tag {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 14px; display: block;
}

/* ---------- Day journey (landing) ---------- */
.journey { display: grid; gap: 16px; }
.day-row {
  display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 28px;
  background: var(--bg-card); border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 30px 34px;
  transition: background 0.35s, border-color 0.35s, transform 0.35s var(--ease);
}
.day-row:hover { background: var(--bg-card-hover); border-color: var(--stroke-strong); transform: translateX(6px); }
.day-row .day-num {
  font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--ink-faint);
}
.day-row .day-num strong {
  display: block; font-style: normal; font-size: 2rem; color: var(--ink); line-height: 1.15;
}
.day-row h3 { font-size: 1.3rem; margin-bottom: 6px; }
.day-row p { color: var(--ink-dim); font-size: 0.9rem; max-width: 56ch; }
.day-row .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.day-row .go {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--stroke-strong);
  display: grid; place-items: center; font-size: 1.1rem; color: var(--ink-dim);
  transition: all 0.3s var(--ease); flex-shrink: 0;
}
.day-row:hover .go { background: var(--ink); color: #0a0b0f; border-color: var(--ink); }
.mini-chip {
  font-size: 0.72rem; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--stroke); color: var(--ink-faint);
  font-family: var(--font-mono); letter-spacing: 0.04em;
}
@media (max-width: 780px) {
  .day-row { grid-template-columns: 1fr; gap: 14px; }
  .day-row .go { display: none; }
}

/* ---------- Progress ring ---------- */
.ring { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: var(--stroke-strong); }
.ring .fill { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease); }
.ring .pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 0.62rem; font-family: var(--font-mono); color: var(--ink-dim);
}

/* ---------- Track split ---------- */
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .tracks { grid-template-columns: 1fr; } }
.track-card {
  border-radius: var(--radius); padding: 44px 38px; position: relative; overflow: hidden;
  border: 1px solid var(--stroke);
}
.track-card.t1 { background: linear-gradient(160deg, rgba(138,180,255,0.1), rgba(138,180,255,0.02) 55%); }
.track-card.t2 { background: linear-gradient(160deg, rgba(126,232,199,0.09), rgba(126,232,199,0.02) 55%); }
.track-card h3 { font-size: 1.6rem; margin: 14px 0 14px; }
.track-card p { color: var(--ink-dim); font-size: 0.95rem; }
.track-card ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.track-card li { display: flex; gap: 12px; font-size: 0.92rem; color: var(--ink-dim); }
.track-card li::before { content: "→"; color: var(--accent-3); flex-shrink: 0; }

/* ---------- Partner marquee ---------- */
.partners { display: flex; flex-wrap: wrap; gap: 14px; }
.partner {
  padding: 18px 28px; border-radius: var(--radius-sm); border: 1px solid var(--stroke);
  background: var(--bg-card); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em;
  color: var(--ink-dim); transition: all 0.3s;
}
.partner:hover { color: var(--ink); border-color: var(--stroke-strong); }
.partner span { display: block; font-weight: 400; font-size: 0.72rem; color: var(--ink-faint); margin-top: 3px; }

/* ---------- Page hero (interior) ---------- */
.page-hero { position: relative; padding: 170px 0 70px; border-bottom: 1px solid var(--stroke); }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.06; letter-spacing: -0.02em; margin: 18px 0 20px; }
.page-hero h1 em { font-style: italic; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-hero .meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.progress-banner {
  margin-top: 40px; display: flex; align-items: center; gap: 20px;
  padding: 20px 26px; border-radius: var(--radius-sm);
  border: 1px solid var(--stroke); background: var(--bg-card); max-width: 520px;
}
.progress-banner .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--stroke); overflow: hidden; }
.progress-banner .bar i { display: block; height: 100%; width: 0%; background: var(--grad); border-radius: 99px; transition: width 0.8s var(--ease); }
.progress-banner .count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-dim); white-space: nowrap; }

/* ---------- Activity cards ---------- */
.activities { display: grid; gap: 24px; }
.activity {
  border: 1px solid var(--stroke); border-radius: var(--radius);
  background: var(--bg-card); overflow: hidden;
  transition: border-color 0.35s;
}
.activity.done { border-color: rgba(126, 232, 199, 0.35); }
.activity-head {
  display: flex; align-items: flex-start; gap: 24px; padding: 36px 38px 0;
}
.activity-num {
  font-family: var(--font-display); font-style: italic; font-size: 2.6rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--ink-faint); flex-shrink: 0; margin-top: 2px;
}
.activity.done .activity-num { -webkit-text-stroke: 1px var(--accent-3); }
.activity-head h3 { font-size: 1.45rem; margin-bottom: 8px; }
.activity-head .layer-tag {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-2);
}
.activity-body { padding: 26px 38px 34px; display: grid; gap: 18px; }
@media (min-width: 880px) { .activity-body.cols { grid-template-columns: 1fr 1fr; gap: 20px; } }

.block {
  border-radius: var(--radius-sm); padding: 24px 26px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.02);
}
.block .block-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.block.theory .block-label { color: var(--accent); }
.block.action .block-label { color: var(--accent-3); }
.block p { font-size: 0.92rem; color: var(--ink-dim); }
.block ol, .block ul { margin: 4px 0 0 20px; font-size: 0.92rem; color: var(--ink-dim); display: grid; gap: 8px; }

.activity-foot {
  border-top: 1px solid var(--stroke); padding: 18px 38px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.tool-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.check {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 0.85rem; color: var(--ink-dim); user-select: none;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--stroke-strong);
  transition: all 0.3s;
}
.check input { display: none; }
.check .box {
  width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--ink-faint);
  display: grid; place-items: center; font-size: 0.65rem; color: transparent; transition: all 0.25s;
}
.check:hover { border-color: rgba(255,255,255,0.35); color: var(--ink); }
.check.checked { border-color: rgba(126, 232, 199, 0.5); color: var(--accent-3); background: rgba(126,232,199,0.06); }
.check.checked .box { background: var(--accent-3); border-color: var(--accent-3); color: #0a0b0f; }

/* ---------- Day pager ---------- */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 70px; }
.pager a {
  flex: 1; max-width: 380px; padding: 26px 30px; border-radius: var(--radius);
  border: 1px solid var(--stroke); background: var(--bg-card);
  transition: all 0.3s var(--ease);
}
.pager a:hover { border-color: var(--stroke-strong); background: var(--bg-card-hover); transform: translateY(-3px); }
.pager a.next { text-align: right; margin-left: auto; }
.pager small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.pager .title { display: block; font-family: var(--font-display); font-size: 1.15rem; margin-top: 8px; }

/* ---------- Tables (frameworks) ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--stroke); border-radius: var(--radius); }
table.fw {
  width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 760px;
  background: var(--bg-card);
}
table.fw th {
  text-align: left; padding: 18px 22px; font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  border-bottom: 1px solid var(--stroke-strong); background: rgba(255,255,255,0.03);
  font-weight: 500;
}
table.fw td { padding: 20px 22px; color: var(--ink-dim); border-bottom: 1px solid var(--stroke); vertical-align: top; }
table.fw tr:last-child td { border-bottom: none; }
table.fw td strong { color: var(--ink); font-weight: 600; }
table.fw tr { transition: background 0.25s; }
table.fw tbody tr:hover { background: rgba(255,255,255,0.03); }

.source-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-size: 0.82rem; color: var(--accent); border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.source-link:hover { border-bottom-color: var(--accent); }

/* ---------- Phase timeline (hackathon) ---------- */
.phases { display: grid; gap: 0; position: relative; }
.phase {
  display: grid; grid-template-columns: 72px 1fr; gap: 30px; padding: 40px 0;
  position: relative;
}
.phase + .phase { border-top: 1px dashed var(--stroke); }
.phase-marker {
  width: 56px; height: 56px; border-radius: 18px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-style: italic;
  font-size: 1.35rem; background: var(--grad); color: #0a0b0f;
}
.phase h3 { font-size: 1.5rem; margin-bottom: 10px; }
.phase p { color: var(--ink-dim); max-width: 68ch; }
.phase .tool-pills { margin-top: 18px; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; border-radius: 28px; overflow: hidden;
  padding: 90px 60px; text-align: center;
  border: 1px solid var(--stroke-strong);
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(138,180,255,0.16), transparent),
    radial-gradient(600px 300px at 80% 100%, rgba(126,232,199,0.13), transparent),
    var(--bg-elev);
}
.cta-band h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); margin-bottom: 18px; }
.cta-band p { color: var(--ink-dim); max-width: 54ch; margin: 0 auto 40px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--stroke); padding: 70px 0 50px; margin-top: 110px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
@media (max-width: 780px) { .foot-grid { grid-template-columns: 1fr; } }
footer h4 { font-size: 0.78rem; font-family: var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px; font-weight: 500; }
footer ul { list-style: none; display: grid; gap: 10px; }
footer ul a { color: var(--ink-dim); font-size: 0.9rem; transition: color 0.25s; }
footer ul a:hover { color: var(--ink); }
.foot-brand p { color: var(--ink-faint); font-size: 0.86rem; max-width: 40ch; margin-top: 16px; }
.foot-bottom {
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--stroke);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 0.78rem; color: var(--ink-faint);
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
