/* ============================================================
   Md Sabbir Islam, portfolio
   Clean light: white page, green-tinted ink, one forest-green accent.
   Serif (Newsreader) for headings and citations, Archivo for everything else.
   Pages: Profile, Research, Projects, Maps, Gallery, Fun.
   ============================================================ */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --bg: #FBF9F4;            /* warm paper */
  --surface: #F2EFE6;       /* map mat, quiet fills */
  --surface-2: #E9E5DA;     /* hover on surface */
  --ink: #14201A;           /* green-tinted near black */
  --ink-2: #3B463F;
  --muted: #5B635D;
  --line: #E5E0D4;
  --line-2: #D2CCBE;
  --accent: #166534;        /* forest green: links and text accents on paper */
  --accent-soft: #E4EDE1;
  --accent-hover: #14532D;
  --forest: #0F3B24;        /* header, hero and page bands */
  --forest-2: #0B2E1B;      /* utility bar, footer */
  --on-forest: #FFFFFF;
  --on-forest-2: #BFE0C8;
  --forest-line: rgba(255, 255, 255, 0.14);
  --sun: #F5B82E;           /* the one bright action colour */
  --sun-hover: #F8C75A;
  --viewer-bg: #08160F;       /* full-screen photo and map viewer */
  --viewer-text-2: #C4D3C9;
  --on-green: #FFFFFF;
  --print-shadow: 0 1px 2px rgba(20, 32, 26, 0.08), 0 12px 28px -16px rgba(20, 32, 26, 0.38);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --wrap: 1200px;
  --pad: clamp(20px, 4vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-tap-highlight-color: transparent;   /* focus and hover states give the feedback */
  scrollbar-color: var(--line-2) var(--bg);
  background: var(--forest-2);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  display: flex; flex-direction: column; min-height: 100dvh;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
b, strong { font-weight: 650; }
cite { font-style: normal; }
::selection { background: var(--accent-soft); color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); font-size: 0.85em; font-variant-numeric: tabular-nums; }
.i { width: 18px; height: 18px; flex: none; fill: currentColor; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: 12px; top: -48px; z-index: 1100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); }
.skip:focus { top: 10px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.wrap--wide { max-width: 1360px; }

/* ---------- Header: utility bar, then the green bar that sticks ---------- */
.utility { background: var(--forest-2); color: var(--on-forest-2); font-size: 0.8125rem; }
.utility__row { display: flex; justify-content: flex-end; gap: 4px 26px; height: 38px; align-items: center; }
.utility a { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; font-weight: 550; }
.utility a:hover { color: #fff; }
.utility .i { width: 15px; height: 15px; }

.site-head { position: sticky; top: 0; z-index: 1000; background: var(--forest); color: var(--on-forest); }
.site-head__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand {
  color: #fff;
  font-family: var(--serif); font-weight: 600; font-size: 1.375rem; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  padding: 8px 0;
}
.brand:hover { color: var(--sun); }
.site-head__end { display: flex; align-items: center; gap: 18px; }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 10px 12px;
  text-decoration: none; font-size: 0.9375rem; font-weight: 550; color: #fff;
  white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 999px;
  background: var(--sun); transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { font-weight: 650; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--sun); color: var(--ink);
  font-weight: 650; font-size: 0.9375rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms var(--ease), transform 120ms;
}
.pill:hover { background: var(--sun-hover); }
.pill:active { transform: scale(0.98); }
.pill .i { width: 18px; height: 18px; }

.nav-toggle { display: none; }
.nav-toggle .i--close, .site-head.is-open .nav-toggle .i--menu { display: none; }
.site-head.is-open .nav-toggle .i--close { display: block; }

/* ---------- Green bands (page heads, home hero, contact) ---------- */
.band {
  position: relative; isolation: isolate;
  background: var(--forest); color: var(--on-forest);
}
.band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../img/terrain.svg") right center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
}
.band a:not(.pill):not(.btn) { color: #fff; }
.band .page-head { border-bottom: 0; margin-bottom: 0; padding: clamp(56px, 8vw, 112px) 0 clamp(52px, 7vw, 96px); }
.band .page-head__title { color: #fff; }
.band .page-head__lede { color: var(--on-forest-2); }
.band-cap { position: absolute; right: var(--pad); bottom: 10px; font-size: 0.8125rem; color: var(--on-forest-2); opacity: 0.8; }

/* ---------- Headings ---------- */
.page-head {
  padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 3.5vw, 40px);
  margin-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.page-head__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.5rem, 1.7rem + 3.2vw, 4rem);
  letter-spacing: -0.025em; line-height: 1.02;
  text-wrap: balance;
  margin-bottom: 16px;
}
.page-head__lede { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); color: var(--ink-2); max-width: 60ch; }
.band .page-head--compact { padding: clamp(36px, 5vw, 56px) 0 clamp(32px, 4vw, 48px); }
.band + .wrap { padding-top: clamp(36px, 5vw, 56px); }
.page-head--compact .page-head__title { font-size: clamp(2.25rem, 1.6rem + 2vw, 3rem); margin-bottom: 8px; }

