/* Portfolio pages. The interactive atlas (atlas.html) keeps its own styles.css.
   Identity: evidence first. Screenshots sit on dark "figure plates" in both themes, and every
   figure caption says where the picture comes from (screenshot, simulated output, thesis figure). */

/* ---------- Tokens ---------- */
/* The white command-room look: cool white hull, ink text, cyan accents; dark follows the room at night. */
:root {
  --paper: #f4f7f9; --surface: #ffffff; --ink: #0f1f2b; --ink-2: #33495a; --ink-3: #556673;
  --rule: #dbe4ea; --nissl: #066c92; --nissl-soft: #e3f5fc;
  --ok: #1d7553; --wip: #8f5500; --plan: #5c6172;
  --plate: #0c1d2a; --plate-ink: #d9f3ff;
  --display: "Michroma", "Segoe UI", system-ui, sans-serif;
  --text: "Oxanium", "Segoe UI", system-ui, -apple-system, sans-serif;
  --data: "Oxanium", "Segoe UI", system-ui, sans-serif;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1720; --surface: #16222d; --ink: #e8f4fa; --ink-2: #b4c7d3; --ink-3: #93a9b7;
    --rule: #26394a; --nissl: #7fe3ff; --nissl-soft: #15303f;
    --ok: #5cc59a; --wip: #e2a54a; --plan: #a3a7b8;
    --plate: #081018; --plate-ink: #d9f3ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1720; --surface: #16222d; --ink: #e8f4fa; --ink-2: #b4c7d3; --ink-3: #93a9b7;
  --rule: #26394a; --nissl: #7fe3ff; --nissl-soft: #15303f;
  --ok: #5cc59a; --wip: #e2a54a; --plan: #a3a7b8;
  --plate: #081018; --plate-ink: #d9f3ff;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.62 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--nissl); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--nissl); outline-offset: 3px; border-radius: 2px; }
p, ul, ol, dl { margin: 0 0 1em; }
h1, h2, h3 { color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0; }
h1 { font-size: clamp(1.55rem, 3.2vw, 2.45rem); line-height: 1.22; margin: 0 0 0.55em; }
h2 { font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.3; margin: 0 0 0.6em; }
h3 { font: 600 1.12rem/1.35 var(--text); margin: 1.6em 0 0.45em; }
.data, code { font-family: var(--data); font-size: 0.88em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.lede { font-size: 1.16rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }

/* ---------- Header and footer ---------- */
.site-head, .hud {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule);
}
.site-head .wrap, .hud .wrap { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { font: 500 1.12rem/1 var(--display); color: var(--ink); text-decoration: none; margin-right: auto; white-space: nowrap; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.95rem; padding: 8px 10px; border-radius: 6px;
}
.nav a:hover { color: var(--ink); background: var(--nissl-soft); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--nissl); border-radius: 0; }
.theme-btn {
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); border-radius: 6px;
  font: 500 0.85rem/1 var(--text); padding: 8px 10px; cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }

.site-foot { border-top: 1px solid var(--rule); margin-top: 96px; padding: 40px 0 56px; color: var(--ink-3); font-size: 0.92rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-foot a { color: var(--ink-2); }

/* ---------- Links row (CV, email, profiles) ---------- */
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.6em 0 0; padding: 0; list-style: none; }
.links a, .links .pending {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500;
}
.links a:hover { border-color: var(--nissl); }
.links a.primary { background: var(--nissl); border-color: var(--nissl); color: var(--surface); }
.links .pending { color: var(--ink-3); border-style: dashed; font-weight: 400; }

/* ---------- Home hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { max-width: 17ch; }
.hero .who { font-size: 1.05rem; color: var(--ink-2); margin-bottom: 1.1em; }
.hero .figure { margin: 0; }

/* ---------- Figures: the dark plate is the site's one bold device ---------- */
.figure { margin: 2.2em 0; }
.plate {
  display: block; background: var(--plate); border-radius: 10px; padding: clamp(6px, 1vw, 10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -28px rgba(10, 10, 30, 0.55);
}
.plate img { border-radius: 5px; width: 100%; }
a.plate { text-decoration: none; }
a.plate:hover img { opacity: 0.94; }
.figure figcaption { margin-top: 0.8em; font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); max-width: 78ch; }
.figure figcaption b { color: var(--ink); font-weight: 600; }
.src {
  display: inline-block; font: 600 0.74rem/1 var(--text); letter-spacing: 0.01em; padding: 4px 7px; margin-right: 6px;
  border-radius: 4px; border: 1px solid currentColor; vertical-align: 1px; white-space: nowrap;
}
.src.shot { color: var(--ink-2); }
.src.sim { color: var(--nissl); }
.src.thesis { color: var(--ok); }
.src.schematic { color: var(--wip); border-style: dashed; }

