/* Home: light and personal, built around the live map. Builds on plate.css tokens. */
body.home-page { background: #F7F8FC; }
.home-hero { position: relative; overflow: hidden; background: radial-gradient(80rem 40rem at 75% 40%, #FFFFFF 0%, #F7F8FC 60%); border-bottom: 1px solid var(--rule); }
.home-hero .stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.home-hero > .wrap { position: relative; pointer-events: none; }
.home-hero > .wrap a { pointer-events: auto; }
.home-head { min-height: min(44rem, 84vh); display: flex; flex-direction: column; justify-content: center; max-width: 30rem; padding-block: 2rem 4rem; }
.home-head h1 { font: 600 clamp(2.8rem, 6.4vw, 5rem)/1 var(--serif); letter-spacing: -.025em; color: var(--ece-navy); margin: 0 0 1rem; }
.home-head .role { font-size: 1.05rem; color: var(--ece-deep); font-weight: 500; margin: 0 0 1.5rem; }
.home-head p { font-size: 1.12rem; color: var(--ink); margin: 0 0 1rem; }

.home section { padding-block: 4rem; }

@media (max-width: 800px) {
  .home-head { min-height: auto; padding-bottom: 60vh; }
}
/* Dark home hero for the morph figure. Overrides the light .home-hero in home.css. */
.home-hero.is-dark { color: #fff; border-bottom: 0;
  background: radial-gradient(56rem 38rem at 74% 46%, #15225C 0%, #0C1440 48%, #070B27 100%); }
.home-hero.is-dark .home-head h1 { color: #fff; }
.home-hero.is-dark .home-head .role { color: #A9BCFF; }
.home-hero.is-dark .home-head p { color: #D6DCF0; }

/* Caption under the figure: which piece of work the shape stands for, and a link to it. */
.morph-caption { position: absolute; z-index: 2; left: 0; top: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; white-space: nowrap; }
.morph-caption a { display: flex; flex-direction: column; align-items: center; gap: .15rem; color: #fff; text-decoration: none;
  transition: opacity .6s ease, transform .6s ease; }
.morph-caption a.is-out { opacity: 0; transform: translateY(6px); }
.morph-caption .kind { font: 600 .85rem var(--sans); color: #F5A878; }
.morph-caption .title { font: 600 1.2rem/1.2 var(--serif); }
.morph-steps { display: flex; gap: .1rem; margin-bottom: .35rem; }
.morph-steps button { background: none; border: 0; padding: .6rem .2rem; cursor: pointer; }
.morph-steps i { display: block; width: 1.6rem; height: 2px; border-radius: 1px; background: rgba(255,255,255,.25); overflow: hidden; }
.morph-steps b { display: block; height: 100%; width: 0; background: var(--ece-orange); }
.morph-steps button[aria-pressed="true"] b { width: calc(var(--p, 1) * 100%); }
.morph-steps button:hover i { background: rgba(255,255,255,.5); }
@media (max-width: 800px) {
  .home-hero.is-dark .home-head { padding-bottom: min(64vh, 30rem); }
}
@media (prefers-reduced-motion: reduce) { .morph-caption a { transition: none; } }
.morph-caption a:hover .title, .morph-caption a:focus-visible .title { text-decoration: underline; text-underline-offset: .25em; }

/* ---------- Journey: the career timeline beside a pinned globe ---------- */
.journey { --j-study: #9DB8FF; --j-academia: #F5A26F; --j-industry: #6FD3BE; --j-muted: #AAB4D8; --j-text: #D6DCF0;
  --gutter: 2.75rem; --rail-x: .6rem;
  position: relative; color: var(--j-text);
  background: linear-gradient(172deg, #151D4B 0%, #121A57 40%, #0B2466 75%, #022E7F 100%);
  padding-block: 5.5rem 2rem; }
.journey [data-kind="study"] { --k: var(--j-study); }
.journey [data-kind="academia"] { --k: var(--j-academia); }
.journey [data-kind="industry"] { --k: var(--j-industry); }

.journey-head { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.journey-head h2 { color: #fff; font: 600 clamp(1.9rem, 3.4vw, 2.7rem)/1.12 var(--serif); letter-spacing: -.012em; margin: 0 0 1rem; max-width: 40rem; }
.journey-head h2::after { content: ""; display: block; width: 4.5rem; height: 4px; background: var(--ece-orange); margin-top: 1.1rem; }
.journey-head p { font: 400 1.1rem/1.7 var(--serif); color: #C6CDE8; margin: 0; max-width: 38rem; }

.journey-grid { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 3.5rem; }

/* The pinned stage: caption, globe, year lanes. */
.journey-stage { order: 2; position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column;
  padding-block: 2rem 1.75rem; }
.journey-view { position: relative; flex: 1; min-height: 0; }
.journey-globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  -webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent); mask-image: radial-gradient(closest-side, #000 82%, transparent); }
.journey-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.journey-labels span { position: absolute; left: 0; top: 0; white-space: nowrap; font: 500 .78rem/1 var(--sans); color: #C9D0EA;
  padding: .3rem .45rem; border-radius: 3px; background: rgba(11,20,82,.55); }
.journey-labels span.is-now { font-weight: 600; font-size: .85rem; color: #fff; background: rgba(11,20,82,.82); border: 1px solid rgba(233,113,50,.75); }
.journey-caption { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; }
.journey-caption > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-kind { font: 600 .72rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--k, var(--j-muted)); }
.jc-place { font: 600 1.7rem/1.15 var(--serif); color: #fff; letter-spacing: -.01em; }
.jc-sub { font-size: .88rem; color: var(--j-muted); }

.journey-lanes { display: grid; grid-template-columns: auto 1fr; gap: .9rem; margin-top: 1rem; }
.lane-names { display: grid; grid-auto-rows: 12px; row-gap: 6px; }
.lane-name { font: 600 .68rem/12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--k); text-align: right; }
.lane-plot { position: relative; height: calc(3 * 12px + 2 * 6px + 1.4rem); }
.lane-plot::before { content: ""; position: absolute; left: 0; right: 0; top: calc(3 * 18px - 6px + .2rem); height: 1px; background: rgba(214,220,240,.18); }
.lane-bar { position: absolute; top: calc(var(--lane) * 18px); height: 12px; border-radius: 2px; background: var(--k); opacity: .22;
  transition: opacity .4s, box-shadow .4s; }
.lane-bar.is-past { opacity: .6; }
.lane-bar.is-current { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.lane-cursor { position: absolute; top: -4px; height: calc(3 * 18px + 2px); width: 2px; margin-left: -1px; background: var(--ece-orange); border-radius: 1px; transition: left .6s cubic-bezier(.3,.7,.2,1); }
.lane-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 1rem; }
.lane-axis span { position: absolute; transform: translateX(-50%); font: 500 .7rem/1 var(--mono); color: var(--j-muted); }

/* The story: a real ordered list of chapters, each an ordered list of stops. */
.journey-story { order: 1; position: relative; padding: 24vh 0 42vh var(--gutter); }
.journey-rail { position: absolute; left: var(--rail-x); width: 2px; margin-left: -1px; background: rgba(214,220,240,.16); border-radius: 1px; }
.journey-fill { display: block; width: 100%; height: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(233,113,50,.35), var(--ece-orange)); }
.journey-chapters, .journey-stops { list-style: none; margin: 0; padding: 0; }
.chapter + .chapter { margin-top: 4.5rem; }
.chapter-head h3 { font: 600 1.6rem/1.2 var(--serif); color: #fff; margin: 0; letter-spacing: -.01em; }
.chapter-head p { margin: .3rem 0 0; font-size: .92rem; color: var(--j-muted); }
.chapter-head .num { display: block; font: 500 .75rem/1 var(--mono); color: var(--ece-orange); margin-bottom: .55rem; letter-spacing: .04em; }
.stop { padding-block: 2.2rem 0; color: var(--j-muted); transition: color .4s; }
.stop-meta { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: 0; }
.stop-meta::before { content: ""; position: absolute; left: calc(var(--rail-x) - var(--gutter)); top: 50%; width: 11px; height: 11px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #1A2461; border: 2px solid rgba(214,220,240,.35); transition: all .4s; }
.stop.is-past .stop-meta::before { background: var(--k); border-color: var(--k); }
.stop.is-current .stop-meta::before { background: var(--k); border-color: #fff; width: 15px; height: 15px; box-shadow: 0 0 0 5px rgba(233,113,50,.25); }
.stop-when { font: 500 .82rem/1 var(--mono); color: var(--j-muted); font-variant-numeric: tabular-nums; }
.tag { font: 600 .68rem/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--k); padding: .3rem .5rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--k) 50%, transparent); background: color-mix(in srgb, var(--k) 10%, transparent); }
.stop h4 { font: 600 1.3rem/1.3 var(--serif); color: #C9D0EA; margin: .6rem 0 .2rem; transition: color .4s; }
.stop-org { margin: 0; font-size: .98rem; }
.stop-note { margin: .35rem 0 0; font-size: .95rem; }
.stop.is-current { color: var(--j-text); }
.stop.is-current h4 { color: #fff; }
.stop.is-current .stop-when { color: #fff; }

@media (max-width: 800px) {
  .journey { padding-top: 4rem; --gutter: 2rem; --rail-x: .45rem; }
  .journey-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .journey-stage { order: 0; z-index: 2; height: 46vh; height: 46svh; margin: 1.5rem -1.5rem 0; padding: .75rem 1.5rem .6rem;
    background: rgba(17,25,80,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(214,220,240,.12); }
  .jc-place { font-size: 1.2rem; }
  .jc-sub { font-size: .8rem; }
  .journey-lanes { margin-top: .4rem; gap: .6rem; }
  .lane-names { grid-auto-rows: 8px; row-gap: 4px; }
  .lane-name { font-size: .58rem; line-height: 8px; }
  .lane-plot { height: calc(3 * 8px + 2 * 4px + 1.2rem); }
  .lane-plot::before { top: calc(3 * 12px - 4px + .15rem); }
  .lane-bar { top: calc(var(--lane) * 12px); height: 8px; }
  .lane-bar.is-current { box-shadow: 0 0 0 1.5px #fff; }
  .lane-cursor { height: calc(3 * 12px + 2px); }
  .lane-axis span { font-size: .62rem; }
  .journey-story { padding: 2.5rem 0 40vh var(--gutter); }
  .chapter-head h3 { font-size: 1.4rem; }
  .stop h4 { font-size: 1.18rem; }
}
@media (prefers-reduced-motion: reduce) {
  .stop, .stop h4, .stop-meta::before, .lane-bar, .lane-cursor { transition: none; }
}

/* About page: a navy banner in the family of the other pages (title left, a live
   three.js figure on the right, drawn by heroes/about.js: one path through the career),
   then the story with an at-a-glance panel on white, then the journey band. */
body.about-page { background: #FFFFFF; }
.about-hero { position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(104deg, var(--ece-navy) 0%, var(--ece-deep) 75%); }
.about-hero .stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Scrim keeps the headline readable should the figure drift towards it. */
.about-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(21,29,75,.9) 0%, rgba(21,29,75,.6) 30%, rgba(21,29,75,0) 46%); }
.about-hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 2rem;
  min-height: min(42rem, 80vh); padding-block: 2rem 3.5rem; }
.about-head { max-width: 30rem; }
.about-head h1 { font: 600 clamp(3.2rem, 7vw, 5.4rem)/1 var(--serif); letter-spacing: -.025em; color: #fff; margin: 0 0 1.5rem; }
.about-head h1::after { content: ""; display: block; width: 5rem; height: 4px; background: var(--ece-orange); margin-top: 1.5rem; }
.about-lede { font: 400 1.25rem/1.6 var(--serif); color: var(--on-navy); margin: 0 0 1.5rem; }
.about-now { font-size: .95rem; line-height: 1.6; color: #AEB7D6; margin: 0; }
.about-now .dot { display: inline-block; vertical-align: .05em; width: .55rem; height: .55rem; margin: 0 .6rem 0 .1rem; border-radius: 50%; background: var(--ece-orange); box-shadow: 0 0 0 4px rgba(233,113,50,.22); }
.about-now strong { color: #fff; font-weight: 600; }

/* The figure. The SVG is the finished figure, shown without scripts or WebGL; once the
   live figure runs, the SVG keeps its box (the live figure is fitted into it) but hides. */
.about-thread { margin: 0; }
.about-thread svg { display: block; width: 100%; height: auto; max-width: 40rem; margin-left: auto; overflow: visible; }
.about-hero.is-live .about-thread svg { visibility: hidden; }
.th-base { stroke: rgba(214,220,240,.35); stroke-width: 1.2; fill: none; }
.th-ticks { stroke: #8FA4F0; stroke-width: 1.4; fill: none; }
.th-drop { stroke: rgba(214,220,240,.32); stroke-width: 1.2; stroke-dasharray: 2 5; stroke-linecap: round; fill: none; }
.th-axis text { font: 500 12px var(--mono); fill: #AEB7D6; text-anchor: middle; }
.th-axis .th-now { fill: #F5A878; }
.th-line { fill: none; stroke: var(--ece-orange); stroke-width: 2.2; stroke-linecap: round; }
.th-start { fill: var(--ece-navy); stroke: var(--ece-orange); stroke-width: 2; }
.th-pen { fill: var(--ece-orange); opacity: 0; }
.st-ring { fill: #0E1646; stroke: rgba(169,188,255,.4); stroke-width: 1.2; }
.st.is-now .st-ring { stroke: rgba(233,113,50,.6); }
.gl path, .gl rect, .gl circle { fill: none; stroke: var(--on-navy); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.gl .gl-fill { fill: rgba(169,188,255,.12); }
.gl .gl-sheet { fill: #0E1646; }
.gl .gl-thin { stroke: #8FA4F0; stroke-width: 1.5; }
.gl .gl-edge { stroke: #8FA4F0; stroke-width: 1; opacity: .7; }
.gl .nd { fill: #0E1646; stroke: #A9BCFF; stroke-width: 1.6; }
.drone path, .drone circle, .drone rect { stroke: var(--ece-orange); }
.drone .rotor circle { fill: rgba(233,113,50,.1); stroke-width: 1.2; stroke-opacity: .6; }
.drone .blade { fill: var(--ece-orange); stroke-width: 1; }
.drone .gl-body { fill: #0E1646; }
.st-name { font: 600 17px var(--serif); fill: #fff; text-anchor: middle; }
.st.is-now .st-name { fill: #F5A878; }
.st-meta { font: 500 11.5px var(--mono); fill: #AEB7D6; text-anchor: middle; }

/* Labels of the live figure: HTML over the canvas, placed by the script. */
.about-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.al-st, .al-yr { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; opacity: 0;
  text-shadow: 0 1px 2px rgba(7,11,39,.9), 0 0 12px rgba(7,11,39,.85); }
.al-st { display: flex; flex-direction: column; align-items: center; text-align: center; }
.al-st[data-side="left"], .al-st[data-side="aboveleft"] { align-items: flex-end; text-align: right; }
.al-when { font: 500 .74rem/1.5 var(--mono); color: #AEB7D6; }
.al-name { font: 600 1.08rem/1.25 var(--serif); color: #fff; }
.al-place { font: 400 .82rem/1.45 var(--sans); color: var(--on-navy); }
.al-st.is-now .al-when, .al-st.is-now .al-name { color: #F5A878; }
.al-yr { font: 500 .74rem var(--mono); color: #AEB7D6; }
.al-yr.is-now { color: #F5A878; }
.al-compact .al-name { font-size: .95rem; }
.al-compact .al-place { display: none; } /* as the SVG does at this width: the story below gives the places */

/* The story and the facts panel. */
.about-main { padding-block: 4.5rem 5.5rem; }
.about-story { padding: 0; }
.about-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 4rem; align-items: start; }
.about-text p { font: 400 1.12rem/1.75 var(--serif); color: var(--ink); margin: 0 0 1.4rem; max-width: 40rem; }
.about-text .about-lead { font: 400 clamp(1.3rem, 2.1vw, 1.55rem)/1.55 var(--serif); color: var(--ece-navy); letter-spacing: -.005em; margin-bottom: 2rem; }
.about-pull { margin: 0 0 2rem; padding: .2rem 0 .2rem 1.4rem; border-left: 3px solid var(--ece-orange); max-width: 34rem; }
.about-text .about-pull p { font: italic 400 clamp(1.35rem, 2.3vw, 1.7rem)/1.4 var(--serif); color: var(--ece-deep); margin: 0; }
/* At a glance: a navy card, like the page banners, beside the story. */
.about-facts { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5.5rem); color: var(--on-navy); border-radius: 18px; padding: 1.6rem 1.6rem 1.5rem;
               background: radial-gradient(120% 80% at 100% 0%, rgba(233,113,50,.14), rgba(233,113,50,0) 55%), linear-gradient(160deg, var(--ece-navy) 0%, var(--ece-deep) 100%);
               box-shadow: 0 24px 48px -28px rgba(12,19,68,.55); }
.af-me { margin: -1.6rem -1.6rem 1.4rem; position: relative; }
.af-me img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 22%; border-radius: 18px 18px 0 0; }
.af-me::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(180deg, rgba(21,29,75,0), rgba(21,29,75,.92)); pointer-events: none; }
.af-me figcaption { position: absolute; left: 1.6rem; right: 1.6rem; bottom: 1.1rem; z-index: 1; }
.af-me strong { display: block; font: 600 1.35rem/1.2 var(--serif); color: #fff; }
.af-me span { display: block; margin-top: .2rem; font-size: .85rem; color: var(--on-navy); }
.about-facts h2 { font: 600 .82rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #F5A878; margin: 0 0 1.1rem; }
.af-stats { list-style: none; margin: 0 0 1.25rem; padding: 0 0 1.25rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; border-bottom: 1px solid rgba(214,220,240,.16); }
.af-stats strong { display: block; font: 600 1.75rem/1 var(--serif); color: #fff; letter-spacing: -.01em; }
.af-stats small { font-size: .9rem; font-weight: 400; color: var(--on-navy); }
.af-stats span { display: block; margin-top: .4rem; font-size: .78rem; line-height: 1.35; color: #AEB7D6; }
.af-rows { margin: 0; display: grid; gap: 1rem; }
.af-rows > div { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); column-gap: .8rem; align-items: start; }
.af-ic { grid-row: span 2; width: 2.1rem; height: 2.1rem; padding: .45rem; box-sizing: border-box; border-radius: 10px; background: rgba(255,255,255,.07); fill: none; stroke: #F5A878; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.af-rows dt { font: 500 .72rem/1.4 var(--mono); color: #AEB7D6; }
.af-rows dd { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--on-navy); }
.af-rows dd strong { display: block; font-weight: 600; color: #fff; }
.af-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; padding-top: 1.25rem; border-top: 1px solid rgba(214,220,240,.16); }
.af-links a { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: 500 .85rem/1 var(--sans); color: #fff; text-decoration: none; padding: .55rem .8rem; border-radius: 999px; border: 1px solid rgba(214,220,240,.28); transition: background .15s, border-color .15s; }
.af-links a:hover { background: rgba(255,255,255,.1); border-color: rgba(214,220,240,.5); }
.af-links .af-mail { flex-basis: 100%; text-align: center; background: var(--ece-orange); border-color: var(--ece-orange); color: var(--ece-navy); overflow-wrap: anywhere; }
.af-links .af-mail:hover { background: #F58A50; border-color: #F58A50; }

@media (max-width: 900px) {
  .about-hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 2.25rem; padding-block: 1.5rem 2.5rem; }
  .about-thread svg { margin-inline: auto; }
  .about-hero.is-live .about-thread { aspect-ratio: 1 / .9; max-height: 34rem; }
  .about-hero::before { background: linear-gradient(180deg, rgba(21,29,75,.7) 0%, rgba(21,29,75,0) 45%); }
  .about-cols { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .about-facts { position: static; max-width: 32rem; }
}
@media (max-width: 600px) {
  .about-lede { font-size: 1.15rem; }
  .st-name { font-size: 22px; }
  .st-meta { display: none; }
  .th-axis text { font-size: 17px; }
  .about-main { padding-block: 2.5rem 4rem; }
  .about-text p { font-size: 1.06rem; }
  .about-facts { position: static; }
}

/* ---------- Home: the band below the hero ----------
   The hero's navy carries on down the page. Teaching (with this term's two courses) spans
   the band; Research and Blog share a row, the Blog tile a sheet of paper; About closes it
   with the route from Amman to London, Ontario. The figures are drawn by heroes/doors.js
   and hidden from assistive technology; every fact is in the text, and without the
   script the figures are simply absent. */
.home .doors { position: relative; isolation: isolate; padding-block: 5.5rem 5rem; color: #C9D0EA;
  background: radial-gradient(56rem 16rem at 74% 0%, #0A1138 0%, rgba(10,17,56,0) 100%),
              linear-gradient(180deg, #070B27 0%, #0A1034 30%, #0E1644 100%); border-bottom: 1px solid rgba(214,220,240,.1); }
/* A faint survey grid, continuing the hero's field of points and fading as the band begins. */
.doors::before { content: ""; position: absolute; inset: 0 0 auto; height: 26rem; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, rgba(169,188,255,.16) 1px, transparent 1.6px); background-size: 24px 24px; background-position: 12px 0;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 7rem, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 7rem, transparent 100%); }

.doors-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem 4rem; align-items: end; margin-bottom: 3rem; }
.doors-head h2 { font: 600 clamp(2.1rem, 3.8vw, 3rem)/1.08 var(--serif); letter-spacing: -.018em; color: #fff; margin: 0; max-width: 15ch; text-wrap: balance; }
.doors-head h2::after { content: ""; display: block; width: 4.5rem; height: 4px; background: var(--ece-orange); margin-top: 1.25rem; }
.doors-head p { font: 400 1.12rem/1.7 var(--serif); color: #C6CDE8; margin: 0; max-width: 34rem; }

.doors-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.25rem; }
.door { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 16px; overflow: hidden; color: #B9C3E6; text-decoration: none;
  background: rgba(255,255,255,.035); border: 1px solid rgba(214,220,240,.13);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), background .3s, border-color .3s, box-shadow .35s; }
a.door:hover { transform: translateY(-3px); background: rgba(255,255,255,.055); border-color: rgba(214,220,240,.3); box-shadow: 0 22px 40px -26px rgba(0,0,0,.8); }
.door-teach { grid-column: 1 / -1; }
.door-research { grid-column: 1 / span 7; }
.door-blog { grid-column: 8 / span 5; }
.door-about { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }

/* Figures are sized by their box, never by the canvas, so a resize cannot feed back. */
.door-fig { display: none; width: 100%; contain: size; }
.doors.is-live .door-fig { display: block; }
.door-research .door-fig, .door-blog .door-fig { height: 15rem; }
.door-about .door-fig { height: 100%; min-height: 10.5rem; }

.door-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem 1.5rem 1.6rem; }
.door-about .door-body { justify-content: center; padding: 1.75rem 1.5rem 1.9rem 1.75rem; }
.door-kind { display: inline-flex; align-items: center; gap: .5rem; font: 600 .9rem/1.4 var(--sans); color: #F5A878; }
.door-kind::after { content: ""; width: .42rem; height: .42rem; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform .25s; }
a.door:hover .door-kind::after, .door-title:hover .door-kind::after, .dcourse:hover .nw::after { transform: translateX(3px) rotate(45deg); }
.door strong { font: 600 1.4rem/1.25 var(--serif); letter-spacing: -.005em; color: #fff; text-wrap: balance; }
.door-note { font-size: .96rem; line-height: 1.6; color: #AEB8DC; }
.door-note em { color: #D6DCF0; }
.doors a:focus-visible { outline: 3px solid var(--ece-orange); outline-offset: 3px; }

/* Teaching: the brighter navy panel of the Teaching page, the lead beside this term's courses. */
.door-teach { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 2rem 2.5rem; padding: 2rem; border: 0; border-radius: 18px; color: #D6DCF0;
  background: radial-gradient(110% 90% at 100% 0%, rgba(59,91,219,.4), rgba(59,91,219,0) 60%),
              linear-gradient(112deg, #151D4B 0%, #0F2266 55%, var(--ece-deep) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 30px 60px -40px rgba(0,0,0,.9); }
.door-lead { display: flex; flex-direction: column; gap: 1.75rem; padding-top: .25rem; }
.door-title { display: flex; flex-direction: column; gap: .6rem; color: #fff; text-decoration: none; border-radius: 4px; }
.door-title strong { font-size: clamp(1.6rem, 2.4vw, 2.05rem); line-height: 1.14; letter-spacing: -.012em; }
.door-title:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.door-tally { list-style: none; margin: auto 0 0; padding: 1.25rem 0 0; border-top: 1px solid rgba(214,220,240,.16); display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; font-size: .88rem; color: #A9B6E0; }
.door-tally li { display: flex; flex-direction: column; gap: .3rem; }
.door-tally strong { font: 600 2.1rem/1 var(--serif); color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.door-now { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.door-term { display: flex; align-items: center; gap: .6rem; margin: 0; font: 600 .9rem/1 var(--sans); color: #A9BCFF; }
.door-pulse { position: relative; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ece-orange); }
.door-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ece-orange); animation: door-pulse 2.4s ease-out infinite; }
@keyframes door-pulse { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
.door-courses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.door-courses li { display: flex; min-width: 0; }
.dcourse { flex: 1; display: flex; flex-direction: column; min-width: 0; border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none;
  background: rgba(8,14,52,.32); border: 1px solid rgba(214,220,240,.16);
  transition: background .3s, border-color .3s, transform .35s cubic-bezier(.2,.7,.2,1); }
.dcourse:hover { background: rgba(8,14,52,.5); border-color: rgba(214,220,240,.38); transform: translateY(-2px); }
.dcourse .door-fig { aspect-ratio: 16 / 9; border-bottom: 1px solid rgba(214,220,240,.12); }
.dcourse-body { display: flex; flex-direction: column; gap: .3rem; padding: .95rem 1.1rem 1.1rem; font-size: .84rem; color: #B9C3E6; }
.dcourse-body code { font: 500 .8rem var(--mono); color: #B9C7F7; white-space: nowrap; }
.dcourse-name { display: block; font: 600 1.18rem/1.28 var(--serif); color: #fff; }
.dcourse-name .nw { white-space: nowrap; }
.dcourse-name .nw::after { content: ""; display: inline-block; margin-left: .5rem; vertical-align: .14em; width: .42rem; height: .42rem; border: solid #F5A878; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform .25s; }

/* Research: the figure runs into the tile. */
.door-research .door-fig { -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent); }

/* Blog: a sheet of paper on the navy, ink on it. */
.door-blog { background: #F6F7FB; border-color: rgba(255,255,255,.6); color: var(--ink-2); }
a.door-blog:hover { background: #fff; border-color: #fff; }
.door-blog .door-kind { color: #B8531D; }
.door-blog strong { color: var(--ece-navy); }
.door-blog .door-note { color: var(--ink-2); }
.door-blog .door-fig { border-bottom: 1px solid #E3E7F1; }

/* About: text, then the route across the rest of the width. */
.door-about .door-fig { border-left: 1px solid rgba(214,220,240,.1); }

/* Entrance, set up by the script only when motion is welcome. */
.doors.will-reveal .door, .doors.will-reveal .doors-head { opacity: 0; transform: translateY(16px); }
.doors.will-reveal .is-seen { opacity: 1; transform: none;
  transition: opacity .7s ease var(--d, 0s), transform .7s cubic-bezier(.2,.7,.2,1) var(--d, 0s), background .3s, border-color .3s, box-shadow .35s; }
.doors.will-reveal a.door.is-seen:hover { transform: translateY(-3px); transition-delay: 0s; }

@media (max-width: 900px) {
  .doors-head { grid-template-columns: minmax(0, 1fr); }
  .door-teach { grid-template-columns: minmax(0, 1fr); }
  .door-research, .door-blog { grid-column: 1 / -1; }
  .door-about { grid-template-columns: minmax(0, 1fr); }
  .door-about .door-fig { order: 2; height: 10rem; min-height: 0; border-left: 0; border-top: 1px solid rgba(214,220,240,.1); }
  .door-lead { gap: 1.1rem; }
}
@media (max-width: 600px) {
  .home .doors { padding-block: 4rem 4.5rem; }
  .doors-head { margin-bottom: 2.25rem; }
  .doors-head p { font-size: 1.05rem; }
  .doors-grid { gap: 1rem; }
  .door-teach { padding: 1.4rem 1.1rem 1.1rem; gap: 1.5rem; }
  .door-courses { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .door-body { padding: 1.1rem 1.2rem 1.35rem; }
  .door strong { font-size: 1.28rem; }
  .door-research .door-fig, .door-blog .door-fig { height: 12rem; }
  .door-about .door-fig { height: 9.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .door, .dcourse, .door-kind::after, .nw::after { transition: none; }
  a.door:hover, .dcourse:hover { transform: none; }
  .door-pulse::after { animation: none; }
}

/* ---------- About: contact ---------- */
.contact { background: var(--paper); padding: 5.5rem 0 6rem; border-top: 1px solid var(--rule); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 4rem; align-items: start; }
.contact-intro h2 { font: 600 clamp(1.9rem, 3.4vw, 2.5rem)/1.12 var(--serif); color: var(--ece-navy); letter-spacing: -.012em; margin: 0 0 1.1rem; }
.contact-intro h2::after { content: ""; display: block; width: 4.5rem; height: 4px; background: var(--ece-orange); margin-top: 1rem; }
.contact-intro > p { font: 400 1.08rem/1.7 var(--serif); color: var(--ink-2); margin: 0 0 1.25rem; max-width: 30rem; }
.contact-intro a { font-family: var(--sans); font-size: .98rem; font-weight: 600; }
.contact-intro .contact-note { display: flex; gap: .75rem; align-items: flex-start; padding: .95rem 1.1rem; border-radius: 12px;
  background: #FDF1E9; border: 1px solid #F6D5BF; font: 400 .95rem/1.55 var(--sans); color: #6B3A1C; max-width: 30rem; }
.contact-note svg { flex: none; width: 1.3rem; height: 1.3rem; margin-top: .1rem; fill: none; stroke: var(--ece-orange); stroke-width: 1.8; stroke-linecap: round; }
.contact-note strong { display: block; color: #4A2410; font-weight: 600; }
.contact-intro .contact-aside { font: 400 .92rem/1.55 var(--sans); color: var(--ink-2); }
.contact-form { display: grid; gap: 1.1rem; background: #fff; border: 1px solid var(--rule); border-radius: 16px; padding: 1.75rem; box-shadow: 0 18px 40px -32px rgba(21,29,75,.45); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.contact-form label { display: grid; gap: .4rem; font: 600 .85rem var(--sans); color: var(--ink); }
.contact-form input, .contact-form select, .contact-form textarea { font: 400 1rem/1.5 var(--sans); color: var(--ink); background: #fff;
  border: 1px solid #C9CFDF; border-radius: 9px; padding: .65rem .8rem; width: 100%; }
.contact-form textarea { resize: vertical; min-height: 9rem; }
.contact-form select { appearance: none; padding-right: 2.2rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23545B77' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .85rem center / .7rem; }
.contact-form :is(input, select, textarea):focus { outline: none; border-color: var(--ece-deep); box-shadow: 0 0 0 3px rgba(2,46,127,.14); }
.cf-human { min-height: 65px; }
.cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-foot { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: .25rem; }
.cf-send { font: 600 .95rem var(--sans); color: #fff; background: var(--ece-navy); border: 0; border-radius: 9px; padding: .75rem 1.35rem; cursor: pointer; }
.cf-send:hover { background: var(--ece-deep); }
.cf-send:disabled { opacity: .55; cursor: not-allowed; }
.cf-privacy { margin: 0; flex: 1 1 14rem; font-size: .8rem; line-height: 1.45; color: var(--ink-2); }
.cf-status { margin: 0; padding: .75rem .95rem; border-radius: 9px; font-size: .92rem; }
.cf-status:empty { padding: 0; }
.cf-status[data-kind="ok"] { background: #E8F5EE; color: #1D5B3A; }
.cf-status[data-kind="bad"] { background: #FCEBEC; color: #8A1F2B; }
@media (max-width: 860px) {
  .contact { padding: 4rem 0; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cf-row { grid-template-columns: 1fr; }
  .contact-form { padding: 1.25rem; }
}