.sec-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  letter-spacing: -0.015em; line-height: 1.1;
  text-wrap: balance;
}
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.split__note { color: var(--muted); font-size: 0.9375rem; margin-top: 10px; max-width: 28ch; }

.more-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.9375rem; color: var(--accent); text-decoration: none; white-space: nowrap;
}
.more-link .i { width: 15px; height: 15px; transition: transform 200ms var(--ease); }
.more-link:hover { text-decoration: underline; }
.more-link { padding: 10px 0; margin: -10px 0; }
.more-link:hover .i { transform: translateX(3px); }
.split__head .more-link { margin-top: 6px; }

/* Side-heading sections: title on the left, content on the right */
.split {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 72px);
  padding: clamp(44px, 6vw, 80px) 0;
  border-top: 1px solid var(--line);
}
.split__head { align-self: start; position: sticky; top: calc(var(--header-h) + 28px); }
.home-sec { padding: clamp(44px, 6vw, 80px) 0; }
.glance + .home-sec, .home-sec:first-child { border-top: 0; }

/* ---------- Buttons, links, tags ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink);
  font-weight: 600; font-size: 0.9375rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms, transform 120ms;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { background: var(--surface); border-color: var(--line); color: var(--muted); cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }

.link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.9375rem; color: var(--accent);
  text-decoration: none; border: 0; background: none; padding: 0; cursor: pointer;
}
.link:hover { text-decoration: underline; }
.link .i { width: 16px; height: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.9375rem; font-weight: 500;
}
.tags--quiet .tag { background: var(--surface); color: var(--ink-2); font-size: 0.8125rem; padding: 4px 10px; }
.status {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-family: var(--font); font-style: normal;
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap; line-height: 1.6;
  border: 1px solid var(--line-2); color: var(--ink-2);
}
.status--done { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* ---------- Map mat: a map sits on a light mat like a print ---------- */
.mat {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: clamp(14px, 1.8vw, 24px);
  background: var(--surface); border: 0; border-radius: var(--radius-lg);
  cursor: zoom-in; overflow: hidden;
  transition: background-color 250ms var(--ease);
}
.mat img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  box-shadow: var(--print-shadow);
  transition: transform 500ms var(--ease), box-shadow 500ms var(--ease);
}
.mat:hover { background: var(--surface-2); }
.mat:hover img { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(20, 32, 26, 0.08), 0 18px 36px -18px rgba(20, 32, 26, 0.45); }
.shot__zoom {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(20, 32, 26, 0.84); color: #fff; font-size: 0.8125rem; font-weight: 600;
  opacity: 0; transform: translateY(4px); transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.shot__zoom .i { width: 14px; height: 14px; }
.mat:hover .shot__zoom, .mat:focus-visible .shot__zoom { opacity: 1; transform: none; }
@media (hover: none) { .shot__zoom { opacity: 1; transform: none; } }

.shot { margin: 0; }
.shot[hidden] { display: none; }
.shot figcaption { padding: 14px 2px 0; }
.shot__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.shot__title { font-weight: 650; line-height: 1.35; }
.shot__year { color: var(--muted); flex: none; }
.shot__meta { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; margin-top: 4px; }
.shot__link { display: inline-block; padding: 4px 0; margin: -4px 0; color: inherit; text-decoration: none; }
.shot__link:hover, .shot__link:focus-visible { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }

/* One map on its own page (maps/<name>.html) */
.mapdetail { margin-top: 0; }
.mapdetail .mat { display: flex; justify-content: center; }
.mapdetail .mat img { width: auto; max-width: 100%; max-height: 82vh; height: auto; }
.mapdetail .shot__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem); }
.mapdetail .shot__meta { max-width: 70ch; }
.mapdetail__by { color: var(--muted); font-size: 0.9375rem; margin-top: 4px; }
.mapdetail__tags { margin-top: 14px; }
.mapdetail__actions { margin-top: 24px; align-items: center; }
.mapabout { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line); max-width: 760px; }
.mapabout .sec-title { margin-bottom: 18px; }
.mapabout__text { color: var(--ink-2); max-width: 66ch; margin-bottom: 20px; }
.mapfacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 32px; }
.mapfacts > div { display: grid; gap: 4px; align-content: start; }
.mapfacts dt { color: var(--muted); font-size: 0.8125rem; }
.mapfacts dd { color: var(--ink); line-height: 1.5; }
.mapabout__use { margin-top: 18px; color: var(--muted); font-size: 0.9375rem; max-width: 66ch; }
.mapabout__use a { color: var(--accent); }
@media (max-width: 560px) { .mapfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; } }