/* ---------- Status ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; font-weight: 500; color: var(--ink-2); }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--plan); flex: none; }
.status.ok::before { background: var(--ok); }
.status.wip::before { background: transparent; border: 2px solid var(--wip); width: 9px; height: 9px; box-sizing: border-box; }
.status.plan::before { background: transparent; border: 1.5px dashed var(--plan); }

/* ---------- Home: selected work ---------- */
.section { padding: clamp(40px, 6vw, 72px) 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.feature {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px clamp(28px, 4vw, 56px);
  align-items: center; padding: clamp(28px, 4vw, 44px) 0; border-top: 1px solid var(--rule);
}
.feature:first-of-type { border-top: 0; }
.feature.flip .feature-media { order: 2; }
.feature .figure { margin: 0; }
.feature h3 { font: 420 clamp(1.5rem, 2.4vw, 1.9rem)/1.15 var(--display); margin: 0.35em 0 0.5em; }
.feature h3 a { color: var(--ink); text-decoration: none; }
.feature h3 a:hover { color: var(--nissl); }
.feature .kind { color: var(--ink-3); font-size: 0.92rem; margin: 0; }
.feature p { color: var(--ink-2); }
.feature .more { font-weight: 500; }

/* The child-interviewing programme: two projects shown as one research line. */
.programme { border-top: 1px solid var(--rule); padding: clamp(28px, 4vw, 44px) 0 0; }
.programme > h3 { font: 420 clamp(1.5rem, 2.4vw, 1.9rem)/1.15 var(--display); margin: 0 0 0.4em; }
.programme > p { color: var(--ink-2); max-width: 70ch; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 36px); margin-top: 20px; }
.pair article { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: clamp(18px, 2.4vw, 28px); display: flex; flex-direction: column; }
.pair article p { color: var(--ink-2); }
.pair h3 { font: 420 1.45rem/1.2 var(--display); margin: 0.4em 0 0.45em; }
.pair h3 a { color: var(--ink); text-decoration: none; }
.pair h3 a:hover { color: var(--nissl); }
.pair .figure { margin: 0 0 6px; }
.pair .more { margin-top: auto; font-weight: 500; }

