/* Rumah Panjang, in pages: the same longhouse, each of its pieces with a page of its own.
   Same colours, type and shapes as the walk-through: ironwood, dried thatch, the forest, river mist,
   and the amber of an oil lamp kept for what you can press. Pills for buttons, 16px for cards.
   Text is in English and Malay side by side; the page shows the one whose language is on <html lang>. */

:root {
  color-scheme: light;
  --bg: #e4e8e1;
  --card: #eef1ea;
  --panel: #dfe4dc;            /* behind a piece's photograph */
  --ink: #16201b;
  --ink-2: #46544c;
  --card-shadow: 0 14px 40px rgba(22, 34, 28, .16);
  --soft: rgba(22, 32, 27, .08);
  --soft-hover: rgba(22, 32, 27, .14);
  --line: rgba(22, 32, 27, .12);
  --accent: #e2a13a;
  --accent-hover: #d3912c;
  --accent-ink: #16201b;
  --indicator: #8f5a10;
  --halo: rgba(232, 240, 244, .85);
  --backdrop: rgba(12, 20, 17, .55);

  --font: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Gambarino", Georgia, serif;
  --fs-small: .9375rem;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --t-colour: .8s ease;
}
[data-time="night"] {
  color-scheme: dark;
  --bg: #0f1715;
  --card: #141e1b;
  --panel: #18231f;
  --ink: #e8ebe3;
  --ink-2: #a3aea7;
  --card-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --soft: rgba(232, 235, 227, .09);
  --soft-hover: rgba(232, 235, 227, .16);
  --line: rgba(232, 235, 227, .12);
  --indicator: #e2a13a;
  --halo: rgba(6, 12, 11, .8);
  --backdrop: rgba(4, 8, 7, .7);
}

/* one language at a time */
html[lang="en"] [data-l="ms"], html[lang="ms"] [data-l="en"] { display: none !important; }
/* said for a finger on a phone, for a mouse elsewhere */
@media (pointer: coarse) { .for-mouse { display: none !important; } }
@media (pointer: fine), (pointer: none) { .for-touch { display: none !important; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  font: 400 1rem/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: color var(--t-colour), background-color var(--t-colour);
}
.is-menu body { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--indicator); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: fixed; z-index: 60; top: 12px; left: 12px; transform: translateY(-160%);
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
}
.skip:focus-visible { transform: none; }
/* (clear of a phone's notch on its side too) */
.wrap { width: min(var(--max), 100% - 2 * max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right))); margin-inline: auto; }

/* ---------- buttons ---------- */
.pill {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font: 500 1rem/1 var(--font);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--soft); color: var(--ink);
  transition: background-color .16s, transform .12s, color var(--t-colour);
}
.pill:hover { background: var(--soft-hover); }
.pill:active { transform: scale(.97); }
.pill--main { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pill--main:hover { background: var(--accent-hover); }
.pill--card { background: var(--card); box-shadow: var(--card-shadow); }
.pill--card:hover { background: var(--card); color: var(--ink-2); }
.pill .ph { font-size: 1.15em; }
.pill--icon { padding: 0 16px; }
.seg { display: flex; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); transition: background-color var(--t-colour); }
.seg__btn {
  position: relative;
  min-width: 44px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
  background: none; color: var(--ink-2); font-weight: 700; font-size: .9375rem; cursor: pointer;
  transition: background-color .16s, color .16s;
}
.seg__btn::after { content: ""; position: absolute; inset: -4px 0; }   /* finger-sized, though slim */
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* ---------- the bar at the top ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--t-colour), border-color .3s, box-shadow .3s;
}
/* on the home page the bar floats over the house, and settles once you scroll */
.page-home .top { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; }
.page-home .top.is-scrolled { background: var(--bg); border-color: var(--line); }
.brand {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow);
  font: 400 1.25rem/1 var(--display); text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-colour);
}
.menu {
  display: flex; gap: 2px; margin-left: auto; padding: 4px;
  border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow);
  transition: background-color var(--t-colour);
}
.menu a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; font-weight: 500; color: var(--ink-2);
  transition: background-color .16s, color .16s;
}
.menu a:hover { color: var(--ink); background: var(--soft); }
.menu a[aria-current="page"] { color: var(--ink); background: var(--soft-hover); }
.menu .seg { display: none; }
.tools { display: flex; align-items: center; gap: 8px; }
.burger { display: none; }

