@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --fg: #ece6da;
  --muted: #9a9385;
  --dim: #3a3832;
  --accent: #ffb454;
  --hat: #ff8f70;
  --panel: rgba(13, 13, 15, 0.84);
  --line: rgba(236, 230, 218, 0.12);
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --halo: 0 0 3px #000, 0 0 10px rgba(0, 0, 0, 0.9), 0 0 22px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

/* ---------- backdrop ---------- */
#backdrop {
  position: fixed;
  inset: 0;
  width: 100%;   /* always fills the window, even mid-resize */
  height: 100%;
  z-index: 0;
  touch-action: none;
}
#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* quiet focus: a wide soft pool behind the name, darker top + bottom edges
     so the floating links and the bar always read */
  background:
    radial-gradient(52% 34% at 50% 48%, rgba(8, 8, 10, 0.16), rgba(8, 8, 10, 0) 72%),
    linear-gradient(to bottom, rgba(8, 8, 10, 0.4), rgba(8, 8, 10, 0) 13%, rgba(8, 8, 10, 0) 80%, rgba(8, 8, 10, 0.6));
}

/* ---------- avatar ---------- */
#world { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }

.avatar {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.avatar-sprite {
  margin: 0;
  font-family: var(--mono);
  white-space: pre;
  color: #f6efe3;
  text-shadow: var(--halo);
  pointer-events: auto;
  cursor: pointer;
  position: relative;
}
.avatar-sprite .hat { color: var(--hat); }
.avatar-sprite { transition: opacity .4s ease, filter .4s ease, transform .4s ease; transform-origin: 50% 100%; }
.avatar.real .avatar-sprite { opacity: 0; filter: blur(2px); transform: scale(0.8); }
.avatar-icon {
  position: absolute;
  color: #f8f2e7;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)) drop-shadow(0 3px 8px rgba(0,0,0,.45));
  opacity: 0;
  transform: scale(0.6);
  transform-origin: 50% 100%;
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .8, .2, 1.25);
  pointer-events: none;
  cursor: pointer;
}
.avatar.real .avatar-icon { opacity: 1; transform: none; pointer-events: auto; }
.avatar-icon .body { position: absolute; inset: 0; display: block; transition: transform .2s; }
.avatar-icon svg { width: 100%; height: 100%; display: block; }
.avatar.walking .avatar-icon .body svg { animation: step .44s ease-in-out infinite; }
@keyframes step { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8%); } }
.avatar-icon .badge {
  position: absolute;
  right: -46%;
  top: -14%;
  width: 52%;
  height: 52%;
  padding: 9%;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(18, 18, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: badge-in .5s cubic-bezier(.2, .8, .2, 1.3);
}
@keyframes badge-in { from { transform: scale(0); } }
.avatar.squeeze .avatar-sprite,
.avatar.squeeze .avatar-icon { animation: squeeze .7s cubic-bezier(.3, .7, .3, 1) both; }
@keyframes squeeze {
  0%   { transform: scale(1, 1); }
  28%  { transform: scale(0.3, 1.18); }
  50%  { transform: scale(0.22, 1.24); }
  72%  { transform: scale(1.22, 0.84); }
  86%  { transform: scale(0.94, 1.06); }
  100% { transform: scale(1, 1); }
}
.avatar-bit {
  position: absolute;
  left: var(--emote-x, 20px);
  top: 45%;
  font-size: 11px;
  color: var(--accent);
  text-shadow: var(--halo);
  pointer-events: none;
  animation: bit .75s ease-out forwards;
}
@keyframes bit {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to   { opacity: 0; transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(0.6); }
}

.avatar-shadow {
  position: absolute;
  width: 28px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0) 70%);
}
.avatar-emote {
  position: absolute;
  left: var(--emote-x, 20px);
  top: -6px;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--accent);
  text-shadow: var(--halo);
  white-space: nowrap;
  animation: emote 2.6s ease-out forwards;
  pointer-events: none;
}
@keyframes emote {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

/* ---------- section guides (js/guides.js) ---------- */
.guides { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.guides.on { opacity: 1; }
.guide {
  position: absolute; top: 0; left: 0;
  display: block; padding: 0; margin: 0; border: 0; background: none;
  pointer-events: auto; cursor: pointer;
  transform-origin: 0 0; will-change: transform;
  color: var(--c);
}
.guide-body { position: relative; display: block; transform-origin: 50% 60%; }
.guide-body canvas { display: block; image-rendering: pixelated; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.guide-ascii {
  margin: 0;
  font: 700 var(--guide-font, 8.5px)/1.05 var(--mono);
  white-space: pre;
  text-shadow: 0 0 2px #000, 0 0 6px rgba(0, 0, 0, 0.8);
}
.guide-ascii i { font-style: normal; }
.guide-ascii .hi { color: var(--c); }
.guide-ascii .lo { color: color-mix(in srgb, var(--c) 55%, #000); }
.guide-label {
  position: absolute; left: 50%; bottom: calc(100% + 4px);
  transform: translateX(-50%);
  font: 600 9px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c); white-space: nowrap;
  padding: 3px 5px; background: rgba(11, 11, 13, 0.72);
  opacity: 0.75; transition: opacity .2s, transform .2s;
}
.guide:hover .guide-label, .guide:focus-visible .guide-label { opacity: 1; transform: translateX(-50%) translateY(-3px); }
.guide:hover .guide-body, .guide:focus-visible .guide-body { filter: brightness(1.2); }
.guide:focus-visible { outline: 1px dashed var(--c); outline-offset: 4px; }
.guide-shadow {
  position: absolute; left: 15%; right: 15%; bottom: -3px; height: 6px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.55); filter: blur(2px);
  transform-origin: 50% 50%;
}
/* the same guides as small icons in the top nav */
#top #nav a { align-items: center; }
.nav-icon { display: inline-grid; place-items: center; width: 28px; height: 22px; flex: none; }
.nav-icon canvas { display: block; max-height: 22px; width: auto !important; image-rendering: pixelated; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.nav-ascii { --guide-font: 3.3px; line-height: 1; letter-spacing: -0.02em; }
#nav a:hover .nav-icon, #nav a.on .nav-icon { filter: brightness(1.25); }
#top #nav a.on, #top #nav a:hover { color: var(--c, #fff); }

/* the two forms: dithered pixels, or clean flat colour over the real photo */
.guide-form { display: block; transform-origin: 50% 100%; }
.guide-form canvas.form-photo { image-rendering: auto; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45)) saturate(1.1); border-radius: 2px; }
/* crossing between them: squash flat, swap at the thinnest point, spring back */
.guide-form.squeeze { animation: guide-squeeze .42s cubic-bezier(.3, .7, .3, 1.3) both; }
@keyframes guide-squeeze {
  0%   { transform: scale(1, 1); }
  40%  { transform: scale(0.08, 1.25); filter: brightness(1.8); }
  55%  { transform: scale(0.08, 1.25); filter: brightness(1.8); }
  100% { transform: scale(1, 1); filter: none; }
}
@media (prefers-reduced-motion: reduce) { .guide-form.squeeze { animation: none; } }

/* ---------- cursor ring ---------- */
#ring {
  position: fixed; top: 0; left: 0; z-index: 100;
  width: 0; height: 0;
  pointer-events: none;
  mix-blend-mode: difference;   /* white ring inverts what's under it: always visible */
  opacity: 0; transition: opacity .25s;
}
#ring.on { opacity: 1; }
#ring::before {
  content: ""; position: absolute;
  width: 26px; height: 26px; left: -13px; top: -13px;
  border: 1.5px solid #fff; border-radius: 50%;
  transition: width .2s var(--ease), height .2s var(--ease), left .2s var(--ease), top .2s var(--ease), border-width .2s;
}
#ring.hot::before { width: 40px; height: 40px; left: -20px; top: -20px; }
#ring.down::before { width: 18px; height: 18px; left: -9px; top: -9px; border-width: 2.5px; }