/* Kinship example: real language data used as the ASQ visual (no picture of the confidential work). */
.kin {
  background: var(--plate); color: var(--plate-ink); border-radius: 10px; padding: 22px clamp(16px, 3vw, 26px);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 18px; align-items: center; margin-bottom: 6px;
}
.kin .ar { font: 500 1.9rem/1.3 "Noto Naskh Arabic", "Amiri", "Segoe UI", serif; direction: rtl; color: #fff; }
.kin .gl { font-size: 0.82rem; color: #a5a8b8; display: block; direction: ltr; }
.kin .arrow { font-size: 1.4rem; color: #8f86d8; text-align: center; }
.kin .en { font: 420 1.5rem/1.2 var(--display); color: #fff; }
.kin .note { grid-column: 1 / -1; font-size: 0.86rem; color: #a5a8b8; border-top: 1px solid #262838; padding-top: 10px; margin-top: 4px; }

/* Text panels on the dark plate, used where a picture would need permission. */
.panel-plate { background: var(--plate); color: var(--plate-ink); border-radius: 10px; padding: 22px clamp(16px, 3vw, 28px); margin-bottom: 6px; }
.panel-plate .pt { font: 600 0.84rem/1.3 var(--text); color: #a5a8b8; margin: 0 0 14px; }
.panel-plate .note { font-size: 0.86rem; color: #a5a8b8; border-top: 1px solid #262838; padding-top: 10px; margin: 16px 0 0; }
.fis ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.fis li { font: 420 1.12rem/1.25 var(--display); color: #fff; border-left: 2px solid #8f86d8; padding-left: 10px; }
.adapt dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; }
.adapt dt { color: #a5a8b8; font-size: 0.86rem; padding-top: 2px; }
.adapt dd { margin: 0; color: #fff; }

/* Smaller entries */
.also { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); margin-top: 12px; }
.also article { border-top: 1px solid var(--rule); padding: 18px 0 8px; }
.also h3 { margin: 0 0 0.3em; font-size: 1.05rem; }
.also p { color: var(--ink-2); font-size: 0.97rem; margin-bottom: 0.5em; }

/* Interests */
.interests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px clamp(20px, 3vw, 40px); margin-top: 18px; }
.interests div { border-left: 2px solid var(--nissl); padding-left: 16px; }
.interests h3 { margin: 0 0 0.3em; }
.interests p { color: var(--ink-2); font-size: 0.97rem; margin: 0; }

/* ---------- Timeline (positions are a real sequence) ---------- */
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--rule); }
.timeline .when { color: var(--ink-3); font-size: 0.93rem; padding-top: 2px; }
.timeline .what { font-weight: 600; }
.timeline .where { color: var(--ink-2); }
.timeline p { margin: 0.35em 0 0; color: var(--ink-2); font-size: 0.97rem; }
.timeline ul { margin: 0.4em 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: 0.97rem; }
.timeline li li { display: list-item; padding: 0; border: 0; margin: 0 0 0.25em; }

/* ---------- Project pages ---------- */
.page-head { padding: clamp(36px, 6vw, 72px) 0 12px; }
.crumb { font-size: 0.92rem; margin-bottom: 1.4em; }
.crumb a { color: var(--ink-3); }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin: 28px 0 8px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.facts div { padding: 14px 18px 14px 0; }
.facts dt { font-size: 0.84rem; color: var(--ink-3); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 0.97rem; }
.body { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 48px; align-items: start; }
.body .toc { position: sticky; top: 90px; font-size: 0.9rem; border-left: 1px solid var(--rule); padding-left: 16px; }
.body .toc p { color: var(--ink-3); margin-bottom: 0.4em; }
.body .toc ol { list-style: none; padding: 0; margin: 0; }
.body .toc li { margin: 0 0 0.35em; }
.body .toc a { color: var(--ink-2); text-decoration: none; }
.body .toc a:hover { color: var(--nissl); }
.body section { margin-bottom: 2.6em; }
.body section > h2 { margin-top: 0.4em; }
.body ul { padding-left: 1.2em; }
.body li { margin-bottom: 0.4em; }
.body .wide { max-width: none; }

/* A boxed statement for the line that must never be missed (e.g. simulated vs recorded). */
.caveat {
  border: 1px solid var(--nissl); background: var(--nissl-soft); border-radius: 10px; padding: 16px 20px; margin: 1.6em 0;
}
.caveat p:last-child, .caveat ul:last-child { margin-bottom: 0; }
.caveat strong { color: var(--ink); }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0.6em 0 1.4em; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 0.86rem; }
.table-scroll { overflow-x: auto; }

.figure.narrow { max-width: 560px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.gallery .figure { margin: 0; }

.next { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 24px; margin-top: 48px; }

/* ---------- Work index ---------- */
.work-list { list-style: none; padding: 0; margin: 24px 0 0; }
.work-list > li { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 20px 32px; padding: 26px 0; border-top: 1px solid var(--rule); align-items: start; }
.work-list .thumb { border-radius: 8px; overflow: hidden; background: var(--plate); aspect-ratio: 16 / 10; }
.work-list .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.work-list .thumb.text { display: grid; place-items: center; color: var(--plate-ink); font: 500 1.6rem/1.2 "Noto Naskh Arabic", "Segoe UI", serif; padding: 12px; text-align: center; }
.work-list h3 { margin: 0.1em 0 0.3em; font: 420 1.4rem/1.2 var(--display); }
.work-list h3 a { color: var(--ink); text-decoration: none; }
.work-list h3 a:hover { color: var(--nissl); }
.work-list p { color: var(--ink-2); margin-bottom: 0.5em; }
.work-list .kind { color: var(--ink-3); font-size: 0.9rem; margin: 0; }

/* ---------- Motion: one page-load moment on the home hero only ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .figure { animation: plate-in 700ms cubic-bezier(.2, .7, .2, 1) both 120ms; }
  @keyframes plate-in { from { transform: translateY(12px); } to { transform: none; } }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .body { grid-template-columns: 1fr; }
  .body .toc { display: none; }
}
@media (max-width: 860px) {
  .hero .wrap, .feature { grid-template-columns: 1fr; }
  .hero .figure { max-width: 360px; }
  .feature.flip .feature-media { order: 0; }
  .pair, .also, .gallery { grid-template-columns: 1fr; }
  .interests { grid-template-columns: 1fr; }
  .work-list > li { grid-template-columns: 1fr; }
  .work-list .thumb { max-width: 420px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-head, .hud { position: static; }
  .site-head .wrap, .hud .wrap { flex-wrap: wrap; gap: 2px 12px; padding-top: 10px; padding-bottom: 6px; }
  .brand { width: 100%; margin: 4px 0 0; }
  .nav { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .hud .nav { flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px 10px; }
  .nav a { padding: 8px 4px; font-size: 0.95rem; }
  .nav-long { display: none; }
  .theme-btn { padding: 6px 8px; font-size: 0.8rem; }
  .timeline li { grid-template-columns: 1fr; }
  .kin { grid-template-columns: 1fr; text-align: center; }
  .kin .arrow { transform: rotate(90deg); }
  .adapt dl { grid-template-columns: 1fr; gap: 2px; }
  .adapt dd { margin-bottom: 8px; }
  .links a, .links .pending { padding: 9px 12px; }
}

/* ---------- Print ---------- */
@media print {
  .site-head, .site-foot, .toc, .theme-btn, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .plate { box-shadow: none; }
}

/* Placeholder for a link the owner still has to supply; visible in preview, never shipped. */
.pending-inline { color: var(--ink-3); border-bottom: 1px dashed var(--ink-3); }

/* ---------- Presentation pass (22 Oct 2026, v3) ---------- */

/* What I can contribute: four capabilities, each tied to evidence. */
.caps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.caps > div { padding: 20px 22px 20px 0; }
.caps > div + div { padding-left: 22px; border-left: 1px solid var(--rule); }
.caps h3 { font: 420 1.22rem/1.2 var(--display); margin: 0 0 0.35em; }
.caps p { color: var(--ink-2); font-size: 0.95rem; margin: 0 0 0.5em; }
.caps a { font-size: 0.9rem; font-weight: 500; }

/* A research question set as the page's opening statement. */
.question { font: 400 clamp(1.45rem, 2.6vw, 2.05rem)/1.25 var(--display); color: var(--ink); max-width: 30ch;
  margin: 0 0 0.8em; padding-left: 18px; border-left: 3px solid var(--nissl); }

/* Four things the platform does. */
.does { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0 8px; max-width: 760px; }
.does div { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 18px; }
.does h3 { font: 420 1.25rem/1.2 var(--display); margin: 0 0 0.35em; color: var(--nissl); }
.does p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* Demonstration: a real sequence of steps, so numbering is meaningful here. */
.steps { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: step; }
.steps > li { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px 32px; align-items: center;
  padding: 22px 0; border-top: 1px solid var(--rule); counter-increment: step; }
.steps > li::before { content: none; }
.steps .n { font: 420 0.95rem/1 var(--display); color: var(--nissl); display: block; margin-bottom: 8px; }
.steps .n::before { content: "Step " counter(step); }
.steps h3 { margin: 0 0 0.35em; font: 420 1.3rem/1.2 var(--display); }
.steps p { color: var(--ink-2); font-size: 0.97rem; margin: 0; }
.steps .figure { margin: 0; }
.steps .portrait .plate { max-width: 300px; }
.steps .portrait img { max-height: 420px; object-fit: contain; }

/* Verified results: real numbers from recorded runs. */
.evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 16px 0 6px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.evidence > div { padding: 22px 22px 22px 0; }
.evidence > div + div { padding-left: 22px; border-left: 1px solid var(--rule); }
.evidence .big { font: 400 clamp(1.9rem, 3.4vw, 2.6rem)/1 var(--display); color: var(--ink); display: block; margin-bottom: 10px; }
.evidence p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* Clinical Skill Lab: generations on a horizontal timeline. */
.gens { list-style: none; padding: 0; margin: 22px 0 10px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 14px; position: relative; }
.gens::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--rule); }
.gens li { position: relative; padding-top: 26px; }
.gens li::before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink-3); box-sizing: border-box; }
.gens li.gen::before { background: var(--nissl); border-color: var(--nissl); }
.gens li.collab::before { background: var(--paper); border: 2px dashed var(--nissl); }
.gens .when { display: block; font-size: 0.85rem; color: var(--ink-3); margin-bottom: 4px; }
.gens h3 { margin: 0 0 0.3em; font: 420 1.12rem/1.2 var(--display); }
.gens p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.gens .who { display: block; margin-top: 6px; font-size: 0.85rem; font-weight: 500; color: var(--ink); }

/* Expandable technical sections: everything stays on the page, collapsed by default. */
details.tech { border-top: 1px solid var(--rule); padding: 4px 0; }
details.tech:last-of-type { border-bottom: 1px solid var(--rule); }
details.tech > summary { cursor: pointer; list-style: none; padding: 14px 0; font: 600 1.02rem/1.35 var(--text); color: var(--ink);
  display: flex; justify-content: space-between; gap: 16px; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::after { content: "Show"; font: 500 0.85rem/1.6 var(--text); color: var(--nissl); white-space: nowrap; }
details.tech[open] > summary::after { content: "Hide"; }
details.tech > summary:hover { color: var(--nissl); }
details.tech > .inner { padding: 0 0 18px; }
.lead-short { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; }

@media (max-width: 960px) {
  .caps, .does { grid-template-columns: 1fr 1fr; }
  .caps > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .caps > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .gens { grid-template-columns: 1fr; gap: 0; }
  .gens::before { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .gens li { padding: 0 0 20px 30px; }
  .gens li::before { top: 2px; }
}
@media (max-width: 640px) {
  .caps, .does, .evidence { grid-template-columns: 1fr; }
  .caps > div, .caps > div + div, .evidence > div, .evidence > div + div { padding: 16px 0; border-left: 0; }
  .caps > div + div, .evidence > div + div { border-top: 1px solid var(--rule); }
  .steps > li { grid-template-columns: 1fr; }
  .question { font-size: 1.35rem; }
  .prose p { margin-bottom: 0.85em; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section.tight { padding-top: 0; }

/* ---------- The home page's header (the HUD) and its two modes: 3D room or plain page ---------- */
.hud .btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--rule); color: var(--ink); border-radius: 999px; padding: 7px 14px;
  font: 600 0.85rem/1.2 var(--text);
}
.hud .btn:hover { border-color: var(--nissl); }
.figure .credit { display: block; font-size: 0.82rem; color: var(--ink-3); }
#plain-note { display: none; margin: 0; padding: 10px var(--gutter); background: var(--nissl-soft); color: var(--ink); font-size: 0.95rem; text-align: center; }
html[data-nowebgl] #plain-note, html[data-fallback] #plain-note { display: block; }
/* the mode button is offered only where the room can run, and names the other mode */
html:not([data-roomok]) #mode-btn, html:not([data-mode="room"]) #snd { display: none; }
html[data-mode="room"] #mode-btn .to-room, html:not([data-mode="room"]) #mode-btn .to-plain { display: none; }
html[data-mode="room"] #main, html[data-mode="room"] .site-foot, html[data-mode="room"] .plain-only { display: none; }
html:not([data-mode="room"]) #room { display: none; }
html[data-mode="room"], html[data-mode="room"] body { height: 100%; overflow: hidden; }
html[data-mode="room"] .hud {
  --surface: #ffffff; --ink: #0f1f2b; --ink-2: #33495a; --rule: #dbe4ea; --nissl: #066c92; color-scheme: light;
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; background: transparent; border-bottom: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: env(safe-area-inset-top, 0px); pointer-events: none;
}
html[data-mode="room"] .hud .wrap { flex-wrap: wrap; align-items: flex-start; padding-top: 12px; max-width: none; }
html[data-mode="room"] .hud a, html[data-mode="room"] .hud button { pointer-events: auto; }
html[data-mode="room"] .hud-name {
  width: auto; margin: 0 auto 0 0; padding: 6px 12px; border-radius: 10px; font-size: 1rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
html[data-mode="room"] .hud .nav { width: auto; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