/* ---------- the house on the home page ---------- */
.hero { position: relative; overflow: hidden; background: #2a3527; }
.house { position: relative; width: 100%; }
.house--wide { aspect-ratio: 2560 / 1440; }
.house--tall { aspect-ratio: 1000 / 1750; display: none; }
.house__img { position: absolute; inset: 0; width: 100%; height: 100%; }
.house__night, .house__lamp { opacity: 0; transition: opacity var(--t-colour); }
[data-time="night"] .house__night { opacity: 1; }
/* by night the lamp you carry shows the house lamp-lit, only around it (main.js moves the circle) */
[data-time="night"] .house__lamp {
  opacity: 1;
  -webkit-mask-image: radial-gradient(circle var(--lr, 0px) at var(--lx, -999px) var(--ly, -999px), #000 0, rgba(0, 0, 0, .7) 35%, transparent 100%);
  mask-image: radial-gradient(circle var(--lr, 0px) at var(--lx, -999px) var(--ly, -999px), #000 0, rgba(0, 0, 0, .7) 35%, transparent 100%);
}
.house__glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle calc(var(--lr, 0px) * .9) at var(--lx, -999px) var(--ly, -999px), rgba(226, 150, 58, .22), rgba(226, 150, 58, 0));
}
[data-time="night"] .house__glow { opacity: 1; }
/* the doors, the board and the jar: each is a way to its piece */
.spot { position: absolute; display: block; border-radius: 3px; }
/* a target bigger than a door far off: at least a finger's width each way, centred on it */
.spot::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(100% + 20px, 44px); height: max(100% + 20px, 44px); transform: translate(-50%, -50%); }
.spot--right::before { left: auto; right: 0; transform: translateY(-50%); }   /* (by the right edge: it reaches left) */
.spot--left::before { left: 0; transform: translateY(-50%); }
.spot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 5px;
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(242, 182, 92, .7);
  opacity: 0; transition: opacity .2s;
}
.spot:hover::after, .spot:focus-visible::after, .spot.is-hinted::after { opacity: 1; }
.spot:focus-visible { outline: none; }
.spot.is-hinted::after { animation: breathe 1.8s ease-in-out infinite; }
.spot__name {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 4px);
  padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--ink); box-shadow: var(--card-shadow);
  font-size: .9375rem; font-weight: 600; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .2s, transform .3s var(--ease);
}
.spot:hover .spot__name, .spot:focus-visible .spot__name { opacity: 1; transform: translate(-50%, 0); }
@keyframes breathe { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

.hero__text {
  position: absolute; z-index: 2;
  top: calc(64px + env(safe-area-inset-top) + clamp(16px, 5vw, 64px)); left: max(var(--gutter), env(safe-area-inset-left));
  max-width: min(760px, 100% - 2 * var(--gutter));
}
.hero__title { margin: 0; font: 400 clamp(3rem, 7.4vw, 7rem)/.95 var(--display); letter-spacing: -.02em; text-shadow: 0 0 18px var(--halo), 0 0 6px var(--halo); }
.hero__line { margin: 14px 0 24px; font-size: clamp(1.05rem, 1.5vw, 1.3rem); font-weight: 500; text-shadow: 0 0 14px var(--halo), 0 0 6px var(--halo), 0 0 2px var(--halo); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vw, 96px) 0; }
.section + .section { padding-top: 0; }
.kicker { margin: 0 0 8px; font-size: .9375rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--indicator); }
.h1 { margin: 0 0 16px; font: 400 clamp(2.5rem, 5vw, 4rem)/1.02 var(--display); letter-spacing: -.01em; }
.h2 { margin: 0 0 12px; font: 400 clamp(1.875rem, 3.4vw, 2.75rem)/1.08 var(--display); }
.lead { margin: 0; max-width: 60ch; font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--ink-2); }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 32px; }
.more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; text-decoration: none; }
.more .ph { transition: transform .2s var(--ease); }
.more:hover .ph { transform: translateX(4px); }
.page-head { padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); }

