/* Layout: one 860px reading column. Hero sits on a faint point-cloud grid with registration marks
   (a nod to 3D laser scanning); everything below is quiet type on the same navy/green system as the project pages. */
:root {
  --bg: #F3F6FA;
  --panel: #FFFFFF;
  --ink: #0B1324;
  --muted: #536079;
  --line: #D6DEE9;
  --green: #148A4E;
  --dot: rgba(11, 19, 36, 0.13);
  --font-display: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1324; --panel: #121D33; --ink: #E6EDF7; --muted: #8A96AB; --line: #1F2A40;
    --green: #3DDC84; --dot: rgba(230, 237, 247, 0.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1324; --panel: #121D33; --ink: #E6EDF7; --muted: #8A96AB; --line: #1F2A40;
  --green: #3DDC84; --dot: rgba(230, 237, 247, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 18px; line-height: 1.6;
  padding-inline: 20px;
}
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
img, video { max-width: 100%; }

.wrap { max-width: 860px; margin: 0 auto; }

.label {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}

/* hero */
.hero {
  position: relative; margin-inline: -20px; padding: 96px 20px 72px;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px);
  background-size: 24px 24px; background-position: center;
  border-bottom: 1px solid var(--line);
}
.hero .wrap { position: relative; display: flex; flex-direction: column; gap: 18px; }
.reg { position: absolute; width: 22px; height: 22px; color: var(--muted); }
.reg::before, .reg::after { content: ""; position: absolute; background: currentColor; }
.reg::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.reg::after { top: 50%; left: 0; right: 0; height: 1px; }
.reg.tl { top: 24px; left: 24px; } .reg.tr { top: 24px; right: 24px; }
.reg.bl { bottom: 24px; left: 24px; } .reg.br { bottom: 24px; right: 24px; }
h1 {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -.04em; line-height: .9;
  font-size: clamp(56px, 12vw, 112px); margin: 0;
}
.dek {
  font-size: clamp(21px, 3.2vw, 28px); line-height: 1.3; margin: 0; max-width: 30ch;
  font-weight: 500; text-wrap: balance;
}
.dek em { font-style: normal; color: var(--green); }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px 24px; font-family: var(--font-mono); font-size: 14px; }
.dek-note { font-size: 17px; line-height: 1.5; color: var(--muted); max-width: 48ch; margin: -6px 0 0; }