/* ---------- hero ---------- */
#hero {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  z-index: 3;
  pointer-events: none;
  text-align: center;
  padding: 0 16px 6vh;
}

#banner {
  margin: 0;
  font-weight: 400;
  pointer-events: auto;
}
.logo {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  white-space: pre;
  color: #f7f1e6;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.6s ease, transform 1.8s cubic-bezier(.2, .7, .2, 1);
  cursor: default;
}
.logo-tilt {
  display: inline-block;
  transform: perspective(1000px) rotateX(var(--rx, 10deg)) rotateY(var(--ry, -12deg)) rotateZ(-2.5deg);
  transform-origin: 50% 60%;
  filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.55));
  will-change: transform;
}
/* front faces, shaded like a rounded surface lit from the top-left */
.logo .f3 { color: #fffbf2; }
.logo .f2 { color: #eee5d4; }
.logo .f1 { color: #cdc1ac; }
.logo .f0 { color: #9e927e; }
/* 3D back side: dark ascii in shadow (deepest part darkest) */
.logo .x0, .logo .x1 {
  background: rgba(9, 9, 11, 0.9);
  font-weight: 400;
  text-shadow: none;
}
.logo .x0 { color: #4a443c; }
.logo .x1 { color: #6d6458; }
body.ready .logo {
  opacity: 1;
  transform: none;
  animation: bob 4.2s ease-in-out 2s infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

#tagline {
  margin: 0.2rem 0 0;
  font-family: var(--sans);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #efe8db;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1.4s var(--ease) 1.1s, transform 1.4s var(--ease) 1.1s;
}
body.ready #tagline { opacity: 1; transform: none; }

/* ---------- top bar: name + numbered sections ---------- */
#top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 28px 20px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 1.2s var(--ease) 1.6s, transform 1.2s var(--ease) 1.6s;
}
body.ready #top { opacity: 1; transform: none; }
#mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  font: 600 14px/1 var(--sans);
  letter-spacing: 0.01em;
  color: #f4ede1;
  text-decoration: none;
}
/* a dark plate so the name reads over any photo */
#mark {
  padding: 8px 12px 7px;
  border-radius: 10px;
  /* light frosted glass, same family as the style switcher at the bottom */
  background: rgba(13, 13, 15, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .25s;
}
#mark:hover, #mark:focus-visible { background: rgba(13, 13, 15, 0.38); outline: none; }
#mark .logo-tilt { display: inline-flex; align-items: flex-end; gap: 0.5em; filter: none; }
#mark .logo { animation: none; font-weight: 800; text-shadow: 0 0 2px var(--mark-glow, rgba(0, 0, 0, 0.85)), 0 0 8px var(--mark-glow, rgba(0, 0, 0, 0.45)); }
#mark .logo span { transition: color .9s ease; }
/* brighter faces and a lighter 3d side than the big version, for small sizes */
/* colours come from the photo (themeMark in js/main.js) */
#mark .logo .f3, #mark .logo .f2 { color: var(--mark-face, #ffffff); }
#mark .logo .f1 { color: var(--mark-face2, #f1e8d8); }
#mark .logo .f0 { color: var(--mark-face3, #d6cab5); }
#mark .logo .x0, #mark .logo .x1 { background: none; }
#mark .logo .x0 { color: var(--mark-side2, #ff9f3a); }
#mark .logo .x1 { color: var(--mark-side, #ffb454); }
#nav {
  display: flex;
  gap: 4px;
}
#nav a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.02em;
  color: rgba(239, 232, 219, 0.7);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
#nav a i {
  font: normal 9px/1 var(--mono);
  letter-spacing: 0.06em;
  color: rgba(239, 232, 219, 0.38);
  transition: color .2s;
}
#nav a:hover, #nav a:focus-visible, #nav a.on { color: #fff; background: rgba(255, 255, 255, 0.07); outline: none; }
#nav a:hover i, #nav a:focus-visible i, #nav a.on i { color: var(--accent); }

/* ---------- bottom bar: caption · slider · credit ---------- */
#bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 28px max(18px, calc(env(safe-area-inset-bottom) + 10px));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s var(--ease) 2s, transform 1.2s var(--ease) 2s;
}
body.ready #bar { opacity: 1; transform: none; }

#caption {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
#caption-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: opacity .45s ease;
}
#caption-text.swap { opacity: 0; }
#caption-text .title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: #f4ede1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#caption-text .meta {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(239, 232, 219, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#caption button {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font: 15px/1 var(--sans);
  color: rgba(239, 232, 219, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
#caption button:hover, #caption button:focus-visible { color: #fff; border-color: rgba(255, 180, 84, 0.7); background: rgba(255, 180, 84, 0.12); outline: none; }
#next { order: 3; }

/* dither <-> photo (double-click anywhere does the same) */
#flip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(239, 232, 219, 0.6);
  padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(13, 13, 15, 0.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer; transition: color .2s, border-color .2s;
}
#flip .k { color: rgba(239, 232, 219, 0.38); }
#flip #flip-to { color: #f4ede1; }
#flip:hover, #flip:focus-visible { color: #fff; border-color: rgba(255, 180, 84, 0.6); outline: none; }

#copy {
  justify-self: end;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(239, 232, 219, 0.4);
}

