/* colours live in tokens.css */
:root {
  --radius: 20px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; font: 400 1rem/1.6 var(--font-body); color: var(--text); background: var(--bg); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.02em; }
:focus-visible { outline: var(--focus-w) solid var(--teal); outline-offset: 3px; border-radius: 8px; }
.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.gold { color: var(--gold); }

/* header */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--bg) 96%, transparent); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 38px; width: auto; display: block; flex: none; }
:root[data-theme="dark"] .brand img { border-radius: 8px; } /* the logo has its own white background: it reads as a light chip on dark */
.brand-text { font: 700 1.25rem/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; }
.brand-text small { display: block; font-size: .62rem; font-weight: 500; letter-spacing: .34em; color: var(--gold); margin-top: 4px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--text-muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav a:not(.btn):hover { color: var(--text); }
.nav-links, .nav-actions { display: contents; } /* wrappers only matter on the home page's grid header */
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 12px; width: 44px; height: 44px; padding: 0; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 4px auto; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 999px; font: 600 1rem/1 var(--font-head); border: 1.5px solid transparent; transition: transform .2s, background .2s, color .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { border-color: var(--text); color: var(--text); background: transparent; }
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-sm { padding: 9px 20px; font-size: .92rem; }
.arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow, .link:hover .arrow, .card:hover .arrow { transform: translateX(5px); }

/* hero */
.hero { position: relative; overflow: hidden; padding: calc(var(--header-h) + 88px) 0 96px; text-align: center; }
.hero::before { /* faint grid, fading out toward the edges */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, var(--mask-solid) 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, var(--mask-solid) 30%, transparent 100%);
}
.hero::after { /* blurred gradient glow */
  content: ""; position: absolute; z-index: -1; left: 50%; top: 40%; width: min(760px, 120vw); height: 420px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 32%, transparent), color-mix(in srgb, var(--teal) 22%, transparent) 60%, transparent);
  filter: blur(70px);
}
.badge { display: inline-block; margin: 0 0 24px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.hero h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); line-height: 1.04; font-weight: 700; }
.sub { max-width: 56ch; margin: 24px auto 36px; color: var(--text-muted); font-size: clamp(1rem, 2vw, 1.2rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* stats */
.stats-wrap { margin-top: -24px; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.stats li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; text-align: center; }
.stats strong { display: block; font: 700 clamp(2.4rem, 6vw, 3.4rem)/1 var(--font-head); color: var(--gold); font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 8px; color: var(--text-muted); font-weight: 500; }

/* sections */
.section { padding-block: 96px 0; }
.section-head { margin-bottom: 40px; max-width: 640px; }
.eyebrow { margin: 0 0 12px; font: 600 .8rem/1 var(--font-head); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
h2 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; font-weight: 700; }
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
[data-courses]:empty { min-height: 204px; } /* one card's height, held while the list loads so the footer doesn't jump */
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.code { align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--teal-tint); color: var(--teal); font: 600 .8rem/1 var(--font-head); letter-spacing: .12em; }
.card h3 { font-size: 1.35rem; line-height: 1.2; margin: 18px 0 8px; font-weight: 600; }
.card p { margin: 0 0 24px; color: var(--text-muted); flex: 1; }
.link { font: 600 .95rem var(--font-head); color: var(--text); }
.link:hover { color: var(--gold); }
.card .link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); } /* whole card clickable */
.all-link { margin: 32px 0 0; text-align: center; }

/* footer */
.site-footer { margin-top: 96px; border-top: 1px solid var(--border); padding-top: 48px; }
.footer-row { display: grid; gap: 28px; }
.blurb { margin: 16px 0 0; color: var(--text-muted); max-width: 44ch; }
.blurb a:hover { color: var(--gold); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 24px; align-content: start; }
.site-footer nav a { color: var(--text-muted); font-weight: 500; }
.site-footer nav a:hover { color: var(--text); }
.copyright { margin-top: 32px; padding-block: 22px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .9rem; }

.nav a[aria-current="page"]:not(.btn) { color: var(--text); }

/* shared: boxes, empty states, page heads */
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
/* empty states: icon tile + title + one line (all pages) */
.empty { text-align: center; padding: 44px 24px; }
.empty-ic { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px; background: var(--gold-tint); color: var(--gold); }
.empty-ic svg { width: 26px; height: 26px; }
.empty h3, .empty .empty-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.empty p { margin: 0 auto; color: var(--text-muted); max-width: 44ch; font-size: .95rem; }
.page { padding-top: calc(var(--header-h) + 56px); }
.page-head { max-width: 640px; margin-bottom: 40px; }
.page-head h1, .auth-card h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; font-weight: 700; }
.lede { margin: 14px 0 0; color: var(--text-muted); font-size: 1.05rem; }

/* sign in */
.auth-wrap { min-height: calc(100vh - 220px); }
.auth-center { display: grid; place-items: center; padding-bottom: 24px; }
.auth-card { width: min(440px, 100%); padding: 32px 28px; }
.auth-card h1 { font-size: 2.2rem; margin-bottom: 24px; }
.field label { display: block; margin-bottom: 8px; font: 600 .9rem var(--font-head); }
.field input { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; }
.field input:focus-visible { outline: var(--focus-w) solid var(--teal); outline-offset: 2px; border-color: var(--teal); }
.field-error { margin: 8px 0 0; color: var(--danger); font-size: .9rem; }
.field-error:empty { display: none; }
.auth-card .btn { width: 100%; margin-top: 20px; }
.note { margin: 16px 0 0; color: var(--text-muted); font-size: .85rem; text-align: center; }

/* scroll reveal */
.fade { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.fade.in { opacity: 1; transform: none; }

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .footer-row { grid-template-columns: 1.5fr 1fr; }
}
@media (max-width: 899px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: color-mix(in srgb, var(--bg) 97%, transparent); border-bottom: 1px solid var(--border); padding: 8px 20px 20px; }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .nav .btn { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}

/* Course list states: coming soon (dimmed, not interactive), locked, enrolled */
.card.is-soon { opacity: .6; }
.card.is-soon:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); }
.card-tags { margin: 8px 0 0 !important; flex: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 !important; flex: 0 !important; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font: 600 .72rem var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.tag.is-ok { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 50%, transparent); }
.tag.is-locked { color: var(--text); }
.tag.is-soon-tag { color: var(--gold-dark, var(--gold)); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.btn-enrol { display: inline-flex; align-items: center; padding: 10px 22px; border-radius: 999px; border: 1.5px solid var(--gold); background: var(--gold); color: var(--on-gold); font: 600 .9rem var(--font-head); cursor: pointer; }
.btn-enrol:hover:not(:disabled) { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-enrol:disabled { opacity: .6; cursor: default; }