/* ---------- Home: hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: clamp(32px, 6vw, 96px); align-items: center;
  padding: clamp(48px, 6vw, 88px) 0 clamp(112px, 11vw, 150px);
}
.hero__name {
  font-family: var(--serif); font-weight: 500; color: #fff;
  font-size: clamp(3rem, 1.9rem + 4.6vw, 6rem);
  line-height: 1; letter-spacing: -0.03em; text-wrap: balance;
  margin-bottom: 20px;
}
.hero__role { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); font-weight: 650; color: var(--sun); margin-bottom: 14px; }
.hero__bio { color: var(--on-forest-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); max-width: 50ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__actions .pill, .hero__actions .btn { height: 48px; }
.hero__photo img {
  width: 100%; aspect-ratio: 5 / 6; object-fit: cover; object-position: 55% 16%;
  border-radius: var(--radius-lg); background: var(--forest-2);
}
.hero__caption { margin-top: 10px; font-size: 0.8125rem; color: var(--on-forest-2); }

/* At a glance: a white card that overlaps the hero's lower edge */
.glance {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr) minmax(0, 1.3fr) minmax(0, 0.9fr);
  margin: calc(-1 * clamp(64px, 7vw, 88px)) 0 clamp(16px, 3vw, 32px);
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(20, 32, 26, 0.06), 0 24px 48px -28px rgba(20, 32, 26, 0.45);
}
.fact { padding: clamp(22px, 2.4vw, 30px) clamp(18px, 1.9vw, 26px) clamp(24px, 2.6vw, 32px); }
.fact + .fact { border-left: 1px solid var(--line); }
.fact dt { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.fact__icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--sun); color: var(--ink);
}
.fact__icon .i { width: 20px; height: 20px; }
.fact__label { font-size: 0.8125rem; font-weight: 650; color: var(--muted); }
.fact__value { font-family: var(--serif); font-weight: 500; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.35; color: var(--ink); text-wrap: pretty; }
.fact__note { margin-top: 8px; font-size: 0.8125rem; color: var(--accent); }

/* Latest maps: one lead map and two beside it */
.bento {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 24px 28px; height: clamp(560px, 48vw, 720px);
}
.bento .shot { display: flex; flex-direction: column; min-height: 0; }
.bento .shot:first-child { grid-row: span 2; }
.bento .mat { flex: 1; min-height: 0; }
.bento figcaption { padding-top: 12px; }
.bento .shot__title { font-size: 1.0625rem; }

/* Recent research (short citations) */
.cites { display: grid; }
.cite { padding: 22px 0; border-bottom: 1px solid var(--line); }
.cite:first-child { padding-top: 0; }
.cite:last-child { border-bottom: 0; padding-bottom: 0; }
.cite__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.cite__meta .mono { font-size: 0.8125rem; color: var(--ink-2); }
.cite__title { font-family: var(--serif); font-weight: 550; font-size: clamp(1.1875rem, 1.05rem + 0.4vw, 1.375rem); line-height: 1.35; color: var(--ink); max-width: 52ch; }
.cite__title a { color: inherit; text-decoration-color: var(--line-2); }
.cite__title a:hover { color: var(--accent); }
.cite__venue { font-family: var(--serif); font-style: italic; color: var(--ink-2); margin-top: 4px; font-size: 1.0625rem; line-height: 1.5; max-width: 62ch; }