/* one-time drag hint */
#hint {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 5;
  transform: translate(-50%, 6px);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #f4ede1;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(13, 13, 15, 0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s ease, transform .8s var(--ease);
}
#hint.show { opacity: 1; transform: translate(-50%, 0); }
#hint.gone { opacity: 0; transform: translate(-50%, 6px); }

/* ---------- panel ---------- */
/* ---------- section pages (full screen, #work, #travel, ...) ---------- */
#page {
  position: fixed; inset: 0; z-index: 4;
  overflow-y: auto;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--c, #ffb454) 14%, transparent), transparent 70%),
    #0b0b0d;
  color: var(--fg);
  font-family: var(--sans);
}
#page[hidden] { display: none; }
#page.swap .page-inner { animation: page-swap .35s ease both; }
@keyframes page-swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-inner { max-width: 760px; margin: 0 auto; padding: 96px 24px 96px; }
#page-back {
  font: 500 12px/1 var(--mono); letter-spacing: 0.06em;
  color: rgba(239, 232, 219, 0.7);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
#page-back:hover, #page-back:focus-visible { color: var(--c); border-color: var(--c); outline: none; }
.page-head { display: flex; align-items: center; gap: 16px; margin: 28px 0 18px; }
#page-icon { display: grid; place-items: center; }
#page-icon canvas { display: block; image-rendering: pixelated; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)); }
#page-icon .guide-ascii { --guide-font: 8px; }
#page .panel-art { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 6px; height: clamp(160px, 32vh, 300px); }
body.paged #bar, body.paged #hint { opacity: 0; pointer-events: none; }

