/* School of AI — one stylesheet for every page. */

/* Colours and sizes, set once here. Green and maroon come from the old site. */
:root {
  --ink: #1a1f1b;
  --ink-2: #4a524c;
  --green: #1d4a2f;
  --green-2: #2c6a44;
  --green-tint: #eef3ef;
  --maroon: #6e1a24;
  --gold: #b8862a;
  --line: #d9e0da;
  --bg: #ffffff;
  --navy: #10233f;      /* behind the Mirror game banners */
  --cream: #fff7e6;     /* note boxes */
  --cream-line: #f0dcae;
  --on-dark: #c9d6cc;   /* soft text on the green band */
  --radius: 10px;
  --wrap: 1120px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Hind", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Base text is large (112.5% = 18px by default) so older readers can read it easily.
   A percentage, not px, so a reader's own larger browser text setting still works. */
html { font-size: 112.5%; }
/* Smooth jumps only for people who have not asked their device for less motion. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-2); text-underline-offset: 3px; }
a:hover { color: var(--maroon); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }

/* Keyboard users can jump straight to the content. */
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand b { display: block; font-family: var(--serif); font-size: 1.15rem; }
.brand small { display: block; font-size: .72rem; color: var(--ink-2); letter-spacing: .08em; text-transform: uppercase; margin-top: -2px; }
.mark { width: 40px; height: 40px; border-radius: 9px; background: var(--green); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: .95rem; }

/* Menu: a plain <details> box. Open/close works without JavaScript. */
.menu summary { list-style: none; cursor: pointer; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 500; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { display: flex; flex-direction: column; position: absolute; right: 16px; top: 64px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 230px; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.menu nav a { padding: 10px 12px; text-decoration: none; color: var(--ink); border-radius: 6px; }
.menu nav a:hover, .menu nav a[aria-current] { background: var(--green-tint); color: var(--green); }
.menu nav .btn { margin-top: 6px; text-align: center; color: #fff; }

/* On wide screens the menu is always open and sits in one row. */
@media (min-width: 900px) {
  .menu summary { display: none; }
  .menu nav { display: flex !important; flex-direction: row; align-items: center; position: static; border: 0; box-shadow: none; padding: 0; gap: 2px; min-width: 0; }
  .menu nav .btn { margin: 0 0 0 10px; }
}
@media (max-width: 899px) { .menu:not([open]) nav { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-block; background: var(--green); color: #fff; text-decoration: none; padding: 13px 22px; border-radius: 8px; font-weight: 600; border: 2px solid var(--green); }
.btn:hover { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.btn-line { background: transparent; color: var(--green); }
.btn-line:hover { background: var(--green-tint); color: var(--green); }
.btn-small { padding: 8px 16px; font-size: .92rem; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.tint { background: var(--green-tint); }
.dark { background: var(--green); color: #e9f0ea; }
.dark h2, .dark h3 { color: #fff; }
.dark a { color: #fff; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon); margin-bottom: 10px; }
.dark .eyebrow { color: #f0cf8a; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46em; }
.head { max-width: 760px; margin-bottom: 34px; }

/* ---------- Home hero ---------- */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero-photo { border-radius: 14px; overflow: hidden; position: relative; }
.hero-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 12px; font-size: .82rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.badge { display: inline-flex; gap: 8px; align-items: center; font-size: .85rem; background: var(--green-tint); color: var(--green); padding: 6px 12px; border-radius: 99px; font-weight: 500; margin-bottom: 18px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }

/* Facts row under the hero. */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 44px; }
.facts div { background: #fff; padding: 18px 20px; }
.facts b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--green); line-height: 1.1; }
.facts span { font-size: .88rem; color: var(--ink-2); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .g3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.card p { color: var(--ink-2); }
.card .more { margin-top: auto; font-weight: 600; text-decoration: none; }
.card .more::after { content: " →"; }
.card-img { padding: 0; overflow: hidden; }
.card-img img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card-img .card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.meta li { font-size: .8rem; background: var(--green-tint); color: var(--green); padding: 3px 10px; border-radius: 99px; font-weight: 500; }

/* "Who is it for" rows on the home page. */
.paths { display: grid; gap: 16px; }
.path { display: grid; gap: 6px 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.path h3 { margin: 0; }
.path p { margin: 0; color: var(--ink-2); }
@media (min-width: 800px) { .path { grid-template-columns: 240px 1fr auto; align-items: center; } }

/* ---------- Program detail pages ---------- */
.prog-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: .85rem; margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); }
.split { display: grid; gap: 40px; }
@media (min-width: 900px) { .split { grid-template-columns: 1.6fr 1fr; } }
.aside { background: var(--green-tint); border-radius: var(--radius); padding: 24px; align-self: start; position: sticky; top: 90px; }
.aside dl { margin: 0 0 18px; }
.aside dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.aside dd { margin: 0 0 12px; font-weight: 500; }
.ticks { list-style: none; padding: 0; margin: 0 0 1.2em; columns: 1; }
.ticks li { padding: 6px 0 6px 28px; position: relative; break-inside: avoid; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 6px; border-left: 2px solid var(--green-2); border-bottom: 2px solid var(--green-2); transform: rotate(-45deg); }
@media (min-width: 700px) { .ticks.two { columns: 2; column-gap: 32px; } }
.module { border-top: 1px solid var(--line); padding-top: 18px; margin: 28px 0; }

/* ---------- Media ---------- */
.video { aspect-ratio: 16/9; width: 100%; border: 0; border-radius: var(--radius); background: #000; }
figure { margin: 0; }
figure figcaption { font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.photo { border-radius: var(--radius); overflow: hidden; }

/* ---------- People (heads of institutions) ---------- */
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (min-width: 700px) { .people { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .people { grid-template-columns: repeat(4, 1fr); } }
.person img { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); width: 100%; background: var(--green-tint); }
.person b { display: block; margin-top: 10px; line-height: 1.3; }
.person span { display: block; font-size: .85rem; color: var(--ink-2); line-height: 1.4; }

/* Institutions as a simple text wall. */
.inst { columns: 1; column-gap: 32px; padding: 0; list-style: none; margin: 0; }
.inst li { padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.18); break-inside: avoid; }
.inst li small { display: block; opacity: .75; }
@media (min-width: 700px) { .inst { columns: 2; } }
@media (min-width: 1000px) { .inst { columns: 3; } }

/* Numbered list for the 12 services and 3 steps. */
.steps { counter-reset: n; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps > li { counter-increment: n; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 20px 70px; position: relative; }
.steps > li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 22px; top: 18px; font-family: var(--serif); font-size: 1.2rem; color: var(--gold); font-weight: 600; }
.steps h3 { margin-bottom: .3em; }
.steps p { margin: 0; color: var(--ink-2); }
@media (min-width: 900px) { .steps.g2 { grid-template-columns: repeat(2, 1fr); } }

/* Contact band. */
.contact { display: grid; gap: 16px; }
@media (min-width: 800px) { .contact { grid-template-columns: repeat(3, 1fr); } }
.contact a.card { text-decoration: none; color: var(--ink); }
.contact a.card:hover { border-color: var(--green-2); }
.contact b { font-family: var(--serif); font-size: 1.25rem; display: block; margin-top: 4px; word-break: break-word; }

.quote { font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.35; margin: 0 0 18px; }

.note { background: var(--cream); border: 1px solid var(--cream-line); border-radius: var(--radius); padding: 16px 20px; }

/* ---------- Footer ---------- */
.foot { background: #121a14; color: #c9d3cb; padding: 56px 0 20px; font-size: .92rem; }
.foot a { color: #fff; }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 800px) { .foot-grid { grid-template-columns: 1.4fr 1.2fr 1fr 1fr; } }
.foot-brand { font-family: var(--serif); font-size: 1.3rem; color: #fff; }
.foot-h { text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; color: #8fa596; margin-bottom: 8px; }
.foot .muted { color: #8fa596; }
.foot-base { border-top: 1px solid #2a352d; margin-top: 36px; padding-top: 18px; font-size: .82rem; color: #8fa596; }

/* Printing a program page gives a clean handout. */
@media print { .top, .foot, .aside .btns, .skip { display: none; } section { padding: 20px 0; } }

/* A whole card can be one link: keep normal text colour. */
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--green-2); }

/* Wide game banners: show the whole banner on a dark band, never cut it. */
.card-img img.banner { object-fit: contain; background: var(--navy); }

/* A text tile in place of a picture, for guides that have no image. */
.tile { aspect-ratio: 16/9; background: var(--green); display: flex; flex-wrap: wrap; align-content: center; gap: 8px; padding: 24px; }
.tile span { background: rgba(255,255,255,.12); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: .9rem; }

/* Hero photo: taller crop so the people are bigger. */
.hero-photo img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }

/* A white button for use on the dark green band. */
/* ".dark .btn-light" is needed: the ".dark a" rule (white links) would otherwise win and hide the text. */
.dark .btn-light, .dark .btn-light:hover { background: #fff; color: var(--green); border-color: #fff; }
.dark figcaption { color: var(--on-dark); }
/* Hidden on screen but read by screen readers (keeps the heading order h1 > h2 > h3). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Spacing steps used inside pages (instead of one-off inline values). */
.mt-s { margin-top: 20px; }
.mt-m { margin-top: 32px; }
.mt-l { margin-top: 44px; }
.my-m { margin: 32px 0; }
.self-start { align-self: start; }
.aside.static { position: static; }

/* Links that stand alone (not inside a sentence) get a 44px-tall tap area, for older fingers. */
.more, .go a, .path p:last-child a { display: inline-block; padding: 8px 0; }
details:not(.menu) > summary { padding: 10px 0; cursor: pointer; }

/* YouTube thumbnail that turns into the player on tap. */
a.yt { position: relative; display: block; overflow: hidden; }
a.yt img { width: 100%; height: 100%; object-fit: cover; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); opacity: .9; transition: opacity .2s; }
a.yt:hover .yt-play, a.yt:focus-visible .yt-play { opacity: 1; }