/* Code projects on Home: 2 by 2 cards with a preview */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 10px; }
.pcard__media { aspect-ratio: 16 / 9; margin-bottom: 8px; cursor: pointer; }
.pcard__top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.pcard__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem); line-height: 1.35; }
.pcard__title a { color: var(--ink); text-decoration: none; }
.pcard__title a::after { content: ""; position: absolute; inset: 0; }
.pcard:hover .pcard__title a, .pcard__title a:focus-visible { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.pcard:hover .mat { background: var(--surface-2); }
.pcard:hover .mat img { transform: translateY(-3px); }
.pcard__text { color: var(--ink-2); font-size: 0.9375rem; max-width: 56ch; }
.pcard__tools { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }

/* Skills: one panel, groups in three columns */
.skill-panel {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 40px;
  padding: clamp(24px, 3.5vw, 44px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.skill-panel dt { font-weight: 650; margin-bottom: 6px; color: var(--accent); }
.skill-panel dd { color: var(--ink-2); font-size: 0.9375rem; }

/* Interests, awards, languages side by side */
.trio {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(44px, 6vw, 80px) 0 0; border-top: 1px solid var(--line);
}
.trio__title { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 18px; }

/* Education and experience */
.timeline { display: grid; gap: 28px; }
.timeline__item { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 20px; }
.timeline__when { color: var(--muted); font-size: 0.9375rem; padding-top: 3px; font-variant-numeric: tabular-nums; }
.timeline__role { font-size: 1.1875rem; font-weight: 650; line-height: 1.35; margin-bottom: 4px; }
.timeline__org { color: var(--ink-2); font-size: 0.9375rem; max-width: 56ch; }


.plain-list { display: grid; gap: 12px; max-width: 60ch; }
.plain-list li { color: var(--ink-2); }
.plain-list .mono { color: var(--muted); margin-right: 12px; }

/* ---------- Contact band (home) ---------- */
.contact-sec { margin-top: clamp(40px, 6vw, 72px); }
.contact { padding: clamp(44px, 6vw, 80px) 0 clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.contact .ccards { margin-top: clamp(28px, 3.5vw, 40px); }
.contact__title { font-family: var(--serif); font-weight: 500; font-size: clamp(2.5rem, 1.7rem + 3.2vw, 4rem); line-height: 1.02; letter-spacing: -0.025em; color: var(--ink); margin-bottom: 14px; }
.contact__note { color: var(--ink-2); max-width: 44ch; }
.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.ccard {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 16px 14px 16px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.ccard:hover { border-color: var(--line-2); }
.ccard__icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--sun); color: var(--ink); }
.ccard__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ccard__label { font-size: 0.8125rem; font-weight: 650; color: var(--muted); }
.ccard__value { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.ccard__value:hover { color: var(--accent); text-decoration: underline; }
.copy {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg); cursor: pointer;
  font-size: 0.9375rem; font-weight: 600;
}
.copy:hover { border-color: var(--ink-2); }
.copy .i { width: 15px; height: 15px; }
.copy .i--check { display: none; }
.copy.is-copied { background: var(--accent); border-color: var(--accent); color: var(--on-green); }
.copy.is-copied .i--copy { display: none; }
.copy.is-copied .i--check { display: block; }
.copy__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Research page: academic publication list ---------- */
.publications { display: grid; gap: 52px; max-width: 920px; }
.pubgroup__title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); letter-spacing: -0.015em; line-height: 1.1;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink); margin-bottom: 4px;
}
.pubgroup__count {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--font); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0;
}
.pub { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub__n {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-top: 2px;
  background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 0.9375rem; font-variant-numeric: tabular-nums;
}
.pub__cite { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.6; color: var(--ink-2); }
.pub__authors { color: var(--ink); }
.pub__authors b { font-weight: 650; }
.pub__title { color: var(--ink); font-weight: 600; }
.pub__title a { color: inherit; text-decoration-color: var(--line-2); }
.pub__title a:hover { color: var(--accent); }
.pub__venue { font-style: italic; }
.pub__cite .status { margin-left: 4px; vertical-align: 2px; }
.pub__note { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; margin-top: 8px; max-width: 72ch; }
.pub__actions { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; }
.pub--poster { grid-template-columns: 36px minmax(0, 1fr) 150px; column-gap: 24px; }
.pub__poster { margin: 0; }
.pub__poster .mat { padding: 8px; border-radius: var(--radius); }
.pub__poster img { width: 100%; height: auto; box-shadow: var(--print-shadow); }
@media (max-width: 640px) {
  .pub--poster { grid-template-columns: 28px minmax(0, 1fr); }
  .pub__poster { grid-column: 2; max-width: 180px; margin-top: 6px; }
}
.list-empty, .gallery__soon { color: var(--muted); padding: 20px 0; }

/* ---------- Projects page: code projects as rows ---------- */
.proj-list { display: grid; }
.proj {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--line);
}
.proj:first-child { padding-top: 0; }
.proj:last-child { border-bottom: 0; }
.proj__media { aspect-ratio: 16 / 10; cursor: pointer; text-decoration: none; }
.proj__tile { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-2); text-align: center; }
.proj__tile .i { width: 34px; height: 34px; color: var(--ink); }
.proj__tile span { font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.proj__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.proj__top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.proj__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem); line-height: 1.15; letter-spacing: -0.01em; }
.proj__title a { color: inherit; text-decoration: none; }
.proj__title a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.proj__text { color: var(--ink-2); max-width: 60ch; }
.proj__repo { font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; overflow-wrap: anywhere; }
.proj__body .link { padding: 10px 0; margin: -10px 0; }