/* the dithered flood between pages (js/transition.js) */
#wipe { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; display: none; }
#wipe.on { display: block; }
/* the guides acting out their page journeys (js/journeys.js) */
#journey { position: fixed; inset: 0; z-index: 61; width: 100%; height: 100%; pointer-events: none; display: none; }
#journey.on { display: block; }

#panel-title {
  margin: 0;
  color: var(--c, inherit);
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

/* section illustration (js/art.js), full width under the title bar */
.panel-art {
  flex: none;
  margin: 4px 0 6px;
  height: clamp(130px, 28vh, 230px);
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.panel-art[hidden] { display: none; }
.panel-art-img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  animation: art-in .5s var(--ease) both;
}
@keyframes art-in { from { opacity: 0; filter: contrast(2) brightness(1.4); } to { opacity: 1; filter: none; } }
#panel-body {
  font-size: 16px;
  line-height: 1.65;
}
#panel-body p { margin: 0 0 0.8em; color: rgba(239, 232, 219, 0.86); }
#panel-body .intro { color: rgba(239, 232, 219, 0.6); font-size: 14px; margin-bottom: 18px; }

.rows { display: grid; }
.row {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  gap: 0 1.2em;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .k { font: 12px/1.9 var(--mono); color: rgba(239, 232, 219, 0.5); }
.row .t b { font-weight: 600; color: #f7f1e6; }
.row .t .at { color: rgba(239, 232, 219, 0.6); }
.row .t .note { color: rgba(239, 232, 219, 0.6); display: block; font-size: 14px; }
.row a { color: #f7f1e6; text-decoration: none; border-bottom: 1px solid rgba(255, 180, 84, 0.5); transition: color .2s, border-color .2s; }
.row a:hover { color: var(--accent); border-color: var(--accent); }

/* travel gallery */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.card {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0b0d;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, transform .3s var(--ease);
}
.card canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.card .meta { padding: 9px 11px 11px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.card .meta span { display: block; font: 11px/1.5 var(--mono); color: rgba(239, 232, 219, 0.5); font-weight: 400; }
.card:hover, .card:focus-visible { border-color: rgba(255, 180, 84, 0.6); transform: translateY(-2px); outline: none; }
.card.current { border-color: rgba(239, 232, 219, 0.45); }

/* tablets and phones: the nav already lists every section, so the drifting
   links step aside; the bar stacks */
@media (max-width: 760px) {
  #top { flex-direction: column; gap: 10px; padding-top: max(16px, env(safe-area-inset-top)); }
  #nav a { padding: 8px 8px; font-size: 12px; }
  #nav a i { display: none; }
  #bar { grid-template-columns: 1fr; gap: 12px; padding: 14px 18px max(16px, calc(env(safe-area-inset-bottom) + 8px)); }
  #caption { justify-content: space-between; }
  #caption-text { align-items: center; text-align: center; flex: 1; }
  #flip { justify-self: center; }
  #copy { display: none; }
  #hint { bottom: 132px; }
  .row { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .page-inner { padding: 80px 18px 80px; }
}

/* short screens (phones in landscape) */
@media (max-height: 560px) {
  #hero { gap: 0.5rem; padding-bottom: 8vh; }
  #top { padding-top: 12px; padding-bottom: 12px; }
  #hint { display: none; }
  #bar { padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

body.still *, body.still *::before, body.still *::after { transition: none !important; animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .glyph, body.ready .glyph { animation: none; transition: none; }
}

/* ---------- 404 page (deploy/404.html) ---------- */
body.notfound { overflow: auto; display: grid; place-items: center; min-height: 100vh; }
.nf { text-align: center; font-family: var(--sans); color: var(--fg); }
.nf-code { font: 700 72px/1 var(--mono); color: var(--accent); margin: 0 0 12px; }
.nf a { color: var(--accent); }
