/* IM Lab Foundation (IMLF): colours come from the logo. */
:root {
  --navy: #24415E;
  --navy-deep: #1A3048;
  --teal: #287283;
  --orange: #EB7514;
  --white: #FFFFFF;
  --tint: #F3F6F8;
  --line: #DCE3E9;
  --text: #24415E;
  --muted: #4A5B6B;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--white); color: var(--text); font-family: var(--font); font-size: 18px; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--white); padding: 8px 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand img { width: 64px; height: auto; }
.brand-name { font-weight: 700; font-size: 19px; line-height: 1.2; }
.brand-short { font-weight: 600; color: var(--teal); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a, .site-nav .soon { display: block; white-space: nowrap; padding: 8px 10px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--navy); border-radius: 3px; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--orange); }
.site-nav .soon { color: var(--muted); cursor: default; }
.site-nav .soon-cta { margin-left: 6px; border: 1.5px solid var(--line); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 3px; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--navy); }

@media (max-width: 1060px) {
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a, .site-nav .soon { padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav .soon-cta { margin: 0; border: 0; border-bottom: 1px solid var(--line); }
}

/* Hero */
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.6vw, 66px); line-height: 1.06; letter-spacing: -0.02em; color: var(--navy); max-width: 16ch; }
.hero .lede { margin-top: 28px; }
.hero-figure { display: flex; justify-content: center; }
.waves { width: 100%; max-width: 360px; }
.wave { fill: none; stroke-linecap: round; stroke-width: 12; stroke: var(--teal); }
.w2 { stroke: var(--navy); }
.w4 { stroke: var(--orange); stroke-width: 10; }
.play { fill: var(--teal); }

/* The one opening animation: the waves draw in once, then everything stays still. */
@media (prefers-reduced-motion: no-preference) {
  .wave { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.4s cubic-bezier(.22, .61, .36, 1) forwards; }
  .w1 { animation-delay: .15s; }
  .w2 { animation-delay: .35s; }
  .w3 { animation-delay: .55s; }
  .w4 { animation-delay: .75s; }
  .play { opacity: 0; animation: appear .6s ease-out .1s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; justify-content: flex-start; }
  .waves { max-width: 200px; }
}

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.tint { background: var(--tint); }
.section-head { display: grid; grid-template-columns: 4fr 7fr; gap: 40px; align-items: start; margin-bottom: 44px; }
.section-head h2, .two-col h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.01em; color: var(--navy); border-top: 3px solid var(--orange); padding-top: 14px; }
.two-col { display: grid; grid-template-columns: 4fr 7fr; gap: 40px; align-items: start; }
.lede { font-size: 20px; line-height: 1.65; color: var(--muted); max-width: 62ch; }
@media (max-width: 860px) {
  .section-head, .two-col { grid-template-columns: 1fr; gap: 16px; }
}

/* Why IMLF snapshots */
.snapshots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.snapshot { padding: 26px 22px 26px 0; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.snapshot + .snapshot { padding-left: 22px; border-left: 1px solid var(--line); }
.figure { font-size: clamp(28px, 2.6vw, 36px); font-weight: 700; line-height: 1.1; color: var(--navy); letter-spacing: -0.01em; }
.label { font-weight: 600; color: var(--teal); line-height: 1.35; }
.detail { font-size: 15.5px; color: var(--muted); }
.source { margin-top: auto; padding-top: 10px; font-size: 13.5px; color: var(--muted); }
.note { margin-top: 18px; font-size: 14px; color: var(--muted); }
@media (max-width: 1100px) {
  .snapshots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot, .snapshot + .snapshot { padding: 24px 20px 24px 0; border-left: 0; }
  .snapshot:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--line); }
  .snapshot:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .snapshots { grid-template-columns: 1fr; }
  .snapshot:nth-child(2n) { padding-left: 0; border-left: 0; }
}

/* How we learn */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.steps li { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--teal); padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.step-num { font-size: 14px; font-weight: 700; color: var(--orange); }
.step-title { font-size: 19px; font-weight: 700; color: var(--navy); }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* What we are building */
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.areas li { padding: 24px 0; border-top: 1px solid var(--line); }
.areas h3 { font-size: 20px; color: var(--navy); margin-bottom: 6px; }
.areas p { color: var(--muted); }
@media (max-width: 960px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .areas { grid-template-columns: 1fr; } }

/* Initiatives */
.initiatives { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.initiatives li { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 0; border-bottom: 1px solid var(--line); }
.ini-title { font-size: 20px; font-weight: 700; color: var(--navy); }
.ini-meta { display: flex; align-items: center; gap: 12px; }
.ini-note { font-size: 15px; color: var(--muted); }
.status { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 3px; border: 1.5px solid currentColor; color: var(--teal); background: var(--white); white-space: nowrap; }
.status-upcoming, .status-active, .status-starting { color: var(--navy); }
.status-proposed { color: var(--muted); }

/* What's happening: the one emphasised card on the page */
.event { max-width: 760px; background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--orange); border-radius: 4px; box-shadow: 0 10px 30px rgba(36, 65, 94, .08); padding: 28px 32px; display: flex; flex-direction: column; gap: 8px; }
.event-date { font-weight: 700; color: var(--teal); }
.event h3 { font-size: clamp(22px, 2.4vw, 28px); color: var(--navy); line-height: 1.2; }
.event-place { color: var(--muted); }
.event .status { align-self: flex-start; margin-top: 6px; }