/* ---------- pieces as cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.piece {
  display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden; background: var(--card); text-decoration: none;
  box-shadow: 0 1px 0 var(--line);
  transition: transform .3s var(--ease), box-shadow .3s, background-color var(--t-colour);
}
.piece:hover { transform: translateY(-4px); box-shadow: var(--card-shadow); }
/* (the frame keeps its shape whatever the piece's: a tall one is fitted in, not let stretch the card) */
.piece__fig { aspect-ratio: 4 / 5; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; padding: 24px; background: var(--panel); transition: background-color var(--t-colour); }
.piece__fig img { width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(20, 14, 8, .25)); transition: transform .5s var(--ease); }
.piece:hover .piece__fig img { transform: scale(1.04); }
.piece__body { display: flex; flex-direction: column; gap: 4px; padding: 20px 24px 24px; flex: 1; }
.piece__name { margin: 0; font: 400 1.5rem/1.15 var(--display); }
.piece__meta { margin: 0; font-size: var(--fs-small); color: var(--ink-2); }
.piece__go { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.piece__go .ph { transition: transform .2s var(--ease); }
.piece:hover .piece__go .ph { transform: translateX(4px); }
.piece[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: none; font-weight: 500; cursor: pointer; transition: background-color .16s, color .16s, border-color .16s; }
.chip:hover { background: var(--soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip__n { margin-left: 6px; opacity: .6; }
.note { margin: 32px 0 0; font-size: var(--fs-small); color: var(--ink-2); }

/* ---------- one piece ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; padding: 24px 0 0; font-size: var(--fs-small); color: var(--ink-2); }
.crumbs a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; padding: 0 6px; margin-left: -6px; text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--ink); }
.work { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; padding: 16px 0 clamp(48px, 7vw, 80px); }
.work__fig {
  position: sticky; top: calc(84px + env(safe-area-inset-top));
  margin: 0; border-radius: 16px; overflow: hidden; background: var(--panel);
  transition: background-color var(--t-colour);
}
.work__stage { position: relative; height: min(76svh, 760px); display: flex; align-items: center; justify-content: center; padding: clamp(20px, 3vw, 40px); overflow: hidden; touch-action: pan-y; cursor: zoom-in; border-radius: 16px; }
.work__stage:focus-visible { outline-offset: -4px; }
.work__stage img { max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(20, 14, 8, .28)); transition: transform .45s var(--ease); background-size: cover; }
.work__stage.is-zoomed { cursor: zoom-out; touch-action: none; }
.work__stage.is-zoomed img { transform: scale(2.4); filter: none; }
.work__how { display: flex; gap: 8px; align-items: center; margin: 0; padding: 12px 20px 16px; font-size: var(--fs-small); color: var(--ink-2); }
.work__how .ph { color: var(--indicator); font-size: 1.2em; flex: none; }
.work__title { margin: 0 0 20px; font: 400 clamp(2.25rem, 4.4vw, 3.5rem)/1.05 var(--display); letter-spacing: -.01em; }
.facts { margin: 0 0 24px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: var(--fs-small); color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; }
.work__line { margin: 0 0 24px; font-size: 1.125rem; max-width: 46ch; }
.work__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.src { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: var(--fs-small); color: var(--ink-2); }

/* where it is in the longhouse: the house drawn small, every piece a mark on it */
.where { padding: 20px 20px 16px; border-radius: 16px; background: var(--card); transition: background-color var(--t-colour); }
.where__title { margin: 0 0 4px; font-weight: 700; }
.where__text { margin: 0 0 12px; font-size: var(--fs-small); color: var(--ink-2); }
.minimap { position: relative; height: 64px; cursor: pointer; }
.minimap svg { position: absolute; inset: 8px 0; width: 100%; height: calc(100% - 16px); fill: var(--ink); opacity: .14; }
.minimap__mark { position: absolute; top: 0; bottom: 0; width: 24px; transform: translateX(-50%); }
.minimap__mark::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 16px; transform: translate(-50%, -50%);
  border-radius: 2px; background: var(--ink-2); transition: background-color .16s, transform .2s var(--ease);
}
.minimap__mark--jar::before { width: 10px; height: 11px; border-radius: 45% 45% 40% 40%; top: 62%; }
.minimap__mark--board::before { width: 6px; height: 14px; }
.minimap__mark--other::before { background: var(--line); }
a.minimap__mark:hover::before { background: var(--ink); }
.minimap__mark[aria-current="page"]::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); transform: translate(-50%, -50%) scale(1.3); }
@media (pointer: coarse) {
  .minimap__mark { pointer-events: none; }   /* a finger taps the map; the nearest mark answers */
  .menu a { min-height: 44px; }
}
.minimap.is-hinted { border-radius: 12px; box-shadow: 0 0 0 3px var(--accent); animation: breathe 1.8s ease-in-out infinite; }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: clamp(56px, 8vw, 96px); }
.step { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--card); text-decoration: none; transition: background-color var(--t-colour), transform .3s var(--ease); }
.step:hover { transform: translateY(-2px); }
.step--next { justify-content: flex-end; text-align: right; }
.step img { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: var(--panel); padding: 6px; flex: none; }
.step__dir { display: block; font-size: var(--fs-small); color: var(--ink-2); }
.step__name { display: block; font: 400 1.375rem/1.15 var(--display); }