/* ---------- Maps page: natural-shape map wall ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  padding: 9px 18px; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--ink);
  font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.map-wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; align-items: start; }
.map-wall__col { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
.map-wall .mat img { width: 100%; max-height: 1100px; object-fit: contain; }
.map-wall .shot__title { font-size: 1.1875rem; }

.more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.more li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.more__title { font-weight: 600; }
.more__meta { color: var(--muted); font-size: 0.9375rem; }
.block { padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line); }
.block__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); letter-spacing: -0.015em; line-height: 1.1; margin-bottom: 24px; }

/* ---------- Gallery: photos grouped by event, each group a tidy grid ---------- */
.album { display: grid; gap: 16px; padding: clamp(28px, 4vw, 44px) 0; border-top: 1px solid var(--line); }
.album:first-child { border-top: 0; padding-top: 0; }
.album__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem); line-height: 1.35; letter-spacing: -0.01em; }
.album__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(112px, 28vw, 180px); gap: 8px;
}
.album__item { margin: 0; min-width: 0; }
.album__item .shot__btn {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.album__item img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform 600ms var(--ease); }
.album__item .shot__btn:hover img { transform: scale(1.03); }
.album__item .shot__btn:hover .shot__zoom, .album__item .shot__btn:focus-visible .shot__zoom { opacity: 1; transform: none; }
@media (hover: none) { .album__item .shot__zoom { display: none; } }
/* Phones and tablets: 2 columns, the first photo leads */
.album__grid[data-n="1"] > :first-child { grid-column: span 2; grid-row: span 2; }
.album__grid[data-n="2"] > * { grid-row: span 2; }
.album__grid[data-n="3"] > :first-child,
.album__grid[data-n="4"] > :first-child,
.album__grid[data-n="5"] > :first-child { grid-column: span 2; grid-row: span 2; }
.album__grid[data-n="4"] > :last-child { grid-column: span 2; }
@media (min-width: 900px) {
  .album { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
  .album__title { position: sticky; top: calc(var(--header-h) + 28px); padding-top: 4px; }
  .album__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(120px, 12.5vw, 176px); gap: 10px; }
  .album__grid[data-n="1"] > :first-child { grid-column: span 4; grid-row: span 2; }
  .album__grid[data-n="2"] > * { grid-row: span 2; }
  /* Pairs alternate a wide and a narrow photo so the page keeps a rhythm */
  .album__grid[data-n="2"] { grid-template-columns: 3fr 2fr; }
  .album:nth-child(even) .album__grid[data-n="2"] { grid-template-columns: 2fr 3fr; }
  .album__grid[data-n="3"] > :nth-child(n+2) { grid-column: span 2; }
  .album__grid[data-n="4"] > :nth-child(2) { grid-column: span 2; }
  .album__grid[data-n="4"] > :last-child { grid-column: auto; }
  .album__grid[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.gallery__empty { color: var(--muted); padding: 24px 0; }

/* Lightbox: a full-screen dark viewer. The photo always fits between the title bar and the caption. */
.lightbox {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: 0; border: 0; border-radius: 0; background: var(--viewer-bg); color: #fff;
  overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px clamp(16px, 3vw, 28px); }
.lightbox__title { font-weight: 650; line-height: 1.3; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.lightbox__tools { display: flex; gap: 4px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--ink-2);
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.lightbox .icon-btn { color: rgba(255, 255, 255, 0.85); }
.lightbox .icon-btn:hover, .lightbox .icon-btn:focus-visible { background: rgba(255, 255, 255, 0.12); color: #fff; }
.lightbox__view { min-height: 0; display: grid; grid-template: 100% / 100%; place-items: center; overflow: auto; padding: 0 clamp(8px, 3vw, 56px); cursor: zoom-in; }
.lightbox__img { width: 100%; height: 100%; object-fit: contain; }
.lightbox__view.is-zoomed { grid-template: none; place-items: start; padding: 0; cursor: zoom-out; }
.lightbox__view.is-zoomed .lightbox__img { height: auto; max-width: none; object-fit: fill; }
.lightbox__meta {
  max-width: 80ch; max-height: 28dvh; overflow: auto; margin: 0 auto; box-sizing: content-box;
  padding: 14px clamp(16px, 3vw, 28px) 18px; color: var(--viewer-text-2); font-size: 0.9375rem; line-height: 1.55; text-align: center;
}
.lightbox__meta:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: fade 200ms var(--ease); }
  @keyframes fade { from { opacity: 0; } }
}

a, button, [role="button"], label { touch-action: manipulation; }   /* no double-tap zoom delay on phones */
.lightbox, .lightbox__view, .lightbox__meta { overscroll-behavior: contain; }

/* ---------- Fun: Pin the Place game ---------- */
.leaflet-container .leaflet-control-attribution { padding: 4px 8px; }
.game {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "levels levels" "panel map";
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff;
  /* Fits the screen under the sticky header on any monitor (720p laptops included), between 420 and 760px */
  height: clamp(420px, calc(100dvh - var(--header-h) - 32px), 760px);
}
.game__levels {
  grid-area: levels;
  display: flex; align-items: stretch; gap: 8px;
  padding: 8px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.regions { display: flex; flex: none; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.region {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--ink-2); font-weight: 650; font-size: 0.9375rem; cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms;
}
.region:hover { background: var(--surface); color: var(--ink); }
.region.is-on { background: var(--forest); color: #fff; }
.lvls { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.lvl[hidden] { display: none; }
.lvl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 10px 14px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left;
  transition: background-color 160ms var(--ease), border-color 160ms, box-shadow 160ms;
}
.lvl:hover { background: #fff; }
.lvl__name { font-weight: 700; font-size: 0.9375rem; }
.lvl__sub { font-size: 0.8125rem; color: var(--muted); }
.lvl.is-on { background: #fff; box-shadow: 0 6px 16px -12px rgba(20, 32, 26, 0.4); }
.lvl.is-on .lvl__name { color: var(--accent); }

.game__panel { grid-area: panel; display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; border-right: 1px solid var(--line); overflow-y: auto; }
.game__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.game__dots { display: flex; gap: 6px; }
.game__dots li { width: 22px; height: 6px; border-radius: 999px; background: var(--line); }
.game__dots li.is-now { background: var(--ink-2); }
.game__dots li.is-great { background: var(--accent); }
.game__dots li.is-ok { background: #E9B824; }
.game__dots li.is-miss { background: #D2CCBE; }
.game__score { font-weight: 700; font-variant-numeric: tabular-nums; }
.game__stage { display: flex; flex-direction: column; gap: 10px; }
.game__stage[hidden] { display: none; }
.game__round { color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.game__ask { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.game__ask b { color: var(--accent); }
.game__hint { color: var(--ink-2); font-size: 0.9375rem; }
.game__tip { color: var(--muted); font-size: 0.8125rem; }
.game__btn { align-self: flex-start; margin-top: 6px; }
.game__verdict { font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem); font-weight: 650; line-height: 1.3; }
.game__km { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.game__points { font-size: 1.1875rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.game__fact { color: var(--ink-2); font-size: 0.9375rem; }
.game__final { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.game__of { font-size: 1.1875rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.game__rating { font-weight: 650; }
.game__best { color: var(--muted); font-size: 0.9375rem; }
.game__recap { display: grid; gap: 6px; font-size: 0.9375rem; }
.game__recap li { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.5rem; gap: 12px; padding: 8px 12px; background: var(--surface); border-radius: 10px; font-variant-numeric: tabular-nums; }
.game__recap li span:nth-child(2) { color: var(--muted); }
.game__recap li span:nth-child(3) { color: var(--accent); font-weight: 650; text-align: right; }

.game__map { grid-area: map; position: relative; min-height: 0; background: #0B1F2A; }
#game-map { position: absolute; inset: 0; background: #0B1F2A; cursor: crosshair; }
#game-map:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.game__loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 500; color: var(--ink-2); background: rgba(255, 255, 255, 0.94); padding: 8px 14px; border-radius: 999px; font-size: 0.9375rem; }
.game__loading[hidden] { display: none; }
.game__float { display: none; }
.gpin { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); }
.gpin--guess { background: #FFFFFF; border-color: #121A16; }
.gpin--answer { background: #FACC15; }
@media (prefers-reduced-motion: no-preference) {
  .gpin { animation: drop 360ms var(--ease) both; }
  @keyframes drop { from { transform: translateY(-14px) scale(0.6); opacity: 0; } }
}

/* Short screens (720p monitors, laptops with display scaling): a more compact panel */
@media (min-width: 901px) and (max-height: 760px) {
  .game__levels { padding: 6px; }
  .lvl { padding: 6px 12px; }
  .region { min-height: 40px; }
  .game__panel { padding: 16px 20px; gap: 12px; }
  .game__stage { gap: 8px; }
  .game__ask { font-size: 1.5rem; }
  .choice { min-height: 44px; padding: 8px 12px; }
}
@media (min-width: 901px) and (max-height: 620px) {
  .lvl__sub { display: none; }
  .game__tip { display: none; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .game--detective .choices { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .game {
    grid-template-columns: 1fr; grid-template-rows: auto auto auto;
    grid-template-areas: "levels" "panel" "map";
    height: auto;
  }
  .game__levels { flex-direction: column; gap: 6px; padding: 6px; }
  .regions { width: 100%; }
  .region { flex: 1; }
  .lvls { gap: 4px; }
  .lvl { align-items: center; text-align: center; padding: 8px 4px; }
  .game__panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; gap: 12px; }
  .game__tip, .game__stage[data-stage="ask"] .game__btn { display: none; }
  .game__map { height: 62vh; min-height: 380px; }
  .game__float { display: flex; justify-content: center; position: absolute; left: 0; right: 0; bottom: 48px; z-index: 600; pointer-events: none; }
  .game__float[hidden] { display: none; }
  .game__float .btn { pointer-events: auto; border: 2px solid #FFFFFF; }
}
.leaflet-container { font-family: var(--font); }
.leaflet-tooltip.gtip { background: #fff; border: 0; border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 8px rgba(20, 32, 26, 0.18); font: 600 0.8125rem var(--font); color: var(--ink); }
.leaflet-tooltip.gtip::before { display: none; }

/* ---------- Footer ---------- */
.site-foot { background: var(--forest-2); color: var(--on-forest-2); font-size: 0.9375rem; }
main > :last-child:not(.band), main > :not(.band):not(.contact-sec):has(+ .lightbox:last-child) { margin-bottom: clamp(56px, 8vw, 104px); }   /* the lightbox dialog sits last but takes no space */
.site-foot__grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px; padding-top: clamp(44px, 6vw, 64px); padding-bottom: 40px;
}
.site-foot__name { font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1.1; color: #fff; margin-bottom: 10px; }
.site-foot__tag { max-width: 36ch; }
.site-foot__h { font-size: 0.8125rem; font-weight: 650; color: var(--sun); margin-bottom: 12px; }
.site-foot__list { display: grid; gap: 0; }
.site-foot__list--2 { grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: 32px; }
.site-foot__list a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; color: #fff; text-decoration: none; }
.site-foot__list a:hover { color: var(--sun); text-decoration: underline; }
.site-foot__list .i { width: 16px; height: 16px; color: var(--on-forest-2); }
.site-foot__base {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  padding-top: 20px; padding-bottom: 28px;
  font-size: 0.8125rem;
}
.site-foot__base::before { content: ""; position: absolute; top: 0; left: var(--pad); right: var(--pad); border-top: 1px solid var(--forest-line); }
.site-foot__base a { color: inherit; text-decoration: none; }
.site-foot__base a:hover { color: var(--sun); text-decoration: underline; }
.site-foot__base .site-foot__top { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; margin: -4px 0; color: #fff; font-weight: 600; }
.site-foot__top .i { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform 200ms var(--ease); }
.site-foot__top:hover .i { transform: rotate(-90deg) translateX(3px); }

/* ---------- Motion: one authored moment, the home hero arriving ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__text > * { animation: rise 900ms var(--ease) both; }
  .hero__text > :nth-child(2) { animation-delay: 90ms; }
  .hero__text > :nth-child(3) { animation-delay: 170ms; }
  .hero__text > :nth-child(4) { animation-delay: 250ms; }
  .band--hero::before { animation: land 1600ms var(--ease) both; }
  @keyframes land { from { opacity: 0; transform: scale(1.03); } }
  .hero__photo img { animation: unveil 1200ms var(--ease) 120ms both; }
  .glance { animation: rise 900ms var(--ease) 320ms both; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes unveil { from { clip-path: inset(100% 0 0 0 round 16px); } to { clip-path: inset(0 0 0 0 round 16px); } }
}
@media (prefers-reduced-motion: reduce) {
  /* Keep colour feedback; remove movement */
  html { scroll-behavior: auto; }
  .hero__text > *, .hero__photo img, .glance, .band--hero::before, .gpin, .lightbox[open] { animation: none !important; }
  .mat img, .album__item img, .nav a::after, .more-link .i, .site-foot__top .i { transition: none !important; }
  .mat:hover img, .pcard:hover .mat img, .album__item .shot__btn:hover img, .more-link:hover .i { transform: none !important; }
  .btn:active, .pill:active { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .head-cta { display: none; }
}
@media (max-width: 960px) {
  .game { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .game__map { height: 58vh; min-height: 360px; }
  .game__panel { padding: 18px 18px 20px; gap: 14px; }
  .game__keys { display: none; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split__head { position: static; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
  .split__head .more-link { margin-top: 0; }
  .split__note { display: none; }
  .skill-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio { grid-template-columns: 1fr 1fr; }
  .trio > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .utility { display: none; }
  .site-head__row { position: relative; }
  .brand { font-size: 1.1875rem; }
  .nav-toggle { display: inline-flex; height: 40px; padding: 0 16px; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 2px;
    padding: 8px var(--pad) 20px;
    background: var(--forest); border-top: 1px solid var(--forest-line);
  }
  .site-head.is-open .nav { display: flex; }
  .nav a { padding: 14px 0; font-size: 1.1875rem; border-bottom: 1px solid var(--forest-line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { left: 0; right: auto; width: 28px; bottom: 8px; }
  .nav a[aria-current="page"] { color: var(--sun); }

  .band::before { -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.35), #000); mask-image: linear-gradient(180deg, rgba(0,0,0,0.35), #000); }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 36px; }
  .hero__photo { order: -1; width: 104px; }
  .hero__photo img { aspect-ratio: 1 / 1; object-position: 55% 14%; }
  .hero__caption { display: none; }
  .bento { grid-template-columns: 1fr; grid-template-rows: none; height: auto; gap: 32px; }
  .bento .shot:first-child { grid-row: auto; }
  .bento .mat { flex: none; aspect-ratio: 4 / 5; }
  .proj { grid-template-columns: 1fr; gap: 18px; }
  .more, .pgrid, .skill-panel, .trio { grid-template-columns: 1fr; }
  .timeline__item { grid-template-columns: 1fr; gap: 2px; }
  .site-foot__grid { grid-template-columns: 1fr 1fr; }
  .site-foot__id { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .map-wall { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .glance { grid-template-columns: 1fr; }
  .fact, .fact + .fact { padding: 18px 20px; border-left: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; }
  .fact + .fact { border-top: 1px solid var(--line); }
  .fact dt { display: contents; }
  .fact__icon { grid-row: 1 / span 3; }
  .fact__label, .fact__value, .fact__note { grid-column: 2; }
  .fact__label { align-self: end; margin-top: 2px; }
  .hero__actions .pill, .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .ccard__value { font-size: 0.9375rem; }
  .ccard { gap: 12px; padding: 14px 12px 14px 14px; }
  .pub { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .pub__n { width: 26px; height: 26px; font-size: 0.8125rem; }
  .pub__cite { font-size: 1.0625rem; }
}
.block--more { margin-top: 56px; }

/* ---------- Fun: game switcher and Satellite Detective ---------- */
.gametabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.gametab {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; color: var(--ink);
  text-align: left; cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.gametab:hover { border-color: var(--line-2); }
.gametab.is-on { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.gametab__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); }
.gametab.is-on .gametab__icon { background: var(--sun); }
.gametab__icon .i { width: 22px; height: 22px; }
.gametab__text { display: flex; flex-direction: column; min-width: 0; }
.gametab__text b { font-family: var(--serif); font-weight: 500; font-size: 1.1875rem; line-height: 1.25; }
.gametab__text small { color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }

.choices { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 4px; }
.choice {
  min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 0.9375rem; line-height: 1.3; text-align: left; cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.choice:hover:not(:disabled) { border-color: var(--ink-2); background: var(--surface); }
.choice:disabled { cursor: default; }
.choice.is-right { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.is-wrong { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.game__zoom { align-self: flex-start; }
.game__zoom[hidden], .game__tip[hidden] { display: none; }
.game--detective .game__verdict:empty, .game--detective .game__fact:empty { display: none; }
#detective-map { position: absolute; inset: 0; background: var(--map-night, #0B1F2A); }
@media (max-width: 900px) {
  .game--detective { grid-template-areas: "levels" "map" "panel"; }
  .game--detective .game__map { height: 52vh; min-height: 320px; }
  .game--detective .game__panel { border-bottom: 0; }
  .choices { grid-template-columns: 1fr 1fr; }
  .game--detective .game__tip { display: block; }
}
@media (max-width: 560px) {
  .gametab { padding: 12px; gap: 10px; }
  .gametab__icon { display: none; }
}

/* ---------- Fun: how to play ---------- */
.howto { padding: clamp(44px, 6vw, 72px) 0 0; }
.howto__intro { max-width: 62ch; margin-bottom: 28px; }
.howto__intro .sec-title { margin-bottom: 14px; }
.howto__intro p { color: var(--ink-2); }
.howto__levels {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 36px;
}
.howto__levels > div { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.howto__levels dt { font-weight: 650; color: var(--accent); margin-bottom: 4px; }
.howto__levels dd { color: var(--ink-2); font-size: 0.9375rem; }
.howto__sub { font-weight: 650; font-size: 1.0625rem; margin-bottom: 14px; }
.howto__credit { margin-top: 28px; color: var(--muted); font-size: 0.8125rem; max-width: 72ch; }
.howto__lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
.howto__list-title { font-weight: 650; font-size: 0.9375rem; color: var(--accent); margin-bottom: 10px; }
@media (max-width: 820px) { .howto__lists { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .howto__levels { grid-template-columns: 1fr 1fr; } }

/* ---------- 404: page not found ---------- */
.band--404 { min-height: 64vh; display: flex; align-items: center; }
.band--404 > .wrap { width: 100%; }
.notfound { padding: clamp(56px, 8vw, 104px) 0; max-width: 40rem; }
.notfound__code { color: var(--sun); font-size: 1.0625rem; font-weight: 600; margin-bottom: 14px; }
.notfound__title { font-family: var(--serif); font-weight: 500; font-size: clamp(2.5rem, 1.7rem + 3.2vw, 4rem); line-height: 1.02; letter-spacing: -0.025em; color: #fff; margin-bottom: 16px; text-wrap: balance; }
.notfound__text { color: var(--on-forest-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); max-width: 44ch; }