/* Footer */
.site-footer { background: var(--navy-deep); color: #D7E1EA; padding: 48px 0; }
.footer-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.footer-name { font-size: 20px; font-weight: 700; color: var(--white); }
.footer-tagline { font-style: italic; margin-top: 4px; }
.footer-copy { font-size: 14px; }

/* ---------- Interactive sections ---------- */
.js [data-hidden] { display: none; }
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* Network map */
.net { display: grid; grid-template-columns: 7fr 5fr; border: 1px solid var(--line); background: var(--white); }
.net-map { display: block; width: 100%; height: auto; border-right: 1px solid var(--line); }
.net-side { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.net-chips { display: none; flex-wrap: wrap; gap: 6px; }
.net-chips button, .filters button, .az-books button { font: inherit; font-size: 15px; font-weight: 600; color: var(--navy); background: var(--white); border: 1.5px solid var(--line); border-radius: 3px; padding: 7px 12px; cursor: pointer; }
.net-chips button[aria-pressed="true"], .filters button[aria-pressed="true"], .az-books button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.net-panel h3 { font-size: 26px; color: var(--navy); margin-bottom: 10px; }
.net-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.net-actions span { font-size: 13px; font-weight: 700; color: var(--teal); border: 1.5px solid var(--teal); border-radius: 3px; padding: 3px 8px; }
.net-links { margin-top: 12px; font-size: 15px; color: var(--muted); }
.net-hint { color: var(--muted); }
.edge { stroke: var(--line); stroke-width: 1.4; fill: none; transition: stroke .2s, opacity .2s; }
.edge.hub { stroke-dasharray: 3 5; }
.edge.lit { stroke: var(--teal); stroke-width: 2.6; }
.net-map.focus .edge:not(.lit) { opacity: .3; }
.node { cursor: pointer; }
.node rect { fill: var(--white); stroke: var(--navy); stroke-width: 1.3; }
.node text { fill: var(--navy); font: 600 15px var(--font); pointer-events: none; }
.node:hover rect { fill: var(--tint); }
.node:focus { outline: none; }
.node:focus-visible rect { stroke: var(--orange); stroke-width: 3; }
.node.sel rect { fill: var(--navy); stroke: var(--navy); }
.node.sel text { fill: var(--white); }
.node.near rect { stroke: var(--teal); stroke-width: 2.4; }
.hub-dot { fill: var(--orange); }
.hub-text { fill: var(--white); font: 800 14px var(--font); }
@media (max-width: 760px) {
  .net { grid-template-columns: 1fr; }
  .net-map { display: none; }
  .net-chips { display: flex; }
}

/* Learning steps */
.steps button { width: 100%; height: 100%; text-align: left; font: inherit; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--teal); padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; color: inherit; }
.steps li { background: none; border: 0; padding: 0; }
.steps button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); border-top-color: var(--orange); }
.steps button[aria-selected="true"] .step-title { color: var(--white); }
.step-panel { margin-top: 8px; background: var(--white); border: 1px solid var(--line); padding: 22px 24px; display: grid; grid-template-columns: 2fr 3fr; gap: 24px; }
.step-meaning { font-size: 21px; font-weight: 700; color: var(--navy); line-height: 1.35; }
.step-example { color: var(--muted); }
@media (max-width: 760px) { .step-panel { grid-template-columns: 1fr; gap: 8px; } }

/* Initiatives filter */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.initiatives li[hidden] { display: none; }

/* A to Z explorer */
.az-books { display: flex; flex-wrap: wrap; gap: 6px; }
.az-letters { display: grid; grid-template-columns: repeat(13, minmax(0, 48px)); gap: 6px; margin-top: 16px; }
.az-letters button { aspect-ratio: 1; font: 700 18px var(--font); color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.az-letters button:hover { border-color: var(--teal); }
.az-letters button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--white); }
.az-card { margin-top: 20px; background: var(--white); border: 1px solid var(--line); padding: 28px; display: grid; grid-template-columns: 120px 1fr; gap: 28px; }
.az-big { font-size: 110px; font-weight: 800; line-height: .85; color: var(--orange); }
.az-card h3 { font-size: 26px; color: var(--navy); line-height: 1.25; }
.az-card dl { margin: 14px 0 0; display: grid; gap: 12px; }
.az-card dt { font-size: 13px; font-weight: 700; color: var(--teal); }
.az-card dd { margin: 2px 0 0; color: var(--text); }
@media (max-width: 760px) {
  .az-letters { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .az-card { grid-template-columns: 1fr; gap: 8px; padding: 22px; }
  .az-big { font-size: 64px; }
}