/* ---------- about, contact ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.frame { margin: 0; border-radius: 16px; overflow: hidden; background: var(--panel); }
.frame img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.frame figcaption { padding: 12px 16px; font-size: var(--fs-small); color: var(--ink-2); }
.frame__night { display: none; }
[data-time="night"] .frame__day { display: none; }
[data-time="night"] .frame__night { display: block; }
.words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.word { padding: 24px; border-radius: 16px; background: var(--card); transition: background-color var(--t-colour); }
.word__term { margin: 0 0 8px; font: 400 1.75rem/1.1 var(--display); }
.word p { margin: 0; color: var(--ink-2); }
.prose p { margin: 0 0 16px; max-width: 62ch; }
.credit { font-size: var(--fs-small); color: var(--ink-2); }
.band { padding: clamp(32px, 5vw, 56px); border-radius: 16px; background: var(--card); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; transition: background-color var(--t-colour); }
.band .h2 { margin-bottom: 4px; }
.band p { margin: 0; color: var(--ink-2); }
.ask { max-width: 560px; padding: clamp(24px, 4vw, 40px); border-radius: 16px; background: var(--card); transition: background-color var(--t-colour); }
.field { display: block; margin: 0 0 8px; font-weight: 700; }
.select {
  width: 100%; min-height: 48px; margin: 0 0 20px; padding: 0 44px 0 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
  font: 500 1rem/1 var(--font); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}

/* ---------- the foot of every page ---------- */
.foot { padding: 48px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot__in { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; }
.foot__brand { margin: 0 0 8px; font: 400 1.5rem/1 var(--display); }
.foot__nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot__nav a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.foot__nav a:hover { color: var(--ink); }
.foot p { margin: 0 0 8px; font-size: var(--fs-small); color: var(--ink-2); }

/* things come into view softly as you scroll to them */
.js .rise { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.js .rise.is-in { opacity: 1; transform: none; }

/* ---------- first-visit hints: what can be done here, each said once (multi.js places them) ---------- */
.hint { position: fixed; z-index: 40; left: 0; top: 0; max-width: min(360px, calc(100vw - 24px)); pointer-events: none; transition: transform .3s var(--ease); }
.hint.is-placing { transition: none; }
.hint__in {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px; border-radius: 24px;
  background: var(--card); color: var(--ink); box-shadow: var(--card-shadow);
  font: 600 .9375rem/1.3 var(--font);
  opacity: 0; transform: translateY(6px) scale(.96);
  transition: opacity .25s, transform .4s var(--ease), background-color var(--t-colour), color var(--t-colour);
}
.hint.is-on .hint__in { opacity: 1; transform: none; }
.hint.is-quick .hint__in { transition: none; }
.hint__in::before { content: ""; position: absolute; left: var(--ax, 50%); width: 12px; height: 12px; margin-left: -6px; background: inherit; transform: rotate(45deg); display: none; }
.hint[data-arrow="up"] .hint__in::before { display: block; top: -5px; border-radius: 3px 0 0 0; }
.hint[data-arrow="down"] .hint__in::before { display: block; bottom: -5px; border-radius: 0 0 3px 0; }
.hint__icon { position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 18px; }
.hint.is-on[data-move="tap"] .hint__icon i { animation: hint-tap 1.6s ease-in-out infinite; }
@keyframes hint-tap { 0%, 30%, 100% { transform: none; } 12% { transform: scale(.8); } }
.hint.is-on[data-move="tap"] .hint__icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: hint-ring 1.6s ease-out infinite; }
@keyframes hint-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.hint.is-on[data-move="drift"] .hint__icon i { animation: hint-drift 2.4s ease-in-out infinite; }
@keyframes hint-drift { 0%, 100% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -2px); } }
.pill.is-hinted::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 3px var(--accent); animation: breathe 1.8s ease-in-out infinite; }