/* sections */
main section { padding-block: 64px; border-bottom: 1px solid var(--line); }
main section:last-child { border-bottom: 0; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
h2 {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -.02em; line-height: 1;
  font-size: 40px; margin: 0; text-transform: lowercase;
}
p { margin: 0; }
.prose { max-width: 64ch; display: flex; flex-direction: column; gap: 14px; }

.focus { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.focus div { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.focus h3 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; }
.focus p { color: var(--muted); font-size: 16px; line-height: 1.5; }

.working { max-width: 64ch; margin-top: 28px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.working h3 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; }
.working p { color: var(--muted); font-size: 16px; line-height: 1.5; }
.working ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.working li { line-height: 1.5; }

.creds { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.creds li {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.4;
  border: 1px solid var(--line); padding: 6px 10px; color: var(--muted);
}
.creds li b { color: var(--ink); font-weight: 500; }

/* career rail */
.rail { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; }
.rail li { display: grid; grid-template-columns: 92px 1fr; gap: 18px; position: relative; padding-bottom: 18px; }
.rail li::before { content: ""; position: absolute; left: 103px; top: 10px; bottom: -10px; width: 1px; background: var(--line); }
.rail li:last-child::before { display: none; }
.rail .yr { font-family: var(--font-mono); font-size: 13px; color: var(--muted); text-align: right; padding-top: 3px; font-variant-numeric: tabular-nums; }
.rail .what { padding-left: 22px; position: relative; font-size: 16px; line-height: 1.45; }
.rail .what::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border: 1px solid var(--green); background: var(--bg); }
.rail .what b { font-weight: 700; }
.rail .what span { color: var(--muted); }

/* project */
.project { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.project video { width: 100%; min-width: min(420px, 100%); aspect-ratio: 1 / 1; background: #0B1324; border: 1px solid var(--line); display: block; }
.project-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.project h3 { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
.spec { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--font-mono); font-size: 14px; }
.links a[data-src] { padding: 2px 8px; border: 1px solid var(--line); text-decoration: none; }
.links a[data-src][aria-current] { border-color: currentColor; font-weight: 500; }
.credit { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* work: three groups with a heading, one-line intro and a jump nav */
.group-nav { margin: -4px 0 40px; }
.group { scroll-margin-top: 24px; }
.group + .group { margin-top: 72px; }
.group-head { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 1px solid var(--line); margin-bottom: 28px; }
.group-head h3 { font-family: var(--font-display); font-weight: 900; font-size: 24px; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.group-head p { color: var(--muted); font-size: 16px; line-height: 1.5; max-width: 64ch; }

.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); padding: 16px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; }
.list a { font-weight: 700; font-size: 19px; text-decoration: none; color: var(--ink); }
.list a:hover { color: var(--green); }
.list .spec { align-self: center; }

footer { border-top: 1px solid var(--line); padding-block: 28px 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

@media (max-width: 640px) {
  .group + .group { margin-top: 56px; }
  body { font-size: 17px; padding-inline: 16px; }
  .hero { margin-inline: -16px; padding: 72px 16px 56px; }
  .reg { display: none; }
  main section { padding-block: 48px; }
  h2 { font-size: 32px; }
  .focus { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .rail li { grid-template-columns: 64px 1fr; gap: 12px; }
  .rail li::before { left: 75px; }
}

/* video players: 16:9 cards, YouTube click-to-load */
.player { width: 100%; }
.player.wide { max-width: 760px; }
.player.wide video, .player.wide iframe, .player.wide .yt { aspect-ratio: 16 / 9; min-width: 0; }
.player iframe { width: 100%; border: 1px solid var(--line); display: block; background: #0B1324; }
.yt { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: #0B1324; cursor: pointer; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(0,0,0,.72); transition: background .15s; }
.yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.yt-text { aspect-ratio: 16 / 9; background: linear-gradient(135deg,#0B1324,#1d2c4d); }
.yt-caption { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; font-size: 13px; line-height: 1.35; text-align: left; }
a.yt { text-decoration: none; }
a.yt-text::after { content: "↗"; position: absolute; right: 14px; top: 10px; color: #fff; font-size: 20px; }
.yt:hover .yt-play, .yt:focus-visible .yt-play { background: #c00; }

/* "Why three copies?" note under the Singapore haze card */
.hosts { font-size: 15px; color: var(--muted); margin: 14px 0 0; }
ul.hosts { padding-left: 20px; margin-top: 6px; display: grid; gap: 6px; }
.hosts strong { color: var(--ink); }

/* news: dated entries; vertical (9:16) video beside the text, stacked on phones */
.news-item { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.news-item + .news-item { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--line); }
.news-item h3 { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
.player.tall .yt, .player.tall iframe { width: 100%; aspect-ratio: 9 / 16; }
.player.tall video { width: 100%; aspect-ratio: 9 / 16; background: #111111; border: 1px solid var(--line); display: block; }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; padding: 12px 0; border-block: 1px solid var(--line); }
.spec-list dt { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--green); padding-top: 3px; }
.spec-list dd { margin: 0; font-weight: 700; }
@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; }
  .news-item .player.tall { max-width: 320px; }
}

/* toolkit page: one row per tool, job label on the left; "trying" list folded away in <details> */
.page-head { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.page-head .wrap { display: flex; flex-direction: column; gap: 14px; }
.page-head h1 { font-size: clamp(44px, 9vw, 80px); }
.back { font-family: var(--font-mono); font-size: 14px; }
.tools { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.tools li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.tools .job { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--green); padding-top: 5px; }
.tools h3 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; }
.tools h3 a { color: var(--ink); text-decoration: none; }
.tools h3 a:hover { color: var(--green); }
.tools p { font-size: 16px; line-height: 1.5; }
.tools .credit { margin-top: 6px; }
details.more { border: 1px solid var(--line); background: var(--panel); padding: 0 20px; }
details.more summary { cursor: pointer; padding: 16px 0; font-weight: 700; }
details.more[open] summary { border-bottom: 1px solid var(--line); }
details.more dl { margin: 4px 0 8px; border-top: 0; }
@media (max-width: 640px) {
  .page-head { padding: 40px 0 32px; }
  .tools li { grid-template-columns: 1fr; }
  .tools .job { padding-top: 0; }
  details.more { padding: 0 16px; }
}

/* "Haze now" strip under the hero; colour follows NEA's 1-hour PM2.5 band (text always states the band). */
.haze-now { --hn: var(--green); margin-inline: -20px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); border-left: 6px solid var(--hn); }
.haze-now[data-band="I"] { --hn: #3fae5a; } .haze-now[data-band="II"] { --hn: #f5b400; }
.haze-now[data-band="III"] { --hn: #f0702a; } .haze-now[data-band="IV"] { --hn: #c8102e; }
.haze-now .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 16px; line-height: 1.4; }
.hn-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--hn); flex: none; }
.hn-label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hn-text { font-weight: 700; min-width: 0; }
.hn-links { display: flex; gap: 16px; margin-left: auto; font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }
.live-intro { color: var(--muted); max-width: 64ch; margin: -8px 0 32px; }
@media (max-width: 640px) { .hn-links { margin-left: 0; width: 100%; } }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 0; font-family: var(--font-mono); font-size: 14px; }
.share-row button { font: inherit; color: var(--green); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.share-row button:hover { border-color: var(--green); }
.share-msg { color: var(--muted); }

/* ---- redesign preview: sticky bar, hero "start here" tiles, work as a filterable card grid ---- */
.topbar { position: sticky; top: 0; z-index: 20; margin-inline: -20px; padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: baseline; gap: 6px 20px; font-family: var(--font-mono); font-size: 14px; }
.topbar a { color: var(--ink); text-decoration: none; }
.topbar a:hover { color: var(--green); }
.topbar .me { font-family: var(--font-display); font-weight: 900; font-size: 18px; letter-spacing: -.02em; margin-right: auto; }
.tb-ext { color: var(--green) !important; }
.hero { padding-top: 64px; }
main section, .card, #top { scroll-margin-top: 60px; }

.featured { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.featured a { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.25; }
.featured img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border: 1px solid var(--line); background: var(--panel); display: block; margin-bottom: 6px; transition: transform .2s, border-color .2s; }
.featured a:hover img { transform: translateY(-3px); border-color: var(--green); }
.featured a:hover { color: var(--green); }
.f-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 32px; }
.chips[hidden] { display: none; }
.chip { font: 500 13px/1 var(--font-mono); padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); cursor: pointer; }
.chip span { color: var(--muted); margin-left: 4px; }
.chip:hover { border-color: var(--green); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .7; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 28px; }
.card { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card[hidden] { display: none; }
.thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: transform .3s; }
.thumb:hover img { transform: scale(1.03); }
.card .player video, .card .player .yt, .card .player iframe { width: 100%; aspect-ratio: 16 / 9; display: block; border: 1px solid var(--line); background: #0B1324; }
.card .player video { object-fit: contain; }
.card-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tag { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.card h3 { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
.card-body > p { font-size: 16.5px; line-height: 1.5; }
.card .share-row { font-size: 13px; }
.more-info summary { cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--muted); list-style: none; }
.more-info summary::-webkit-details-marker { display: none; }
.more-info summary::before { content: "+ "; color: var(--green); }
.more-info[open] summary::before { content: "− "; }
.more-info > :not(summary) { margin-top: 10px; font-size: 15.5px; line-height: 1.5; }
.more-info .hosts { font-size: 14.5px; }

.rail[data-collapsed] li:nth-child(n+5) { display: none; }
.rail[data-collapsed] li:nth-child(4)::before { display: none; }
.rail-toggle { margin-top: 4px; font: 500 14px var(--font-mono); color: var(--green); background: none; border: 1px solid var(--line); padding: 8px 14px; cursor: pointer; }
.rail-toggle:hover { border-color: var(--green); }

@media (max-width: 640px) {
  .topbar { margin-inline: -16px; padding: 10px 16px; }
  .topbar .wrap { gap: 4px 14px; font-size: 13px; }
  .tb-ext { display: none; }
  .hero { padding-top: 48px; }
  .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .cards { grid-template-columns: 1fr; gap: 44px; }
}

/* Connection badge in the "Haze now" strip (same as the haze pages): green Live pulsing, amber Delayed, grey Offline/Connecting */
.src-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-family: var(--font-body); font-size: 12px; font-weight: 700; border: 1px solid currentColor; flex: none; }
.src-pill.is-live { color: #1e8e3e; }
.src-pill.is-late { color: #a15c00; }
.src-pill.is-off, .src-pill.is-wait { color: var(--muted); }
.src-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.src-pill.is-live .src-dot { animation: src-pulse 2s ease-in-out infinite; }
@keyframes src-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .src-pill.is-live .src-dot { animation: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .src-pill.is-live { color: #5ccf7a; } :root:not([data-theme="light"]) .src-pill.is-late { color: #f0b429; } }
:root[data-theme="dark"] .src-pill.is-live { color: #5ccf7a; } :root[data-theme="dark"] .src-pill.is-late { color: #f0b429; }

/* contact: channel rows and the learning-in-public list */
.reach, .notes-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); max-width: 880px; }
.reach li, .notes-list li { border-bottom: 1px solid var(--line); }
.reach a, .notes-list a { display: grid; gap: 4px 24px; padding: 14px 0; color: var(--ink); text-decoration: none; }
.reach a { grid-template-columns: 160px minmax(0, 1fr) auto; align-items: baseline; }
.reach .nm { font-weight: 700; font-size: 17px; }
.reach .why { color: var(--muted); font-size: 16px; }
.reach .go { font-family: var(--font-mono); color: var(--green); }
.sub-label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 44px 0 12px; }
.notes-list a { grid-template-columns: 160px minmax(0, 1fr); }
.notes-list .tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.notes-list .t { display: flex; flex-direction: column; gap: 2px; }
.notes-list b { font-size: 17px; font-weight: 700; }
.notes-list .t span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.reach a:hover .nm, .reach a:focus-visible .nm, .notes-list a:hover b, .notes-list a:focus-visible b { color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
#contact .aside { max-width: 64ch; margin-top: 24px; color: var(--muted); }
@media (max-width: 640px) {
  .reach a { grid-template-columns: minmax(0, 1fr) auto; }
  .reach .why { grid-column: 1; grid-row: 2; }
  .reach .go { grid-column: 2; grid-row: 1; }
  .notes-list a { grid-template-columns: 1fr; gap: 2px; }
}

/* about: lead line, labelled blocks, numbered method */
.about-lead { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; max-width: 24ch; margin: 0 0 20px; }
.sub-label.about-sub { margin: 36px 0 10px; }
.method { list-style: none; counter-reset: step; padding: 0; margin: 0; max-width: 64ch; border-top: 1px solid var(--line); }
.method li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; line-height: 1.45; }
.method li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 13px; color: var(--green); }
.about-cta { font-weight: 500; }
