/* Layout: one long scrolling page on a black "scanner bed" ground; specimen-label mono type
   marks catalog data; pink / purple / teal carry meaning (pink = evolution, purple = imaging, teal = anatomy). */
:root {
  --ink: #0b0a10;
  --panel: #15121e;
  --panel-2: #1c1828;
  --line: #2b2540;
  --line-strong: #71688c;   /* borders of interactive controls: 3.3:1+ on every surface */
  --fg: #efeaf6;
  --muted: #a8a0ba;
  --pink: #ff5fa2;
  --purple: #a47bff;
  --teal: #2ed3c6;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.75rem, 7vw, 5rem);

  --wrap: 72rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font: 400 var(--step-0)/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--pink); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.label {
  font: 500 var(--step--1)/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.75rem; flex-wrap: wrap;
}
.brand {
  font: 800 var(--step-1)/1 var(--display);
  color: var(--fg); text-decoration: none; letter-spacing: -0.01em;
}
.brand span { color: var(--pink); }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a {
  font: 500 var(--step--1)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); text-decoration: none; padding-block: 0.25rem;
}
.nav a:hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.5rem; align-items: center; padding-block: 4rem 3.5rem;
}
.hero h1 {
  font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; margin-block: 0.75rem 1.25rem;
}
.hero h1 .the { display: block; font-size: 0.42em; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.acronym {
  font: 400 var(--step-1)/1.5 var(--display); color: var(--muted); margin-bottom: 1.5rem;
}
.acronym b { font-weight: 800; }
.acronym .k1 { color: var(--pink); }
.acronym .k2 { color: var(--purple); }
.acronym .k3 { color: var(--teal); }
.mission {
  font-size: var(--step-1); line-height: 1.55; max-width: 34ch;
  border-left: 3px solid var(--purple); padding-left: 1rem;
}
.hero-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 600 0.9375rem/1 var(--body); text-decoration: none;
  padding: 0.8rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--fg); background: var(--panel); cursor: pointer;
}
.btn:hover { border-color: var(--teal); color: var(--fg); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.btn.primary:hover { background: #ff7cb4; color: var(--ink); }

.scan {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 100%;
  border: 1px solid var(--line); border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, rgba(164,123,255,0.16), transparent 62%),
    var(--panel);
  overflow: hidden;
}
.scan canvas { width: 100%; height: 100%; display: block; }
.scan .crosshair { position: absolute; inset: 0; pointer-events: none; }
.scan .crosshair::before, .scan .crosshair::after {
  content: ""; position: absolute; background: var(--line);
}
.scan .crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.scan .crosshair::after { top: 50%; left: 0; right: 0; height: 1px; }
.scan-meta {
  position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.6rem;
  display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.scan-meta .label { font-size: 0.6875rem; }
.scan-key { position: absolute; top: 0.6rem; left: 0.75rem; display: flex; gap: 0.9rem; }
.scan-key span { display: inline-flex; align-items: center; gap: 0.35rem; font: 500 0.6875rem/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.scan-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Sections ---------- */
section { border-top: 1px solid var(--line); }
section > .wrap { padding-block: 4.5rem; }
.section-head { display: grid; gap: 0.6rem; margin-bottom: 2.5rem; max-width: 46rem; }
.section-head p { color: var(--muted); }

/* Research */
/* Five projects: three across, then two wider cards, so no row ends with a gap. */
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 40rem) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects > :last-child { grid-column: 1 / -1; }
}
@media (min-width: 60rem) {
  .projects { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .projects > * { grid-column: span 2; }
  .projects > :nth-child(n+4) { grid-column: span 3; }
}
.project {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 0.75rem;
  padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  min-width: 0;
}
.project .taxon { font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.project p { color: #d6d0e2; }
.project footer { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; align-items: center; padding-top: 0.75rem; border-top: 1px dashed var(--line); }
.status {
  font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.4rem 0.6rem; border-radius: 999px; border: 1px solid currentColor;
}
.status.published { color: var(--teal); }
.status.active { color: var(--pink); }
.project .methods { font: 400 var(--step--1)/1.5 var(--mono); color: var(--muted); }

.nocturn {
  margin-top: 1.25rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
  padding: 1.75rem 1.5rem; border-radius: 6px;
  background: linear-gradient(110deg, rgba(164,123,255,0.18), rgba(46,211,198,0.12));
  border: 1px solid var(--line);
}
.nocturn p { color: #d6d0e2; max-width: 52ch; margin-top: 0.4rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem; }
.model { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-width: 0; }
.model.wide { grid-column: 1 / -1; }
.model.wide .stage { aspect-ratio: 16 / 6; min-height: 16rem; }
.model .stage { aspect-ratio: 4 / 3; max-width: 100%; background: radial-gradient(circle at 50% 45%, var(--panel-2), var(--ink)); position: relative; }
.model model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.model .empty {
  width: 100%; height: 100%;
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0.4rem; text-align: center; padding: 1rem;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 14px 14px;
}
.model .empty code { font: 500 var(--step--1)/1.4 var(--mono); color: var(--purple); word-break: break-all; }
.model figcaption { padding: 1rem 1.1rem 1.2rem; display: grid; gap: 0.3rem; }
.model figcaption h3 { font-size: 1.0625rem; }
.model figcaption p { color: var(--muted); font-size: 0.9375rem; }

/* Publications */
.pub-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.chip {
  font: 500 var(--step--1)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.55rem 0.85rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; gap: 0.45rem; align-items: center;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--ink); border-color: var(--fg); }
.pubs { display: grid; gap: 2.25rem; }
.year { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; }
.year > h3 { font: 600 var(--step-1)/1.4 var(--mono); color: var(--purple); font-variant-numeric: tabular-nums; }
.year ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.pub { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0.9rem; max-width: 62rem; }
.pub::before { content: ""; width: 8px; height: 8px; margin-top: 0.55em; border-radius: 50%; background: var(--c, var(--muted)); }
.pub[data-topic="evo"] { --c: var(--pink); }
.pub[data-topic="imaging"] { --c: var(--purple); }
.pub[data-topic="clinical"] { --c: var(--teal); }
.pub .t { color: var(--fg); font-weight: 600; }
.pub .a { color: var(--muted); font-size: 0.9375rem; }
.pub .a strong { color: var(--fg); font-weight: 600; }
.pub .j { font-style: italic; color: #d6d0e2; font-size: 0.9375rem; }
.pub a { font: 400 var(--step--1)/1.6 var(--mono); word-break: break-all; }
.year[hidden], .pub[hidden] { display: none !important; }
.pub-note { margin-top: 2rem; color: var(--muted); }

/* People */
.pi {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem;
  padding: 1.75rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 2.5rem;
}
.pi h3 { font-size: var(--step-2); margin-top: 0.4rem; }
.pi .role { color: var(--muted); margin-top: 0.4rem; }
.pi p { color: #d6d0e2; }
.pi dl { display: grid; gap: 0.6rem; margin: 1rem 0 0; }
.pi dt { font: 500 0.6875rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.pi dd { margin: 0; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 2rem 2.5rem; }
.group h3 { font-size: var(--step-0); font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink); padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 0.75rem; }
.group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.group li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.group li span:last-child { color: var(--muted); font-size: 0.9375rem; }
.names { color: #d6d0e2; font-size: 0.9375rem; line-height: 1.8; }
.names b { display: block; font: 500 0.6875rem/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.75rem; }
.collabs { margin-top: 3rem; }
.collabs-head { font-size: var(--step-0); font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink); padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.collab-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 40rem) {
  .collab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collab:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.collab { padding: 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.collab h4 { margin: 0; font: 600 var(--step-1)/1.2 var(--display); }
.collab h4 a { color: var(--fg); text-decoration: none; }
.collab h4 a:hover { color: var(--teal); }
.collab p { color: #d6d0e2; font-size: 0.9375rem; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; }
.contact address { font-style: normal; color: #d6d0e2; line-height: 1.7; }
.email-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-block: 1rem; }
.email-row span { font: 500 var(--step-1)/1.3 var(--mono); color: var(--fg); user-select: all; word-break: break-all; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.links a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  color: var(--fg); text-decoration: none; font-weight: 600;
}
.links a span { font: 400 var(--step--1)/1 var(--mono); color: var(--muted); }
.links a:hover { border-color: var(--pink); }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: 2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: var(--step--1); }

/* ---------- Narrow screens ---------- */
@media (max-width: 52rem) {
  .hero .wrap, .pi, .contact, .nocturn { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { padding-block: 2.5rem; }
  .scan { max-width: 28rem; }
  .year { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  section > .wrap { padding-block: 3.25rem; }
}
@media (max-width: 30rem) {
  .nav { gap: 0.9rem; }
}

/* ---------- Labeled specimen viewer ---------- */
.model.labeled { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; }
.model.labeled .stage { aspect-ratio: 16 / 10; min-height: 22rem; }
.model.labeled figcaption { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.label-panel { border-left: 1px solid var(--line); padding: 1rem 0.75rem 1rem 1rem; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0.6rem; min-height: 0; }
.label-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 30rem; display: grid; gap: 1px; align-content: start; }
.label-item {
  width: 100%; display: grid; grid-template-columns: 10px 1.6rem minmax(0, 1fr); gap: 0.5rem; align-items: center;
  text-align: left; padding: 0.4rem 0.5rem; border: 0; border-radius: 4px; background: transparent;
  color: var(--fg); font: 400 0.875rem/1.3 var(--body); cursor: pointer;
}
.label-item:hover { background: var(--panel-2); }
.label-item[aria-current="true"] { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--pink); }
.label-item .sw { width: 10px; height: 10px; border-radius: 2px; }
.label-item .ln { font: 500 0.75rem/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

.hotspot {
  display: block; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--fg); color: var(--ink);
  box-shadow: 0 0 0 2px var(--dot, var(--pink)); cursor: pointer; position: relative;
  transition: opacity 0.2s, transform 0.2s;
}
.hotspot .num { font: 600 10px/18px var(--mono); display: block; text-align: center; }
.hotspot:not([data-visible]) { opacity: 0.4; }
.hotspot.on { opacity: 1 !important; }
.hotspot .tip {
  position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 0.3rem 0.55rem; border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--fg);
  border: 1px solid var(--line); font: 500 0.8125rem/1.2 var(--body);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.hotspot:hover .tip, .hotspot:focus-visible .tip, .hotspot.on .tip { opacity: 1; }
.hotspot.on { background: var(--pink); transform: scale(1.15); z-index: 2; }
.labels-off .hotspot { display: none; }

.view-tools {
  position: absolute; left: 0.75rem; bottom: 0.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.tool {
  font: 500 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.5rem 0.7rem; border-radius: 999px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 80%, transparent); color: var(--fg); cursor: pointer;
}
.tool:hover { border-color: var(--teal); }
.tool[aria-pressed="false"] { color: var(--muted); }

@media (max-width: 52rem) {
  .model.labeled { grid-template-columns: minmax(0, 1fr); }
  .model.labeled .stage { aspect-ratio: 4 / 3; min-height: 18rem; }
  .label-panel { border-left: 0; border-top: 1px solid var(--line); }
  .label-list { max-height: 14rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
}

/* ---------- Publications page ---------- */
.nav a[aria-current="page"] { color: var(--pink); }
.subpage > section:first-child { border-top: 0; }
.page-title { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
.people-more { margin-top: 2.5rem; }
.collab h4 a::after { content: " ↗"; font-size: 0.8em; color: var(--teal); }

/* ======================================================
   Multi-page layout (v2): dropdown menu, home, footer
   ====================================================== */

/* Dropdown menu, upper right */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
  font: 500 var(--step--1)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg);
  background: var(--panel);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { border-color: var(--pink); }
.menu-icon { display: grid; gap: 3px; width: 16px; }
.menu-icon i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.2s, opacity 0.2s; }
.menu[open] .menu-icon i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu[open] .menu-icon i:nth-child(2) { opacity: 0; }
.menu[open] .menu-icon i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 14rem; z-index: 20;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45); padding: 0.4rem;
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu-panel a {
  display: block; padding: 0.65rem 0.8rem; border-radius: 5px; text-decoration: none;
  color: var(--fg); font: 600 0.9375rem/1.2 var(--body);
}
.menu-panel a:hover { background: var(--panel-2); color: var(--fg); }
.menu-panel a[aria-current="page"] { color: var(--pink); box-shadow: inset 2px 0 0 var(--pink); background: var(--panel-2); }
@media (prefers-reduced-motion: reduce) { .menu-icon i { transition: none; } }

/* Home hero with CT image */
.hero-image { margin: 0; display: grid; gap: 0.6rem; }
.hero-image img {
  width: 100%; height: auto; border-radius: 6px; background: #000;
  border: 1px solid var(--line); box-shadow: 0 0 60px rgba(46, 211, 198, 0.12), 0 0 90px rgba(255, 95, 162, 0.10);
}
.hero-image figcaption { font: 500 0.75rem/1.4 var(--mono); color: var(--muted); letter-spacing: 0.04em; }

/* What we do */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem; }
.pillar { padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 0.6rem; align-content: start; min-width: 0; }
.pillar p { color: #d6d0e2; }
.pillar-tag { font: 700 var(--step-1)/1.2 var(--display); }
.pillar-tag.k1 { color: var(--pink); } .pillar-tag.k2 { color: var(--purple); } .pillar-tag.k3 { color: var(--teal); }
.more { margin-top: 1.5rem; font-weight: 600; }

/* PI on home */
.pi-home { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.pi-photo { margin: 0; aspect-ratio: 4 / 5; max-width: 100%; border-radius: 6px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255,95,162,0.25), rgba(164,123,255,0.2) 50%, rgba(46,211,198,0.22)), var(--panel);
  display: grid; place-items: center; }
.pi-photo img { width: 100%; height: 100%; object-fit: cover; }
.pi-initials { font: 800 4rem/1 var(--display); color: var(--fg); opacity: 0.85; }
.pi-text { display: grid; gap: 0.75rem; max-width: 44rem; }
.pi-text h2 { font-size: var(--step-3); }
.pi-text .role { color: var(--muted); }
.pi-text p { color: #d6d0e2; }
.pi-text dl { display: grid; gap: 0.6rem; margin: 0.5rem 0 0; }
.pi-text dt { font: 500 0.6875rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.pi-text dd { margin: 0; }

/* Students page */
.group.wide { grid-column: 1 / -1; }
.names-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; }
.names-cols p { margin: 0; }
.names-cols b { margin-top: 0; }

/* Footer */
.site-footer .wrap { padding-block: 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: start; color: var(--muted); font-size: var(--step--1); }
.site-footer .brand { font-size: var(--step-0); }
.foot-id { display: grid; gap: 0.35rem; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.foot-links a { color: var(--fg); text-decoration: none; font-weight: 600; }
.foot-links a:hover { color: var(--pink); }
.foot-copy { grid-column: 1 / -1; }

@media (max-width: 52rem) {
  .pi-home { grid-template-columns: minmax(0, 1fr); }
  .pi-photo { max-width: 16rem; }
  .names-cols { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
}
.people-sub { font-size: var(--step-2); margin: 4rem 0 1.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }

/* Larger menu button */
.menu > summary { padding: 0.8rem 1.25rem; gap: 0.8rem; font-size: 0.9375rem; border-width: 1.5px; }
.menu-icon { width: 22px; gap: 4px; }
.menu-icon i { height: 2.5px; }
.menu[open] .menu-icon i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu[open] .menu-icon i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.menu-panel { min-width: 16rem; }
.menu-panel a { padding: 0.8rem 1rem; font-size: 1.0625rem; }

/* ======================================================
   Accessibility pass
   ====================================================== */
/* Interactive controls get a border that meets 3:1 against every surface */
.btn, .chip, .tool, .menu > summary, .links a { border-color: var(--line-strong); }
.btn.primary { border-color: var(--pink); }

/* Topic markers use shape as well as color, so they stay distinct with color blindness:
   evolution = circle, imaging = square, human anatomy = diamond */
.pub::before, .chip i { border-radius: 0; }
.pub[data-topic="evo"]::before, .chip[data-filter="evo"] i { border-radius: 50%; }
.pub[data-topic="imaging"]::before, .chip[data-filter="imaging"] i { border-radius: 1px; }
.pub[data-topic="clinical"]::before, .chip[data-filter="clinical"] i { border-radius: 1px; transform: rotate(45deg) scale(0.9); }
.pub::before { width: 9px; height: 9px; }
.chip i { width: 9px; height: 9px; flex: none; }

/* Collaborator manuscript links and highlighting */
.collab-pubs { justify-self: start; margin-top: 0.4rem; font: 600 0.875rem/1.3 var(--body); color: var(--teal); }
.with-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  margin-bottom: 2rem; padding: 1rem 1.25rem; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line-strong); box-shadow: inset 3px 0 0 var(--pink);
}
.with-banner p { margin: 0; }
.collab-view .pub { opacity: 0.6; transition: opacity 0.2s; }
.collab-view .pub.hl {
  opacity: 1; background: var(--panel); border-radius: 6px; padding: 0.9rem 1rem;
  box-shadow: inset 3px 0 0 var(--pink); margin-inline: -1rem 0;
}
.collab-view .pub.hl .t::after {
  content: "Collaborative"; margin-left: 0.6rem; vertical-align: 0.15em;
  font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--pink); border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.45rem; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .collab-view .pub { transition: none; } }

/* ---------- v3 additions ---------- */
/* Submenu item (3D Models under Open Science) */
.menu-panel li.sub a { padding-left: 2rem; font-weight: 500; font-size: 0.9875rem; color: var(--muted); position: relative; }
.menu-panel li.sub a::before { content: ""; position: absolute; left: 1.05rem; top: 50%; width: 0.55rem; height: 1px; background: var(--line-strong); }
.menu-panel li.sub a:hover, .menu-panel li.sub a[aria-current="page"] { color: var(--fg); }
.menu-panel li.sub a[aria-current="page"] { color: var(--pink); }

/* Collaborator institution */
.collab-inst { font: 500 var(--step--1)/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: -0.2rem; }

/* Join the lab */
.join { margin-bottom: 3.5rem; }
.join h2 { font-size: var(--step-2); margin-bottom: 1.25rem; }
.join-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1.25rem; }
.join-grid article { padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 0.7rem; align-content: start; }
.join-grid h3 { color: var(--pink); }
.join-grid p { color: #d6d0e2; }

/* Invited talks */
.talk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; max-width: 62rem; }
.talk { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; }
.talk-year { font: 600 var(--step-0)/1.6 var(--mono); color: var(--purple); font-variant-numeric: tabular-nums; }
.talk .t { font-weight: 600; }
.talk .j { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 52rem) { .talk { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }

/* Publication figure thumbnails (optional, via data-fig) */
.pub.has-fig { grid-template-columns: 10px minmax(0, 1fr) 9rem; }
.pub-fig { width: 9rem; height: 6.5rem; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); }
@media (max-width: 40rem) { .pub.has-fig { grid-template-columns: 10px minmax(0, 1fr); } .pub-fig { grid-column: 2; width: 100%; height: auto; max-height: 12rem; } }

/* Funding page */
.funders { display: grid; gap: 1.5rem; }
.funder { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; border-top: 0; }
.funder-head { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.funder-head h2 { font-size: var(--step-1); }
.award-list { list-style: none; margin: 0; padding: 0.4rem 1.4rem; }
.award { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.award:last-child { border-bottom: 0; }
.award-year { font: 600 var(--step--1)/1.6 var(--mono); color: var(--purple); font-variant-numeric: tabular-nums; }
.award-body { display: grid; gap: 0.25rem; }
.award-name { font-weight: 600; }
.award-title { color: #d6d0e2; font-size: 0.9375rem; }
.award-role { font: 500 var(--step--1)/1.4 var(--mono); color: var(--muted); }
.award-amt { font: 600 0.9375rem/1.6 var(--mono); color: var(--teal); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .award { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .award-amt { text-align: left; }
}

/* Open Science page */
.os-feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; align-items: center;
  padding: 1.25rem; margin-bottom: 1.5rem; border-radius: 8px; text-decoration: none; color: var(--fg);
  background: linear-gradient(110deg, rgba(255,95,162,0.14), rgba(46,211,198,0.10)); border: 1px solid var(--line-strong);
}
.os-feature:hover { border-color: var(--pink); color: var(--fg); }
.os-feature img { width: 100%; height: auto; border-radius: 6px; background: #000; }
.os-feature > div { display: grid; gap: 0.7rem; justify-items: start; }
.os-feature h2 { font-size: var(--step-2); }
.os-feature p:not(.label) { color: #d6d0e2; }
.os-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1.25rem; }
.os-card { padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 0.9rem; align-content: start; min-width: 0; }
.os-card h2 { font-size: var(--step-2); }
.os-card h3 { font-size: var(--step-0); font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink); margin-top: 0.6rem; }
.os-card p { color: #d6d0e2; }
.os-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.os-links li { display: grid; gap: 0.1rem; }
.os-links a { font-weight: 600; }
.os-links span { color: var(--muted); font-size: 0.875rem; }
.os-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; color: #d6d0e2; }
.os-list b { color: var(--fg); }
.press { max-width: 52rem; }
@media (max-width: 52rem) { .os-feature { grid-template-columns: minmax(0, 1fr); } }
.crumb { color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--pink); }
.teach .award { grid-template-columns: 6.5rem minmax(0, 1fr); }
.teach .funder-head .award-role { margin-top: 0.25rem; }
.code { font: 500 var(--step--1)/1 var(--mono); color: var(--muted); margin-left: 0.4rem; white-space: nowrap; }
.mentor-note { max-width: 46rem; color: #d6d0e2; }
@media (max-width: 40rem) { .teach .award { grid-template-columns: minmax(0, 1fr); } }
.pi-home.member { margin-top: 3.5rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.group.current { max-width: 36rem; }
.group.current ul { gap: 0.7rem; }

/* Four "What we do" cards: 4 across on wide screens, 2 on tablets, 1 on phones */
.pillar-tag.k4 { color: var(--fg); }
.pillars { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Study species band (home) */
.species-band {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: clamp(1.25rem, 3vw, 2.25rem);
  background: linear-gradient(160deg, rgba(255,95,162,0.10), rgba(164,123,255,0.08) 45%, rgba(46,211,198,0.10)), var(--panel);
}
.species-band .section-head { margin-bottom: 1.75rem; }
.species-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.25rem; }
.species { background: var(--ink); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.species-photo { margin: 0; aspect-ratio: 4 / 3; max-width: 100%; background: var(--panel-2); display: grid; place-items: center; }
.species-photo img { width: 100%; height: 100%; object-fit: cover; }
.species-ph { font: 600 var(--step-0)/1.3 var(--display); color: var(--muted); text-align: center; padding: 1rem;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 14px 14px; width: 100%; height: 100%; display: grid; place-items: center; }
.species-body { padding: 1.25rem; display: grid; gap: 0.55rem; align-content: start; }
.species-body h3 { font-size: var(--step-1); }
.species-sci { color: var(--teal); font-size: 1.0625rem; }
.species-status { font: 500 var(--step--1)/1.3 var(--mono); color: var(--fg); text-transform: uppercase; letter-spacing: 0.06em; }
.species-status span { color: var(--muted); margin-right: 0.4rem; }
.species-body p:not([class]) { color: #d6d0e2; font-size: 0.9375rem; }
.species-cite { font-size: 0.8125rem; color: var(--muted); padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.species-photo { position: relative; }
.photo-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.35rem 0.6rem; font: 400 0.6875rem/1.35 var(--body);
  color: #f2eef8; background: rgba(11,10,16,0.78); }
.photo-credit a { color: #f2eef8; }

/* Systems we study (home) */
.systems-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 48rem) { .systems-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.system { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.system-img { margin: 0; border-radius: 6px; display: grid; place-items: center; padding: 0.75rem; min-height: 12rem;
  background: radial-gradient(circle at 50% 45%, var(--panel-2), var(--ink)); border: 1px solid var(--line); }
.system-img img { max-height: 15rem; width: auto; max-width: 100%; object-fit: contain; }
.system-body { display: grid; gap: 0.75rem; align-content: start; }
.system-body h3 { font-size: var(--step-2); }
.system-body > p:not(.system-abs) { color: #d6d0e2; font-size: 0.9375rem; }
.system-body .os-links a { font-size: 0.9375rem; }
.system-abs { font-size: 0.8125rem; color: var(--muted); padding-top: 0.6rem; border-top: 1px dashed var(--line); }
@media (max-width: 34rem) { .system { grid-template-columns: minmax(0, 1fr); } .system-img { min-height: 10rem; } }
/* Systems cards: image banner on top */
.system { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; padding: 0; overflow: hidden; gap: 0; }
.system-img { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; height: 17rem; min-height: 0; padding: 1rem; }
.system-img img { max-height: 100%; height: 100%; }
.system-body { padding: 1.25rem 1.4rem 1.4rem; }
@media (max-width: 34rem) { .system-img { height: 13rem; } }
.system-img { display: block; overflow: hidden; }
.system-img img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.system-img { position: relative; }
.system-img .photo-credit { position: absolute; }

/* Species fact list */
.species-facts { margin: 0.2rem 0 0; display: grid; gap: 0.55rem; }
.species-facts div { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 0.6rem; }
.species-facts dt { font: 500 0.6875rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.species-facts dd { margin: 0; color: #d6d0e2; font-size: 0.9rem; line-height: 1.45; }

/* ---------- Research by system ---------- */
.rnav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.rnav .chip { text-decoration: none; color: var(--fg); }
.rnav .chip:hover { border-color: var(--pink); }
.rsys { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 2.5rem; padding-block: 3rem; border-top: 1px solid var(--line); scroll-margin-top: 5rem; }
.rsys-side { display: grid; gap: 0.9rem; align-content: start; position: sticky; top: 6rem; align-self: start; }
.rsys-side h2 { font-size: var(--step-3); }
.rsys-side p { color: #d6d0e2; }
.rsys-img { margin: 0; position: relative; height: 15rem; padding: 1rem; border-radius: 8px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, var(--panel-2), var(--ink)); border: 1px solid var(--line); }
.rsys-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rsys-img .photo-credit { position: absolute; }
.rsys-list { display: grid; gap: 1rem; align-content: start; }
.rproj { padding: 1.25rem 1.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 0.55rem; min-width: 0; }
.rproj h3 { font-size: var(--step-1); }
.rtaxon { color: var(--teal); font-size: 0.9375rem; }
.rproj > p:not([class]) { color: #d6d0e2; }
.rpeople { font: 500 var(--step--1)/1.5 var(--mono); color: var(--muted); }
.rproj footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding-top: 0.7rem; border-top: 1px dashed var(--line); }
.status.review { color: var(--purple); }
.rlinks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.875rem; color: var(--muted); }
#research .nocturn { margin-top: 1rem; }
@media (max-width: 56rem) {
  .rsys { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: 2.25rem; }
  .rsys-side { position: static; }
  .rsys-img { height: 12rem; }
}
.outreach-noc { margin: 0 0 2rem; }
.outreach-noc .os-list { margin-top: 0.75rem; }
.talk { grid-template-columns: 7.5rem minmax(0, 1fr); }
@media (max-width: 52rem) { .talk { grid-template-columns: minmax(0, 1fr); } }
#outreach .outreach-noc { margin-bottom: 3.25rem; }

/* ---------- Otter Evolution (game) ---------- */
.og { display: grid; gap: 1rem; --og-font: "Fredoka", "IBM Plex Sans", system-ui, sans-serif; }
.og-stage { height: clamp(380px, 54vw, 540px); position: relative; border-radius: 18px; overflow: hidden; border: 4px solid #0b0a10; box-shadow: 0 0 0 3px var(--pink), 0 10px 0 #0b0a10, 0 14px 30px rgba(0,0,0,0.45); background: #2b1d5c; }
#og-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
#og-canvas:focus-visible { box-shadow: inset 0 0 0 4px var(--teal); }
.og-hud { position: absolute; inset: 0.6rem; pointer-events: none; }
.og-pill { font: 700 0.85rem/1 var(--og-font); color: #fff; background: rgba(11,10,16,0.82); border: 2px solid #fff; padding: 0.4rem 0.7rem; border-radius: 999px; letter-spacing: 0.02em; }
.og-pill.pink { background: var(--pink); color: #0b0a10; border-color: #0b0a10; }
.og-pill.teal { background: var(--teal); color: #0b0a10; border-color: #0b0a10; }
.og-mute { pointer-events: auto; cursor: pointer; margin-left: auto; }
.og-timer { flex: 1 1 6rem; min-width: 5rem; height: 14px; border-radius: 999px; background: rgba(11,10,16,0.82); border: 2px solid #fff; overflow: hidden; }
.og-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--pink), #ffb347); }
.og-toast { position: absolute; left: 50%; bottom: 0.8rem; transform: translateX(-50%); max-width: calc(100% - 1.5rem); text-align: center; font: 700 1rem/1.25 var(--og-font); color: #0b0a10; background: #ffe066; border: 3px solid #0b0a10; box-shadow: 0 4px 0 #0b0a10; padding: 0.5rem 0.9rem; border-radius: 14px; pointer-events: none; }
.og-screen { position: absolute; inset: 0; overflow-y: auto; display: grid; place-items: center; padding: 1rem; background: rgba(11,10,16,0.35); }
.og-card { font-family: var(--og-font); width: min(100%, 34rem); background: #fff; color: #1b1530; border: 4px solid #0b0a10; border-radius: 22px; box-shadow: 0 8px 0 #0b0a10; padding: 1.3rem 1.4rem; display: grid; gap: 0.8rem; text-align: center; margin: auto; }
.og-card.og-wide { width: min(100%, 46rem); }
.og-badge { justify-self: center; font: 700 0.8rem/1 var(--og-font); text-transform: uppercase; letter-spacing: 0.08em; background: var(--purple); color: #fff; border: 2px solid #0b0a10; padding: 0.4rem 0.7rem; border-radius: 999px; }
.og-logo { font: 700 clamp(2.6rem, 8vw, 3.8rem)/0.92 var(--og-font); color: var(--pink); -webkit-text-stroke: 2px #0b0a10; text-shadow: 0 5px 0 #0b0a10; letter-spacing: 0.01em; }
.og-logo span { color: var(--teal); }
.og-h { font: 700 clamp(1.4rem, 4vw, 1.9rem)/1.1 var(--og-font); color: #1b1530; }
.og-h3 { font: 700 1.1rem/1.2 var(--og-font); color: #1b1530; margin-top: 0.3rem; }
.og-sub { font: 500 1rem/1.4 var(--og-font); color: #4a4160; }
.og-sub b { color: #c2185b; }
.og-steps { list-style: none; counter-reset: s; display: grid; gap: 0.5rem; text-align: left; padding: 0; margin: 0; }
.og-steps li { counter-increment: s; display: grid; grid-template-columns: 2rem minmax(0,1fr); gap: 0.6rem; align-items: center; font: 500 0.92rem/1.3 var(--og-font); color: #4a4160; background: #f3eefc; border: 2px solid #d9cff0; border-radius: 12px; padding: 0.5rem 0.7rem; }
.og-steps li::before { content: counter(s); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--teal); color: #0b0a10; border: 2px solid #0b0a10; font-weight: 700; }
.og-steps b { color: #1b1530; }
.og-btn { justify-self: center; font: 700 1.25rem/1 var(--og-font); color: #0b0a10; background: #3ddc6f; border: 3px solid #0b0a10; border-radius: 14px; padding: 0.85rem 1.8rem; box-shadow: 0 6px 0 #0b0a10; cursor: pointer; transition: transform 0.08s, box-shadow 0.08s; }
.og-btn:hover { background: #5af08a; }
.og-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #0b0a10; }
.og-btn:focus-visible { outline: 4px solid var(--pink); outline-offset: 3px; }
.og-btn:disabled { background: #cfc8dc; cursor: default; transform: none; box-shadow: 0 6px 0 #0b0a10; }
.og-btn.ghost { background: #fff; font-size: 1rem; }
.og-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.og-habs { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.7rem; }
.og-hab { font-family: var(--og-font); text-align: left; display: grid; gap: 0.25rem; align-content: start; padding: 0.85rem 0.9rem; border: 3px solid #0b0a10; border-radius: 16px; box-shadow: 0 5px 0 #0b0a10; color: #fff; cursor: pointer; text-shadow: 0 2px 0 rgba(0,0,0,0.45); transition: transform 0.08s, box-shadow 0.08s; }
.og-hab b { font-size: 1.1rem; font-weight: 700; }
.og-hab span { font-size: 0.85rem; font-weight: 500; line-height: 1.3; }
.og-hab em { font-style: normal; justify-self: start; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; background: #ffe066; color: #0b0a10; text-shadow: none; border-radius: 999px; padding: 0.2rem 0.5rem; margin-top: 0.2rem; }
.og-hab:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #0b0a10; }
.og-hab:active { transform: translateY(4px); box-shadow: 0 1px 0 #0b0a10; }
.og-hab:focus-visible { outline: 4px solid var(--pink); outline-offset: 2px; }
.og-hab-snow { background: linear-gradient(160deg, #6f6aa8, #3b3a7a); }
.og-hab-desert { background: linear-gradient(160deg, #ff8a5c, #b0457a); }
.og-hab-fast { background: linear-gradient(160deg, #3f9fc8, #17506e); }
.og-hab-slow { background: linear-gradient(160deg, #6f9f5a, #2f5a3a); }
.og-hab-murky { background: linear-gradient(160deg, #9a7a4c, #4f3a22); }
.og-hab-lake { background: linear-gradient(160deg, #2b8fc0, #1e2f7a); }
.og-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr)); gap: 0.45rem; }
.og-otter { position: relative; background: #e6f6fb; border: 3px solid #0b0a10; border-radius: 12px; overflow: hidden; transition: opacity 0.3s, filter 0.3s, transform 0.3s; }
.og-otter canvas { display: block; width: 100%; height: auto; }
.og-otter.lost { opacity: 0.35; filter: grayscale(1); transform: scale(0.92); }
.og-otter.lost::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 2.4rem/1 var(--og-font); color: #d81b60; }
.og-you, .og-mut { position: absolute; top: 3px; font: 700 0.6rem/1 var(--og-font); letter-spacing: 0.04em; border: 2px solid #0b0a10; border-radius: 999px; padding: 0.15rem 0.35rem; }
.og-you { left: 3px; background: var(--pink); color: #0b0a10; }
.og-mut { top: auto; bottom: 3px; left: 3px; background: #ffe066; color: #0b0a10; }
.og-result { font: 700 1.1rem/1.2 var(--og-font); color: #1b1530; min-height: 1.3em; }
.og-changes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.4rem; text-align: left; }
.og-changes li { display: flex; align-items: center; gap: 0.5rem; font: 500 0.95rem/1.2 var(--og-font); background: #f3eefc; border: 2px solid #d9cff0; border-radius: 10px; padding: 0.45rem 0.6rem; color: #1b1530; }
.og-changes li i { width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 2px solid #0b0a10; flex: none; }
.og-changes b { margin-left: auto; font-weight: 700; color: #6b6380; }
.og-changes b.up { color: #138a4a; } .og-changes b.down { color: #c2185b; }
.og-table-wrap { overflow-x: auto; border: 3px solid #0b0a10; border-radius: 12px; }
.og-table { width: 100%; border-collapse: collapse; font: 500 0.9rem/1.2 var(--og-font); color: #1b1530; }
.og-table th, .og-table td { padding: 0.45rem 0.55rem; border-bottom: 2px solid #e6def5; text-align: center; white-space: nowrap; }
.og-table th:first-child { text-align: left; }
.og-table thead th { background: #1b1530; color: #fff; font-weight: 700; font-size: 0.8rem; }
.og-table tr.start { background: #f3eefc; color: #6b6380; }
.og-pads { display: none; gap: 0.7rem; justify-content: center; }
.pad { width: 4rem; height: 4rem; border-radius: 16px; border: 3px solid #0b0a10; background: var(--purple); color: #fff; box-shadow: 0 5px 0 #0b0a10;
  font-size: 1.4rem; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad:active { transform: translateY(4px); box-shadow: 0 1px 0 #0b0a10; background: var(--pink); }
@media (hover: none), (max-width: 52rem) { .og-pads { display: flex; } }
.og-help { color: var(--muted); font-size: 0.9375rem; }
.og-help b { color: var(--fg); }
.k-fish { color: var(--teal); font-weight: 600; } .k-cray { color: #ff8a5c; font-weight: 600; }
.og-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 52rem) { .og-panels { grid-template-columns: minmax(0, 1fr); } }
.og-panel { background: var(--panel); border: 2px solid var(--line-strong); border-radius: 16px; padding: 1.1rem 1.2rem; display: grid; gap: 0.8rem; align-content: start; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.og-panel h2 { font: 700 var(--step-1)/1.1 var(--og-font); }
.og-anat figure { margin: 0; display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.8rem; align-items: center; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem; }
.og-anat canvas { width: 9rem; height: 7.5rem; display: block; }
.og-anat figcaption { display: grid; gap: 0.25rem; font-size: 0.875rem; color: #d6d0e2; }
.og-anat figcaption b { font-family: var(--og-font); font-size: 1rem; color: var(--fg); }
.og-fact { border-color: var(--teal); box-shadow: inset 4px 0 0 var(--teal); }
.og-kicker { font: 700 0.75rem/1 var(--og-font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); background: var(--teal); justify-self: start; padding: 0.3rem 0.55rem; border-radius: 999px; }
.og-fact h3 { font: 700 var(--step-1)/1.15 var(--og-font); color: var(--teal); }
.og-fact p:not(.og-kicker):not(.label) { color: #d6d0e2; font-size: 0.9375rem; }
.og-known { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 0.5rem 0.65rem; color: var(--fg) !important; font-style: italic; }
.og-known span { font: 600 0.7rem/1 var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink); display: block; margin-bottom: 0.3rem; }
.og-fact a { font-weight: 600; }
.og-fact.pulse { animation: factpulse 0.8s ease; }
@keyframes factpulse { 0% { background: var(--panel-2); } 100% { background: var(--panel); } }
#og-chart { width: 100%; height: 11rem; display: block; }
.og-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.8125rem; color: #d6d0e2; }
.og-legend li { display: flex; align-items: center; gap: 0.35rem; }
.og-legend i { width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.og-full { grid-column: 1 / -1; }
.og-panel-sub { color: #d6d0e2; font-size: 0.9375rem; }
.og-count { font: 700 0.9rem/1 var(--og-font); color: var(--ink); background: #ffe066; border: 2px solid #0b0a10; border-radius: 999px; padding: 0.35rem 0.65rem; }
.og-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.7rem; }
.og-tile { font-family: var(--og-font); display: grid; gap: 0.2rem; align-content: start; text-align: center; padding: 0.5rem 0.5rem 0.7rem; background: #e6f6fb; color: #1b1530; border: 3px solid #0b0a10; border-radius: 14px; box-shadow: 0 4px 0 #0b0a10; min-width: 0; }
button.og-tile { cursor: pointer; transition: transform 0.08s, box-shadow 0.08s; }
button.og-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #0b0a10; }
button.og-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b0a10; }
button.og-tile:focus-visible { outline: 4px solid var(--pink); outline-offset: 2px; }
.og-tile[aria-pressed="true"] { background: #ffd1e6; box-shadow: 0 4px 0 #0b0a10, inset 0 0 0 3px var(--pink); }
.og-tile canvas { width: 100%; height: auto; display: block; }
.og-tile b { font-size: 0.95rem; font-weight: 700; line-height: 1.15; }
.og-tile span { font-size: 0.78rem; font-weight: 500; line-height: 1.25; color: #4a4160; }
.og-tile.locked { background: var(--ink); color: var(--muted); border-color: var(--line-strong); border-style: dashed; box-shadow: none; }
.og-tile.locked b { color: var(--muted); letter-spacing: 0.1em; }
.og-tile.locked span { color: #b9b1cc; }
.og-new { position: absolute; right: 3px; top: 3px; font: 700 0.6rem/1 var(--og-font); letter-spacing: 0.04em; border: 2px solid #0b0a10; border-radius: 999px; padding: 0.15rem 0.35rem; background: #3ddc6f; color: #0b0a10; }
.og-note { font-size: 0.8125rem; color: var(--muted); max-width: 52rem; }
@media (prefers-reduced-motion: reduce) { .og-fact.pulse { animation: none; } .og-otter, .og-btn, .og-hab, button.og-tile { transition: none; } }
.os-game { margin-top: 1rem; grid-template-columns: minmax(0, 1fr); background: linear-gradient(110deg, rgba(46,211,198,0.14), rgba(164,123,255,0.14)); }
.fact-log { margin-top: 0.4rem; padding-top: 0.8rem; border-top: 1px dashed var(--line); display: grid; gap: 0.5rem; }
.fact-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fact-chip { font: 500 0.75rem/1.2 var(--body); padding: 0.35rem 0.6rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--ink); color: #d6d0e2; cursor: pointer; }
.fact-chip[aria-pressed="true"] { border-color: var(--teal); color: var(--teal); }
/* ---------- Otter Evolution 3D HUD ---------- */
#og-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#og-3d:focus-visible { box-shadow: inset 0 0 0 4px var(--teal); }
.og-flash { position: absolute; inset: 0; pointer-events: none; background: rgba(255,40,80,0.45); opacity: 0; }
.og-flash.on { animation: ogflash 0.5s ease; }
@keyframes ogflash { 0% { opacity: 1; } 100% { opacity: 0; } }
.og-hud-top { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.og-hud-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.4rem; }
.og-hearts { display: flex; gap: 0.15rem; font: 700 1.5rem/1 var(--og-font); background: rgba(11,10,16,0.82); border: 2px solid #fff; border-radius: 999px; padding: 0.15rem 0.5rem; }
.og-hearts i { font-style: normal; color: #ff3b5c; text-shadow: 0 2px 0 #0b0a10; }
.og-hearts i.lost { color: #4a4160; }
.og-energy { display: flex; align-items: center; gap: 0.4rem; font: 700 0.8rem/1 var(--og-font); color: #fff; background: rgba(11,10,16,0.82); border: 2px solid #fff; border-radius: 999px; padding: 0.35rem 0.6rem; }
.og-energy > span { width: 6.5rem; height: 10px; border-radius: 999px; background: #2b2540; overflow: hidden; }
.og-energy i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc6f, #ffe066); transition: width 0.2s; }
.og-energy.low i { background: #ff3b5c; animation: oglow 0.6s infinite alternate; }
@keyframes oglow { to { opacity: 0.4; } }
.og-tasks { position: absolute; left: 0; top: 5.6rem; display: grid; gap: 0.3rem; max-width: 15rem; font: 600 0.85rem/1.2 var(--og-font); color: #1b1530; background: rgba(255,255,255,0.92); border: 3px solid #0b0a10; border-radius: 14px; box-shadow: 0 4px 0 #0b0a10; padding: 0.55rem 0.7rem; }
.og-tasks b { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7a3fd0; }
.og-tasks span.done { color: #138a4a; text-decoration: line-through; }
.og-tasks em { font-style: normal; color: #c2185b; font-weight: 700; }
.og-map { position: absolute; right: 0; top: 5.6rem; width: 120px; height: 120px; border: 3px solid #0b0a10; border-radius: 14px; box-shadow: 0 4px 0 #0b0a10; background: #000; }
.og-goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.og-goals li { font: 700 1.05rem/1.2 var(--og-font); color: #1b1530; background: #fff6cc; border: 3px solid #0b0a10; border-radius: 12px; padding: 0.55rem 0.8rem; box-shadow: 0 3px 0 #0b0a10; }
.og-goals li::before { content: "★ "; color: #ff5fa2; }
.og-tips { display: grid; gap: 0.3rem; text-align: left; background: #e6f6fb; border: 2px solid #a8dcea; border-radius: 12px; padding: 0.6rem 0.8rem; font: 500 0.9rem/1.3 var(--og-font); color: #1b1530; }
.og-tips b { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #17506e; }
.og-keys { font: 500 0.85rem/1.3 var(--og-font); color: #6b6380; }
.pad-wide { width: auto; padding: 0 1rem; font: 700 1rem/1 var(--og-font); background: var(--pink); color: #0b0a10; }
.pad.teal { background: var(--teal); }
@media (max-width: 40rem) {
  .og-tasks { top: auto; bottom: 0; max-width: 11.5rem; font-size: 0.75rem; padding: 0.4rem 0.55rem; }
  .og-map { width: 84px; height: 84px; top: auto; bottom: 0; }
  .og-energy > span { width: 4.5rem; }
  .og-hearts { font-size: 1.2rem; }
}
.og-pads { flex-wrap: wrap; }
@media (max-width: 40rem) { .pad { width: 3.4rem; height: 3.4rem; } .pad-wide { width: auto; min-width: 5.5rem; } }
@media (max-width: 40rem) { .og-toast { bottom: auto; top: 42%; } }
/* ---------- Picture directions ---------- */
.og-ic { width: 2rem; height: 2rem; flex: none; display: inline-block; vertical-align: middle; }
.og-goals li { display: flex; align-items: center; gap: 0.6rem; text-align: left; font-size: 1.15rem; }
.og-goals li::before { content: none; }
.og-goals .og-ic { width: 2.4rem; height: 2.4rem; }
.og-brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.6rem; text-align: left; }
.og-brief-grid section { background: #f3eefc; border: 2px solid #d9cff0; border-radius: 14px; padding: 0.55rem 0.7rem; display: grid; gap: 0.35rem; align-content: start; }
.og-mini { font: 700 0.8rem/1 var(--og-font); text-transform: uppercase; letter-spacing: 0.08em; color: #7a3fd0; }
.og-row { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.og-row small { font: 600 0.85rem/1.2 var(--og-font); color: #1b1530; margin-left: 0.2rem; flex: 1 1 6rem; }
.og-arrow { font: 700 1rem/1 var(--og-font); color: #c2185b; }
.og-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; background: #1b1530; border: 3px solid #0b0a10; border-radius: 14px; padding: 0.6rem 0.8rem; }
.og-ctl { display: grid; justify-items: center; gap: 0.3rem; }
.og-ctl small { font: 600 0.8rem/1 var(--og-font); color: #fff; }
.og-arrows { display: grid; justify-items: center; gap: 0.15rem; }
.og-arrows > span, .og-keys-row { display: flex; gap: 0.15rem; }
.og-key { font: 700 0.85rem/1 var(--og-font); min-width: 1.9rem; height: 1.9rem; padding: 0 0.45rem; display: inline-grid; place-items: center; background: #fff; color: #0b0a10; border: 2px solid #0b0a10; border-radius: 7px; box-shadow: 0 3px 0 #a47bff; }
.og-small { font-size: 0.9rem; }
.og-tasks span { display: flex; align-items: center; gap: 0.35rem; }
.og-tasks .og-ic { width: 1.4rem; height: 1.4rem; }
.og-check { font-style: normal; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; background: #3ddc6f; color: #0b0a10; border: 2px solid #0b0a10; border-radius: 50%; font-size: 0.75rem; text-decoration: none; }
@media (max-width: 40rem) { .og-tasks .og-ic, .og-check { width: 1.1rem; height: 1.1rem; } .og-goals li { font-size: 1rem; } }
.og-brief { gap: 0.6rem; }
.og-brief .og-goals { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.og-brief .og-goals li { padding: 0.45rem 0.6rem; font-size: 1rem; }
.og-brief .og-h { font-size: clamp(1.3rem, 3.5vw, 1.6rem); }
.og-brief { padding: 1rem 1.1rem; gap: 0.5rem; }
.og-brief .og-controls { padding: 0.4rem 0.7rem; gap: 0.8rem; }
.og-brief .og-key { min-width: 1.6rem; height: 1.6rem; font-size: 0.78rem; }
.og-brief .og-btn { padding: 0.7rem 1.6rem; }
/* ---------- RPG hotbar and windows ---------- */
.og-hotbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; background: #1b1530; border: 4px solid #0b0a10; border-radius: 18px; box-shadow: 0 6px 0 #0b0a10; padding: 0.5rem; margin-top: 0.4rem; }
.og-slot { position: relative; display: grid; justify-items: center; gap: 0.2rem; padding: 0.5rem 0.25rem 0.45rem; background: linear-gradient(180deg, #3a2f5c, #2a2245); border: 3px solid #0b0a10; border-radius: 14px; box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 4px 0 #0b0a10; color: #fff; cursor: pointer; font-family: var(--og-font); transition: transform 0.08s, box-shadow 0.08s; min-width: 0; }
.og-slot svg { width: 2.4rem; height: 2.4rem; }
.og-slot span { font: 700 0.85rem/1 var(--og-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.og-slot kbd { position: absolute; top: 4px; left: 6px; font: 700 0.65rem/1 var(--og-font); color: #b9b1cc; }
.og-slot:hover { transform: translateY(-2px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 6px 0 #0b0a10; background: linear-gradient(180deg, #4a3d75, #3a2f5c); }
.og-slot:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 1px 0 #0b0a10; }
.og-slot:focus-visible { outline: 4px solid var(--teal); outline-offset: 2px; }
.og-slot.has-new { border-color: #ffe066; animation: ogslot 1.2s ease-in-out infinite; }
@keyframes ogslot { 50% { box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 4px 0 #0b0a10, 0 0 0 5px rgba(255,224,102,0.45); } }
.og-badge-new { position: absolute; top: -9px; right: -7px; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; font: 700 0.95rem/1 var(--og-font); background: #ff3b5c; color: #fff; border: 3px solid #0b0a10; border-radius: 50%; }
.og-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: rgba(11,10,16,0.72); backdrop-filter: blur(3px); }
.og-modal-box { width: min(100%, 56rem); max-height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: #fffaf0; border: 5px solid #0b0a10; border-radius: 22px; box-shadow: 0 0 0 4px #a47bff, 0 12px 0 #0b0a10; overflow: hidden; animation: ogpop 0.18s ease-out; }
@keyframes ogpop { from { transform: scale(0.92); opacity: 0; } }
.og-modal-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; background: linear-gradient(180deg, #a47bff, #7a4fd8); border-bottom: 4px solid #0b0a10; }
.og-modal-bar svg { width: 2.2rem; height: 2.2rem; display: block; }
.og-modal-bar h2 { flex: 1; font: 700 1.5rem/1 var(--og-font); color: #fff; text-shadow: 0 3px 0 #0b0a10; -webkit-text-stroke: 1px #0b0a10; }
.og-close { width: 2.6rem; height: 2.6rem; font: 700 1.2rem/1 var(--og-font); background: #ff3b5c; color: #fff; border: 3px solid #0b0a10; border-radius: 12px; box-shadow: 0 4px 0 #0b0a10; cursor: pointer; }
.og-close:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b0a10; }
.og-close:focus-visible { outline: 4px solid var(--teal); outline-offset: 2px; }
.og-modal-tabs { display: flex; gap: 0.3rem; padding: 0.5rem 0.6rem 0; background: #efe6ff; border-bottom: 3px solid #0b0a10; overflow-x: auto; }
.og-modal-tabs button { display: flex; align-items: center; gap: 0.3rem; flex: none; font: 700 0.85rem/1 var(--og-font); color: #4a4160; background: #ddd0f5; border: 3px solid #0b0a10; border-bottom: none; border-radius: 12px 12px 0 0; padding: 0.35rem 0.6rem; cursor: pointer; }
.og-modal-tabs button svg { width: 1.3rem; height: 1.3rem; }
.og-modal-tabs button[aria-selected="true"] { background: #fffaf0; color: #1b1530; transform: translateY(3px); }
.og-modal-body { overflow-y: auto; padding: 1rem 1.1rem 1.3rem; color: #1b1530; }
.og-window { display: grid; gap: 0.8rem; }
.og-window > header { display: flex; justify-content: flex-end; }
.og-window > header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.og-window > header:not(:has(.og-count)) { display: none; }
.og-modal .og-panel-sub { color: #4a4160; }
.og-modal .og-fact { background: #1b1530; border: 3px solid #0b0a10; border-radius: 16px; padding: 1rem 1.1rem; display: grid; gap: 0.7rem; box-shadow: inset 4px 0 0 var(--teal); }
.og-modal .og-anat { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem; }
.og-modal .og-anat figure { margin: 0; display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.8rem; align-items: center; background: #1b1530; border: 3px solid #0b0a10; border-radius: 14px; padding: 0.6rem; }
.og-modal #og-chart { width: 100%; height: 14rem; display: block; background: #1b1530; border: 3px solid #0b0a10; border-radius: 14px; }
.og-modal .og-legend { color: #1b1530; font-weight: 600; }
.og-modal .og-legend i { border: 2px solid #0b0a10; }
.og-modal .og-tile.locked { background: #2a2245; }
@media (max-width: 40rem) {
  .og-hotbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .og-slot svg { width: 2rem; height: 2rem; }
  .og-slot kbd { display: none; }
  .og-modal-bar h2 { font-size: 1.2rem; }
  .og-modal-tabs button span { display: none; }
  .og-modal .og-anat figure { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .og-modal .og-anat canvas { width: 7.5rem; height: 6.5rem; }
}
@media (prefers-reduced-motion: reduce) { .og-slot.has-new, .og-modal-box { animation: none; } }
.og-window > header { border: 0; padding: 0; margin: 0; background: none; position: static; box-shadow: none; }
/* ---------- Touch controls (Roblox style) ---------- */
.og-touch { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.og-stick { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; background: rgba(255,255,255,0.14); border: 3px solid rgba(255,255,255,0.55); opacity: 0.6; transition: opacity 0.15s; }
.og-stick.on { opacity: 1; background: rgba(255,255,255,0.22); }
.og-stick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,255,255,0.9); border: 3px solid #0b0a10; box-shadow: 0 3px 0 #0b0a10; }
.og-tbtn { position: absolute; pointer-events: auto; display: grid; place-items: center; border-radius: 50%; border: 4px solid #0b0a10; box-shadow: 0 5px 0 #0b0a10; font: 700 1rem/1 var(--og-font); color: #0b0a10; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.og-jump { right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); width: 88px; height: 88px; background: rgba(61,220,111,0.94); font-size: 1.1rem; }
.og-dive { right: calc(max(16px, env(safe-area-inset-right, 0px)) + 100px); bottom: max(26px, env(safe-area-inset-bottom, 0px)); width: 68px; height: 68px; background: rgba(46,211,198,0.94); }
.og-tbtn.on { transform: translateY(4px); box-shadow: 0 1px 0 #0b0a10; filter: brightness(1.1); }
.og-touch-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 80%; text-align: center; font: 700 0.95rem/1.3 var(--og-font); color: #fff; background: rgba(11,10,16,0.75); border: 2px solid #fff; border-radius: 12px; padding: 0.5rem 0.8rem; }
.og-fs { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; font: 700 1.1rem/1 var(--og-font); color: #fff; background: rgba(11,10,16,0.82); border: 2px solid #fff; border-radius: 50%; cursor: pointer; pointer-events: auto; }
.og-hud-top .og-fs, .og-hud-top .og-bag { width: 2.1rem; height: 2.1rem; font-size: 1rem; }
.og-stage.touch .og-tasks { top: auto; bottom: auto; top: 6rem; max-width: 12rem; font-size: 0.78rem; padding: 0.4rem 0.55rem; }
.og-stage.touch .og-map { top: 6rem; bottom: auto; width: 84px; height: 84px; }
.og-stage.touch .og-hud-row { margin-right: 0; }
.og-stage.og-fs-on { position: fixed; inset: 0; z-index: 45; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; box-shadow: none; margin: 0; }
body.og-noscroll { overflow: hidden; }
.og-mini-stick { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #3a2f5c; border: 2px solid #fff; }
.og-mini-stick i { width: 1rem; height: 1rem; border-radius: 50%; background: #fff; border: 2px solid #0b0a10; }
@media (pointer: coarse) and (max-width: 40rem) { .og-stage { height: min(74vh, 620px); } }
@media (max-width: 40rem) { .og-stage.touch .og-tasks { top: 7.6rem; } .og-stage.touch .og-map { top: 7.6rem; } }
.og-touch-hint { top: auto; bottom: 120px; transform: translateX(-50%); }
.og-stage.touch { touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
/* ---------- Corner buttons, settings, landscape ---------- */
.og-corner { position: absolute; z-index: 6; right: 0.6rem; top: 0.6rem; display: flex; gap: 0.35rem; pointer-events: auto; }
.og-hud-top .og-corner { position: static; }
.og-bag { position: relative; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; background: rgba(11,10,16,0.82); border: 2px solid #fff; border-radius: 50%; cursor: pointer; padding: 0.3rem; }
.og-bag svg { width: 100%; height: 100%; }
.og-bag.has-new::after { content: "!"; position: absolute; top: -6px; right: -6px; width: 1.1rem; height: 1.1rem; display: grid; place-items: center; font: 700 0.7rem/1 var(--og-font); background: #ff3b5c; color: #fff; border: 2px solid #0b0a10; border-radius: 50%; }
.og-end { pointer-events: auto; cursor: pointer; background: #3ddc6f; color: #0b0a10; border-color: #0b0a10; }
.og-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.6rem; }
.og-opt { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0.6rem; align-items: center; text-align: left; font-family: var(--og-font); background: #f3eefc; border: 3px solid #0b0a10; border-radius: 16px; box-shadow: 0 4px 0 #0b0a10; padding: 0.6rem 0.8rem; cursor: pointer; color: #1b1530; }
.og-opt .og-ic { grid-row: span 2; width: 2.6rem; height: 2.6rem; }
.og-opt b { font-size: 1.1rem; }
.og-opt span { font-size: 0.85rem; color: #4a4160; }
.og-opt[aria-pressed="true"] { background: #d4f7df; box-shadow: 0 4px 0 #0b0a10, inset 0 0 0 3px #3ddc6f; }
.og-opt[aria-pressed="true"] b::after { content: " ✓"; color: #138a4a; }
.og-opt:focus-visible { outline: 4px solid var(--pink); outline-offset: 2px; }
.og-card .og-mini { text-align: left; margin-top: 0.2rem; }
.og-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; align-items: center; }
.og-modes span { font: 700 0.8rem/1 var(--og-font); background: #efe6ff; border: 2px solid #0b0a10; border-radius: 999px; padding: 0.3rem 0.6rem; color: #1b1530; }
.og-link { font: 700 0.85rem/1 var(--og-font); color: #7a3fd0; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0.3rem; }
/* Phone held sideways: compact HUD that fits a short screen */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .og-stage { height: calc(100vh - 1rem); height: calc(100dvh - 1rem); }
  .og-hud { inset: 0.4rem max(0.5rem, env(safe-area-inset-right, 0px)) 0.4rem max(0.5rem, env(safe-area-inset-left, 0px)); }
  .og-hud-top { flex-wrap: nowrap; gap: 0.3rem; }
  .og-pill { font-size: 0.72rem; padding: 0.3rem 0.5rem; }
  .og-hud-row { margin-top: 0.3rem; }
  .og-hearts { font-size: 1.1rem; }
  .og-energy > span { width: 4.5rem; }
  .og-stage.touch .og-tasks { top: 4.4rem; max-width: 13rem; font-size: 0.72rem; padding: 0.35rem 0.5rem; gap: 0.15rem; }
  .og-stage.touch .og-map { top: 2.6rem; width: 76px; height: 76px; }
  .og-jump { width: 78px; height: 78px; }
  .og-dive { width: 60px; height: 60px; right: calc(max(16px, env(safe-area-inset-right, 0px)) + 90px); }
  .og-stick { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .og-toast { top: 30%; bottom: auto; font-size: 0.85rem; }
  .og-touch-hint { bottom: 90px; }
  .og-card { padding: 0.8rem 1rem; gap: 0.5rem; }
  .og-logo { font-size: 2.2rem; }
  .og-modal-box { max-height: 100%; }
}
/* ---------- Navigation, years, icons, gallery ---------- */
.og-card { position: relative; }
.og-back { position: absolute; left: 0.8rem; top: 0.8rem; font: 700 0.85rem/1 var(--og-font); color: #1b1530; background: #efe6ff; border: 3px solid #0b0a10; border-radius: 10px; box-shadow: 0 3px 0 #0b0a10; padding: 0.4rem 0.6rem; cursor: pointer; z-index: 1; }
.og-back:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b0a10; }
.og-back:focus-visible, .og-wback:focus-visible, .og-home:focus-visible { outline: 4px solid var(--teal); outline-offset: 2px; }
.og-card .og-back + .og-h, .og-card .og-back + .og-badge { margin-top: 1.8rem; }
@media (min-width: 40rem) { .og-card .og-back + .og-h, .og-card .og-back + .og-badge { margin-top: 0.4rem; } }
.og-wback { width: 2.6rem; height: 2.6rem; font: 700 1.1rem/1 var(--og-font); background: #fff; color: #1b1530; border: 3px solid #0b0a10; border-radius: 12px; box-shadow: 0 4px 0 #0b0a10; cursor: pointer; flex: none; }
.og-wback:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b0a10; }
.og-home { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; font: 700 1.2rem/1 var(--og-font); color: #fff; background: rgba(11,10,16,0.82); border: 2px solid #fff; border-radius: 50%; cursor: pointer; }
.og-hud-top .og-home { width: 2.1rem; height: 2.1rem; font-size: 1.05rem; }
.og-stack { flex-direction: column; align-items: center; }
.og-pause { width: min(100%, 22rem); }
.og-year { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); column-gap: 0.6rem; align-items: center; text-align: left; border: 3px solid #0b0a10; border-radius: 14px; padding: 0.5rem 0.7rem; box-shadow: 0 3px 0 #0b0a10; }
.og-year .og-ic { grid-row: span 2; width: 2.6rem; height: 2.6rem; }
.og-year b { font: 700 1.1rem/1.1 var(--og-font); }
.og-year span { font: 500 0.88rem/1.3 var(--og-font); }
.og-year-good { background: #fff1a8; color: #4a3a00; }
.og-year-hard { background: #dfe3f0; color: #1b1530; }
.og-changes li { gap: 0.4rem; }
.og-changes li .og-ic { width: 1.6rem; height: 1.6rem; }
.og-changes b { display: inline-flex; align-items: center; gap: 0.15rem; }
.og-arr { width: 0.9rem; height: 0.9rem; display: inline-block; vertical-align: -1px; }
.og-th { display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.og-th .og-ic { width: 1.5rem; height: 1.5rem; background: #fff; border-radius: 50%; padding: 2px; }
.og-table small { display: inline-block; }
.og-gal-h { color: #7a3fd0; margin-top: 0.4rem; }
.og-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem; }
.og-gtile { margin: 0; background: #1b1530; border: 3px solid #0b0a10; border-radius: 14px; padding: 0.45rem; display: grid; gap: 0.35rem; box-shadow: inset 0 -5px 0 var(--gc, #a47bff); }
.og-gtile > div { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; }
.og-gtile canvas { width: 100%; height: 5rem; display: block; background: #0f0c18; border-radius: 8px; }
.og-gtile figcaption { display: grid; gap: 0.15rem; color: #d6d0e2; font-size: 0.78rem; padding: 0 0.2rem 0.3rem; }
.og-gtile figcaption b { font-family: var(--og-font); color: #fff; font-size: 0.85rem; }
.og-g-snow { --gc: #9fb4ff; } .og-g-desert { --gc: #ff8a5c; } .og-g-fast { --gc: #3f9fc8; } .og-g-slow { --gc: #6f9f5a; } .og-g-murky { --gc: #9a7a4c; } .og-g-lake { --gc: #2b8fc0; }
.og-gtile canvas { height: 6.2rem; }
.og-new { top: auto; right: 3px; bottom: 3px; width: 1.25rem; height: 1.25rem; padding: 0; display: grid; place-items: center; font-size: 0.75rem; border-radius: 50%; background: #3ddc6f; }
.og-otter:has(.og-new) { box-shadow: 0 0 0 3px #3ddc6f; }
/* Trait pictures in change list and summary */
.og-changes-pics { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.og-changes-pics li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.4rem; }
.og-cname { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.og-cmp { display: flex; align-items: center; gap: 0.15rem; }
.og-cmp canvas { width: 3.4rem; height: 2.7rem; background: #1b1530; border-radius: 8px; border: 2px solid #0b0a10; }
.og-cmp i { font-style: normal; font-weight: 700; color: #7a3fd0; font-size: 0.8rem; }
.og-tcan { display: block; width: 3.6rem; height: 2.8rem; margin: 0 auto 0.15rem; background: #1b1530; border-radius: 8px; }
.og-table td span { display: block; }
/* ---------- How Otter Evolution works ---------- */
.how > p, .how-list, .how-steps p { max-width: 46rem; }
.how .people-sub { margin-top: 2.6rem; }
.how > p { color: #d6d0e2; margin-top: 0.6rem; }
.how-list { display: grid; gap: 0.55rem; padding-left: 1.2rem; margin-top: 0.8rem; color: #d6d0e2; }
.how-list b { color: var(--fg); }
.how-steps { list-style: none; counter-reset: st; padding: 0; margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.9rem; }
.how-steps li { counter-increment: st; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 1rem 1.1rem; display: grid; gap: 0.5rem; align-content: start; }
.how-steps h3::before { content: counter(st); display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; margin-right: 0.5rem; border-radius: 50%; background: var(--teal); color: var(--ink); font-size: 0.95rem; }
.how-steps h3 { font-size: var(--step-1); display: flex; align-items: center; }
.how-steps p { color: #d6d0e2; font-size: 0.9375rem; }
.how-table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--line-strong); border-radius: 10px; }
.how-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 40rem; }
.how-table th, .how-table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); text-align: center; }
.how-table th[scope="row"], .how-table td:last-child { text-align: left; }
.how-table thead th { background: var(--panel-2); color: var(--fg); font-weight: 600; }
.how-table td { color: #d6d0e2; }
.how-table tr.start td, .how-table tr.start th { color: var(--muted); }
.how-cols { columns: 2 18rem; column-gap: 2rem; padding-left: 1.2rem; margin-top: 0.8rem; color: #d6d0e2; }
.how-cols li { margin-bottom: 0.4rem; break-inside: avoid; }
/* Journal link card */
.og-how { display: grid; gap: 0.5rem; background: #e6f6fb; border: 3px solid #0b0a10; border-radius: 16px; padding: 0.8rem 1rem; color: #1b1530; }
.og-how b { font: 700 1.05rem/1.2 var(--og-font); }
.og-how ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.og-how li { font: 600 0.85rem/1 var(--og-font); background: #fff; border: 2px solid #0b0a10; border-radius: 999px; padding: 0.3rem 0.6rem; }
.og-how li span { color: #7a3fd0; margin-right: 0.25rem; }
.og-how a { font: 700 0.95rem/1.2 var(--og-font); color: #7a3fd0; }
/* Head schematic */
.og-headfig { margin: 0; display: grid; gap: 0.5rem; background: #1b1530; border: 3px solid #0b0a10; border-radius: 16px; padding: 0.7rem 0.9rem 0.9rem; }
.og-headfig .og-mini { color: #d6c2ff; }
.og-head-svg { width: 100%; height: auto; display: block; }
.og-headfig figcaption { color: #d6d0e2; font-size: 0.9rem; line-height: 1.45; }
.og-headfig figcaption b { color: #fff; }
.og-headfig .hs-brain { color: #2ed3c6; } .og-headfig .hs-ear { color: #ffcc4d; }
.how .og-headfig { max-width: 46rem; margin-top: 1.2rem; border-color: var(--line-strong); }
.og-welcome { display: grid; gap: 0.3rem; background: #e6f6fb; border: 3px solid #0b0a10; border-radius: 14px; padding: 0.7rem 0.9rem; font-family: var(--og-font); color: #1b1530; }
.og-welcome b { font-size: 1.2rem; }
.og-welcome span { font-size: 0.95rem; color: #4a4160; }
.og-danger { background: #ff3b5c; color: #fff; }
.og-danger:hover { background: #ff5f79; }
/* ---------- Hotbar with 7 slots, nature finds, life story ---------- */
.og-hotbar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 40rem) { .og-hotbar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.og-nat-head { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }
.og-nat-hab { margin-top: 0.8rem; padding: 0.6rem; border-radius: 14px; background: #f3eefc; box-shadow: inset 5px 0 0 var(--gc, #a47bff); }
.og-nat-hab h4 { font: 700 0.95rem/1 var(--og-font); color: #1b1530; margin: 0 0 0.5rem 0.4rem; }
.og-ntile span { font-size: 0.74rem; }
.og-lsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; }
.og-lsum > div { background: #f3eefc; border: 2px solid #d9cff0; border-radius: 14px; padding: 0.6rem 0.7rem; }
.og-lsum h4 { font: 700 0.8rem/1 var(--og-font); text-transform: uppercase; letter-spacing: 0.06em; color: #7a3fd0; margin: 0 0 0.45rem; }
.og-lhabs, .og-lchips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.og-lhab { font: 700 0.78rem/1 var(--og-font); padding: 0.35rem 0.55rem; border-radius: 999px; color: #fff; background: var(--gc); border: 2px solid #0b0a10; }
.og-lhab.no { background: #fff; color: #9a93ad; border-style: dashed; border-color: #b9b1cc; }
.og-lchip { display: inline-flex; align-items: center; gap: 0.25rem; background: #fff; border: 2px solid #0b0a10; border-radius: 999px; padding: 0.15rem 0.55rem 0.15rem 0.2rem; font-family: var(--og-font); color: #1b1530; }
.og-lchip .og-ic { width: 1.5rem; height: 1.5rem; }
.og-lchip b { font-size: 0.95rem; } .og-lchip small { font-size: 0.75rem; color: #4a4160; }
.og-lentries { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.og-lentry { background: #fff; border: 2px solid #0b0a10; border-radius: 12px; padding: 0.55rem 0.75rem; box-shadow: inset 6px 0 0 var(--gc, #a47bff); padding-left: 1rem; display: grid; gap: 0.25rem; color: #1b1530; }
.og-lentry header { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; border: 0; padding: 0; background: none; position: static; }
.og-lentry header b { font: 700 1rem/1 var(--og-font); } .og-lentry header span { font: 600 0.8rem/1 var(--og-font); color: #6b6380; }
.og-lentry p { font-size: 0.9rem; line-height: 1.4; }
.og-lout { font-weight: 700; } .og-lout.ok { color: #138a4a; } .og-lout.lost { color: #c2185b; }
/* Anatomy collection grouped by habitat */
.og-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
.og-ghab { background: #f3eefc; border-radius: 14px; padding: 0.6rem; box-shadow: inset 5px 0 0 var(--gc, #a47bff); }
.og-ghab h4 { display: flex; align-items: baseline; gap: 0.5rem; font: 700 1rem/1 var(--og-font); color: #1b1530; margin: 0 0 0.5rem 0.4rem; }
.og-ghab h4 span { font-size: 0.78rem; font-weight: 600; color: #6b6380; }
.og-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem; }

/* ---------- Tadpole Trek additions ---------- */
.tg-exp { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.tg-exp > span { display: flex; align-items: center; gap: 0.35rem; font: 700 0.75rem/1 var(--og-font); color: #fff; background: rgba(11,10,16,0.82); border: 2px solid #fff; border-radius: 999px; padding: 0.3rem 0.55rem 0.3rem 0.3rem; }
.tg-exp .og-ic { width: 1.25rem; height: 1.25rem; background: #fff; border-radius: 50%; padding: 1px; }
.tg-exp > span > span { width: 4.2rem; height: 9px; border-radius: 999px; background: #2b2540; overflow: hidden; }
.tg-exp i { display: block; height: 100%; width: 0; background: var(--c, #ff5fa2); transition: width 0.2s; }
.tg-exp > span.hot { border-color: var(--c, #ff5fa2); animation: oglow 0.6s infinite alternate; }
.tg-real { margin: 0; display: grid; gap: 0.5rem; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem; }
.tg-real figcaption { display: grid; gap: 0.25rem; font-size: 0.875rem; color: #d6d0e2; }
.tg-real figcaption b { font-family: var(--og-font); font-size: 1rem; color: var(--fg); }
.tg-mv { position: relative; height: 16rem; display: grid; place-items: center; background: #0f0c18; border-radius: 10px; overflow: hidden; }
.tg-mv model-viewer { width: 100%; height: 100%; background: #0f0c18; --poster-color: transparent; }
.tg-bars { display: grid; gap: 0.4rem; text-align: left; }
.tg-bar { display: grid; grid-template-columns: 2rem 7.4rem minmax(0, 1fr) 2.6rem; align-items: center; gap: 0.4rem; font: 600 0.85rem/1.1 var(--og-font); color: #1b1530; }
.tg-bar > span:nth-child(3) { height: 12px; border-radius: 999px; background: #e3dcf3; border: 2px solid #0b0a10; overflow: hidden; }
.tg-bar i { display: block; height: 100%; background: var(--c, #ff5fa2); }
.tg-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.tg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tg-pair figure { margin: 0; display: grid; gap: 0.2rem; justify-items: center; font: 600 0.8rem/1.2 var(--og-font); color: #4a4160; }
.tg-pair canvas { width: 100%; height: 7.5rem; background: #1b1530; border: 3px solid #0b0a10; border-radius: 12px; }
.tg-loss { width: 100%; border-collapse: collapse; font: 600 0.88rem/1.2 var(--og-font); color: #1b1530; text-align: left; }
.tg-loss th, .tg-loss td { padding: 0.3rem 0.4rem; border-bottom: 2px solid #e3dcf3; }
.tg-loss td:last-child, .tg-loss th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tg-loss .dn { color: #c2185b; }
.tg-flag { font: 600 0.78rem/1.3 var(--og-font); color: #6b6380; text-align: left; }
.how-flag { color: #ffd45c; font-weight: 600; }
.how-refs { display: grid; gap: 0.6rem; padding-left: 1.2rem; margin-top: 0.8rem; color: #d6d0e2; max-width: 46rem; }

.tg .og-tasks, .tg .og-map { top: 8.6rem; }
.tg .og-stage.touch .og-tasks, .tg .og-stage.touch .og-map { top: 6.6rem; }
.tg .og-stage.touch .tg-exp { max-width: none; flex-wrap: nowrap; }
.tg .og-stage.touch .tg-exp > span > span { width: 2.6rem; }

/* Why each trait changed */
.og-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.6rem; text-align: left; }
.og-wcard { background: #f3eefc; border: 2px solid #d9cff0; border-radius: 14px; padding: 0.6rem 0.75rem; display: grid; gap: 0.4rem; font-family: var(--og-font); color: #1b1530; }
.og-wcard header { display: flex; align-items: center; gap: 0.4rem; border: 0; padding: 0; background: none; position: static; }
.og-wcard header .og-ic { width: 1.6rem; height: 1.6rem; }
.og-wcard header b { font-size: 1rem; }
.og-wcard header span { margin-left: auto; font-weight: 700; font-size: 0.9rem; color: #6b6380; }
.og-wcard header span.up { color: #138a4a; } .og-wcard header span.down { color: #c2185b; }
.og-wcard p { font-size: 0.85rem; line-height: 1.35; color: #3a3350; }
.og-wbars { display: grid; gap: 0.25rem; }
.og-wrow { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 3.2rem; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: #4a4160; }
.og-wbar { position: relative; height: 0.7rem; background: #fff; border: 1.5px solid #c9c2dc; border-radius: 999px; overflow: hidden; }
.og-wbar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: #6b6380; }
.og-wbar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.og-wrow b { text-align: right; font-size: 0.75rem; color: #1b1530; }
/* Anatomy collection: current game open, earlier games collapsible */
.og-gcur { display: flex; align-items: baseline; gap: 0.5rem; font: 700 0.85rem/1 var(--og-font); text-transform: uppercase; letter-spacing: 0.06em; color: #7a3fd0; margin: 0.3rem 0 0; }
.og-gcur span { text-transform: none; letter-spacing: 0; font-weight: 600; color: #6b6380; font-size: 0.78rem; }
.og-gprev { background: #fff; border: 2px solid #d9cff0; border-radius: 14px; padding: 0.4rem 0.6rem; }
.og-gprev summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-family: var(--og-font); color: #1b1530; padding: 0.3rem 0.2rem; list-style: none; }
.og-gprev summary::-webkit-details-marker { display: none; }
.og-gprev summary::before { content: "▸"; color: #7a3fd0; font-weight: 700; }
.og-gprev[open] summary::before { content: "▾"; }
.og-gprev summary span { font-size: 0.8rem; color: #6b6380; }
.og-gprev[open] { display: grid; gap: 0.6rem; }
.pi-line { margin-top: 0.6rem; color: #d6d0e2; font-size: 1rem; }
.pi-line a { color: var(--pink); font-weight: 600; }

/* ---------- Tadpole Trek classroom edition ---------- */
.page-title small { display: block; font-size: .42em; font-weight: 600; letter-spacing: .02em; opacity: .75; margin-top: .2em; }
.tg-cl-links { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: center; margin-top: .6rem; }
.tg-cl-opts { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.tg-tog .tg-ic { font-size: 1.5rem; line-height: 1; }
.tg-say { justify-self: end; justify-self: flex-end; margin: 0 0 .5rem auto; display: block; font: 600 .85rem/1 var(--sans, system-ui); padding: .5rem .8rem; border-radius: 999px; border: 2px solid #0b0a10; background: #ffe066; color: #0b0a10; cursor: pointer; }
.tg-pred { margin-top: .8rem; }
.tg-pred-opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.tg-pred-opts button { display: flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; border: 2px solid #0b0a10; background: #fff; color: #0b0a10; font: 600 .9rem/1 var(--sans, system-ui); cursor: pointer; }
.tg-pred-opts button svg { width: 1.4rem; height: 1.4rem; }
.tg-pred-opts button[aria-pressed="true"] { background: #ffe066; box-shadow: 0 0 0 3px #7a3fd0; }
.tg-pred-opts .tg-ic { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #ddd; font-weight: 800; }
.tg-reflect { margin-top: .9rem; padding: .8rem 1rem; border: 2px dashed #7a3fd0; border-radius: 1rem; background: rgba(122, 63, 208, .07); }
.tg-reflect p { margin: .3rem 0; }
.tg-q { font-weight: 500; }
.tg-qs { margin: .4rem 0 .6rem 1.2rem; }
.tg-lab { position: absolute; right: 0; top: calc(8.6rem + 126px + 12px); display: grid; gap: .35rem; z-index: 4; pointer-events: auto; }
.tg-lab[hidden] { display: none; }
.tg-lab button { padding: .5rem .8rem; border-radius: 999px; border: 2px solid #0b0a10; background: #fff; color: #0b0a10; font: 700 .85rem/1 var(--sans, system-ui); cursor: pointer; text-align: left; }
.tg-lab .tg-clean { background: #7bd96b; }
.og-stage.touch .tg-lab { top: calc(6.6rem + 90px + 12px); }
@media (max-width: 640px) { .tg-lab { top: 8.6rem; } .og-stage.touch .tg-lab { top: 6.6rem; } }
.tg-lab-panel { margin-top: 1rem; padding: .8rem 1rem; border-radius: 1rem; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .18); }
.tg-lab-panel ul { margin: .3rem 0 .6rem 1.1rem; }
body.tg-big .og-card, body.tg-big .og-window, body.tg-big .og-tasks, body.tg-big .og-fact, body.tg-big .og-toast { font-size: 1.22em; line-height: 1.5; }
body.tg-big .og-sub.og-small { font-size: 1em; }

/* teacher pages */
.tc h2 { margin-top: 2rem; }
.tc .tc-band { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1rem 0; }
.tc .tc-band > div { padding: 1rem 1.1rem; border: 2px solid currentColor; border-radius: 1rem; }
.tc .tc-band h3 { margin: 0 0 .4rem; }
.tc .tc-step { display: grid; grid-template-columns: 4.5rem 1fr; gap: .8rem; padding: .5rem 0; border-top: 1px solid rgba(128, 128, 128, .35); }
.tc .tc-step b { font-variant-numeric: tabular-nums; }
.tc table { border-collapse: collapse; width: 100%; margin: .8rem 0; }
.tc th, .tc td { border: 1px solid rgba(128, 128, 128, .5); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.tc .tc-note { padding: .8rem 1rem; border-left: 4px solid #d9822b; background: rgba(217, 130, 43, .1); border-radius: .3rem; margin: 1rem 0; }
.tc .tc-line { border-bottom: 1.5px solid #333; min-height: 2.2rem; margin: .3rem 0; }
.tc .tc-box { border: 2px solid #333; min-height: 11rem; border-radius: .6rem; margin: .4rem 0 1rem; }
.tc .tc-print { margin: 1rem 0; }
@media print {
  .site-header, .site-footer, .tc .tc-noprint, .crumb { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .tc .tc-sheet { break-after: page; }
  .tc a { color: #000; text-decoration: none; }
}
.tg-tog .tg-ic { grid-row: span 2; text-align: center; }
@media print { .tc, .tc * { color: #000 !important; border-color: #333 !important; } .tc .tc-band > div { border-color: #333 !important; } }

/* Tadpole Trek: bigger minimap */
.tg .og-stage .og-map { width: 190px; height: 190px; }
.tg .og-stage.touch .og-map { width: 130px; height: 130px; }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) { .tg .og-stage.touch .og-map { width: 112px; height: 112px; } }
.tg-lab { top: calc(8.6rem + 190px + 12px); }
.og-stage.touch .tg-lab { top: calc(6.6rem + 130px + 12px); }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) { .og-stage.touch .tg-lab { top: 6.6rem; right: 122px; grid-template-columns: repeat(2, auto); } }
@media (max-width: 640px) { .tg-lab { top: 8.6rem; right: 140px; } }

/* Journal: always-visible metamorphosis box and locked cards */
.og-modal .og-meta { background: #1b1530; border: 3px solid #0b0a10; border-radius: 16px; padding: 1rem 1.1rem; display: grid; gap: .6rem; box-shadow: inset 4px 0 0 #ffb347; margin-bottom: .9rem; }
.og-meta h3 { font: 700 var(--step-1)/1.15 var(--og-font); color: #ffb347; margin: 0; }
.og-meta p, .og-meta li { color: #d6d0e2; font-size: .9375rem; margin: 0; }
.og-meta ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.og-meta a { font-weight: 600; }
.fact-chip.locked { opacity: .55; cursor: default; border-style: dashed; }
body.tg-big .og-meta { font-size: 1.22em; line-height: 1.5; }
/* Home: free science games */
.home-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.home-game { display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; color: var(--fg); text-decoration: none; transition: transform 0.15s, border-color 0.15s; }
.home-game:hover { transform: translateY(-3px); border-color: var(--pink); }
.home-game img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; display: block; }
.home-game > div { display: grid; gap: 0.6rem; align-content: start; padding: 1rem 1.1rem 1.2rem; }
.home-game h3 { font-size: var(--step-1, 1.3rem); }
.home-game p { color: #d6d0e2; }
.home-game .btn { justify-self: start; }
@media (prefers-reduced-motion: reduce) { .home-game { transition: none; } }
.og-metaart { width: 100%; max-width: 34rem; height: auto; justify-self: center; background: rgba(255, 255, 255, .04); border-radius: 12px; }
.og-metacap { font-size: .8rem !important; color: #a79fbb !important; text-align: center; }

/* Games header under Open Science (menu + page) */
.menu-panel li.sub-head { padding: 0.75rem 1rem 0.3rem 2rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.menu-panel li.sub.game a { padding-left: 3rem; }
.menu-panel li.sub.game a::before { left: 2.05rem; }
.os-games-head { margin: 3rem 0 1.25rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.os-games-head h2 { font-size: var(--step-3, 2rem); }
.os-games-head p { color: var(--muted); margin-top: 0.4rem; }
.os-games-head + .os-game { margin-top: 0; }