/* ---------- tablets and phones ---------- */
@media (max-width: 960px) {
  .work { grid-template-columns: 1fr; }
  .work__fig { position: static; }
  .work__stage { height: min(62svh, 620px); }
  .split { grid-template-columns: 1fr; }
  .words { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  /* the menu folds into a sheet behind a button */
  .top { padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); }
  .brand { padding: 0 16px; font-size: 1.125rem; }
  .tools { margin-left: auto; }
  .tools .seg, .tools [data-time-label] { display: none; }
  .burger {
    display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%; background: var(--card); box-shadow: var(--card-shadow); font-size: 22px; cursor: pointer;
    transition: background-color var(--t-colour);
  }
  .menu {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 4px;
    margin: 0; padding: calc(80px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    border-radius: 0; background: var(--bg); box-shadow: none;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s, transform .35s var(--ease), visibility 0s .35s, background-color var(--t-colour);
  }
  .is-menu .menu { visibility: visible; opacity: 1; transform: none; transition: opacity .25s, transform .35s var(--ease), visibility 0s, background-color var(--t-colour); }
  .menu a { min-height: 56px; padding: 0 8px; font: 400 2.25rem/1 var(--display); color: var(--ink); border-radius: 12px; }
  .menu a[aria-current="page"] { background: none; color: var(--indicator); }
  .menu .seg { display: inline-flex; align-self: flex-start; margin-top: 24px; box-shadow: none; background: var(--card); }
  .is-menu .top { background: var(--bg); border-color: transparent; }
  .head { margin-bottom: 24px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .steps { grid-template-columns: 1fr; }
  .foot__in { grid-template-columns: 1fr; }
}
/* a phone held upright: the house drawn for a tall screen */
@media (max-aspect-ratio: 4/5) {
  .house--wide { display: none; }
  .house--tall { display: block; }
  .hero__title { font-size: clamp(3rem, 15vw, 4.5rem); }
}
@media (max-width: 560px) {
  .where { padding: 16px 16px 12px; }   /* (the map as wide as can be: a finger's share for each piece) */
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .piece__fig { padding: 14px; }
  .piece__body { padding: 14px 14px 16px; }
  .piece__name { font-size: 1.25rem; }
  .piece__go { display: none; }
  .step img { width: 56px; height: 56px; }
  .band { padding: 24px; }
}
/* a phone on its side: the house shorter, the words beside it */
@media (max-height: 500px) and (orientation: landscape) {
  .hero__text { top: calc(60px + env(safe-area-inset-top)); }
  .hero__title { font-size: 2.5rem; }
  .hero__line { margin: 6px 0 12px; font-size: 1rem; }
  .work__stage { height: calc(100svh - 160px - env(safe-area-inset-bottom)); }   /* (all of it in view under the bar) */
  .menu { justify-content: flex-start; padding-top: calc(72px + env(safe-area-inset-top)); overflow-y: auto; }
  .menu a { min-height: 48px; font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .rise { opacity: 1; transform: none; }
}
