@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-Variable.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6efe0;
  --paper-bright: #fffdf7;
  --ink: #23201b;
  --ink-soft: #3a352e;
  --muted: #6f6a5e;
  --line: rgba(35, 32, 27, 0.1);
  --sand: #e8d3a4;
  --sand-dark: #d4b87e;
  --green: #7cb86b;
  --green-dark: #2f5d3a;
  --gold: #d9a441;
  --gold-light: #f2c96b;
  --copper: #b45f3c;
  --water: #6fb7c9;
  --work: #d96c4a;
  --certs: #3e8e8a;
  --interests: #8e5a9e;
  --profiles: #4c7df0;
  --font: 'Nunito', 'PingFang HK', 'Microsoft JhengHei', 'Noto Sans TC', ui-rounded, system-ui, -apple-system, sans-serif;
  --shadow: 0 18px 50px rgba(35, 32, 27, 0.16);
  --radius: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper-bright);
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

/* ------------------------------------------------------------------ */
/* The world                                                          */
/* ------------------------------------------------------------------ */
.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
}

.scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}

.scene:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
}

.labels {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.world-label {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 11px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(35, 32, 27, 0.92);
  color: var(--paper-bright);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(35, 32, 27, 0.24);
  backdrop-filter: blur(8px);
  transition: opacity 0.2s ease, background 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.world-label:hover {
  background: #353028;
  box-shadow: 0 10px 26px rgba(35, 32, 27, 0.3);
}

.world-label__dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--label-accent, var(--gold));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.world-label__arrow {
  margin-left: 1px;
  font-size: 0.72em;
  opacity: 0.65;
}

.world-label.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.world-label.is-edge {
  opacity: 0.88;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.34);
}

.world-label.is-edge:hover,
.world-label.is-edge:focus-visible {
  opacity: 1;
}

body.panel-open .world-label {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* HUD                                                                */
/* ------------------------------------------------------------------ */
.hud {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  z-index: 12;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(35, 32, 27, 0.08);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 8px 22px rgba(35, 32, 27, 0.12);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(1.02rem, 1.5vw, 1.32rem);
  letter-spacing: -0.03em;
  text-decoration: none;
  pointer-events: auto;
}

.wordmark__paw {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--gold);
}

.wordmark:hover {
  background: var(--paper-bright);
}

.hud__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid rgba(35, 32, 27, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.88);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(35, 32, 27, 0.1);
  backdrop-filter: blur(12px);
  font-weight: 800;
  font-size: 0.76rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.hud-button:hover {
  background: var(--paper-bright);
  transform: translateY(-1px);
}

.hud-button--icon {
  width: 38px;
  padding: 0;
}

.hud-button--text {
  background: rgba(35, 32, 27, 0.9);
  border-color: rgba(35, 32, 27, 0.9);
  color: var(--paper-bright);
}

.hud-button--text:hover {
  background: var(--ink);
}

.hud-button .icon {
  width: 18px;
  height: 18px;
}

#sound-toggle[aria-pressed='true'] .icon--sound-off {
  display: none;
}

#sound-toggle[aria-pressed='false'] .icon--sound-on {
  display: none;
}

.hud-button.is-muted {
  opacity: 0.72;
}

/* ------------------------------------------------------------------ */
/* Mini-map                                                           */
/* ------------------------------------------------------------------ */
.minimap-shell {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 52px);
  right: 16px;
  z-index: 11;
  width: 164px;
  height: 164px;
  padding: 6px;
  border: 1px solid rgba(35, 32, 27, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 14px 34px rgba(35, 32, 27, 0.16);
  backdrop-filter: blur(12px);
}

.minimap {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Hint                                                               */
/* ------------------------------------------------------------------ */
.hint {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 12;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(35, 32, 27, 0.88);
  color: var(--paper-bright);
  box-shadow: 0 8px 22px rgba(35, 32, 27, 0.2);
  backdrop-filter: blur(10px);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hint.is-faded {
  opacity: 0;
  transform: translateY(8px);
}

/* ------------------------------------------------------------------ */
/* Loader / fatal                                                     */
/* ------------------------------------------------------------------ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  transition: opacity 0.55s ease;
}

.loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.loader__paw {
  width: 64px;
  height: 64px;
  color: var(--gold);
  animation: paw-bob 1.3s ease-in-out infinite;
}

.loader__text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@keyframes paw-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); opacity: 0.8; }
  50% { transform: translateY(-7px) rotate(3deg); opacity: 1; }
}

.fatal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}

.fatal__card {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 24px;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
  text-align: center;
}

.fatal__card h1 {
  margin: 0 0 12px;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.fatal__card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-bright);
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
}

.button:hover {
  background: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Scrim and panel                                                    */
/* ------------------------------------------------------------------ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: transparent;
  opacity: 0;
  transition: opacity 0.22s ease, background 0.22s ease;
}

.scrim.is-visible {
  opacity: 1;
  background: rgba(35, 32, 27, 0.08);
}

.panel {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(35, 32, 27, 0.08);
  border-top: 6px solid var(--panel-accent, var(--gold));
  border-radius: 24px;
  background: var(--paper-bright);
  box-shadow: 0 30px 80px rgba(35, 32, 27, 0.25);
  opacity: 0;
  transform: translateX(28px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.panel.is-open {
  opacity: 1;
  transform: none;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 12px;
}

.panel__kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel__kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--panel-accent, var(--gold));
}

.panel__title {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.panel__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.panel__close,
.panel__tool {
  display: grid;
  place-items: center;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
}

.panel__close {
  width: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
}

.panel__tool {
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.panel__close:hover,
.panel__tool:hover {
  background: rgba(35, 32, 27, 0.06);
}

.panel__body {
  overflow-y: auto;
  padding: 4px 22px max(26px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.panel__body::-webkit-scrollbar {
  width: 8px;
}

.panel__body::-webkit-scrollbar-thumb {
  border: 2px solid var(--paper-bright);
  border-radius: 8px;
  background: rgba(35, 32, 27, 0.18);
}

.panel-intro {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.is-placeholder {
  color: var(--muted);
  font-style: italic;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--copper);
}

.text-link--arrow::after {
  content: '↗';
  font-size: 0.85em;
}

/* Role cards */
.role-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-card {
  padding: 16px;
  border: 1px solid rgba(35, 32, 27, 0.07);
  border-radius: 16px;
  background: #f8f2e5;
}

.role-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.role-card__role {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.15;
}

.role-card__org {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--current {
  background: #b34e30;
  color: #fff;
}

.role-card__meta {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.role-card__summary {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.role-card__highlights {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Certificates */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cert-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(35, 32, 27, 0.06);
  border-radius: 14px;
  background: #f8f2e5;
}

.cert-item__year {
  padding: 5px 0;
  border-radius: 8px;
  background: rgba(62, 142, 138, 0.14);
  color: #2c6e6b;
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
}

.cert-item__main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.cert-item__name {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
}

.cert-item__issuer {
  color: var(--muted);
  font-size: 0.72rem;
}

.cert-item__link {
  color: #2c6e6b;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* Interests */
.interest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.interest-card {
  padding: 14px;
  border: 1px solid rgba(35, 32, 27, 0.06);
  border-radius: 14px;
  background: #f8f2e5;
}

.interest-card__icon {
  display: block;
  margin-bottom: 6px;
  font-size: 1.25rem;
  line-height: 1;
}

.interest-card__title {
  margin: 0 0 4px;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
}

.interest-card__blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* Profiles */
.profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(35, 32, 27, 0.06);
  border-radius: 16px;
  background: #f8f2e5;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.profile-card:hover {
  background: #fff8e9;
  transform: translateY(-1px);
}

.profile-badge {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  color: #fff;
}

.profile-badge--github {
  background: #23201b;
}

.profile-badge--linkedin {
  background: #0a66c2;
}

.profile-badge--email {
  background: var(--copper);
}

.profile-badge .icon {
  width: 19px;
  height: 19px;
}

.profile-card__main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.profile-card__label {
  font-size: 0.88rem;
  font-weight: 900;
}

.profile-card__handle {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card__blurb {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.profile-card__arrow {
  flex: none;
  color: var(--muted);
  font-size: 1rem;
}

/* About */
.about-hero__tagline {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.4;
}

.about-hero__bio {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 7px;
  border: 1px solid rgba(35, 32, 27, 0.07);
  border-radius: 999px;
  background: #f8f2e5;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.pill-link:hover {
  background: #fff8e9;
}

.pill-link .profile-badge {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.pill-link .profile-badge .icon {
  width: 13px;
  height: 13px;
}

/* ------------------------------------------------------------------ */
/* Text version                                                       */
/* ------------------------------------------------------------------ */
.text-page {
  overflow: auto;
  background:
    radial-gradient(circle at 12% 0%, rgba(168, 217, 138, 0.22) 0, transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(246, 214, 150, 0.38) 0, transparent 34%),
    var(--paper);
}

.text-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 239, 224, 0.88);
  backdrop-filter: blur(12px);
}

.text-header .wordmark {
  flex: none;
}

.text-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.text-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 2px;
  text-decoration: none;
  text-underline-offset: 4px;
}

.text-nav a:hover {
  text-decoration: underline;
}

.text-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.prose {
  max-width: 860px;
  margin: 0 auto;
  padding: 46px 24px 90px;
}

.text-intro {
  padding: 12px 0 8px;
}

.text-intro .eyebrow {
  margin: 0;
  color: #2c6e6b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.text-intro h1 {
  margin: 8px 0 14px;
  font-size: clamp(2.7rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

#text-tagline {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.35;
}

#text-intro-note {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.text-section {
  margin-top: 58px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}

.text-section h2 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.text-section .section-blurb {
  max-width: 600px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.text-section h3 {
  margin: 0;
}

.text-page .role-card,
.text-page .cert-item,
.text-page .interest-card,
.text-page .profile-card {
  background: rgba(255, 253, 247, 0.72);
}

.text-page .interest-grid {
  grid-template-columns: repeat(3, 1fr);
}

.text-page .about-links {
  margin-top: 4px;
}

.text-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.text-footer p {
  margin: 0;
  line-height: 1.5;
}

.text-footer a {
  flex: none;
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .text-page .interest-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .text-header {
    position: static;
    flex-wrap: wrap;
    gap: 12px;
  }

  .text-nav {
    order: 3;
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    padding-top: 4px;
  }

  .text-actions {
    margin-left: auto;
  }

  .prose {
    padding-top: 34px;
  }

  .text-section {
    margin-top: 44px;
  }
}

@media (max-width: 720px) {
  .hud {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .wordmark {
    padding: 7px 11px;
    font-size: 1.02rem;
  }

  .wordmark__paw {
    width: 17px;
    height: 17px;
  }

  .hud__actions {
    gap: 6px;
  }

  .hud-button {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 0.7rem;
  }

  .hud-button--icon {
    width: 34px;
  }

  .hud-button .icon {
    width: 16px;
    height: 16px;
  }

  .minimap-shell {
    top: calc(max(10px, env(safe-area-inset-top)) + 48px);
    right: 10px;
    width: 112px;
    height: 112px;
    padding: 5px;
    border-radius: 15px;
  }

  .minimap {
    border-radius: 11px;
  }

  .hint {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 8px 12px;
    font-size: 0.7rem;
  }

  .world-label {
    gap: 5px;
    padding: 6px 9px;
    font-size: 0.67rem;
  }

  .world-label__dot {
    width: 6px;
    height: 6px;
  }

  .panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 78vh;
    max-height: 78dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    transform: translateY(30px);
  }

  .panel__head {
    padding: 18px 18px 10px;
  }

  .panel__body {
    padding: 4px 18px max(24px, env(safe-area-inset-bottom));
  }

  .scrim.is-visible {
    background: rgba(35, 32, 27, 0.32);
  }

  .interest-grid {
    grid-template-columns: 1fr;
  }

  .cert-item {
    grid-template-columns: 42px 1fr;
  }

  .cert-item__link {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .text-header {
    padding: 14px 16px;
  }

  .text-nav {
    order: 3;
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 0;
    scrollbar-width: thin;
  }

  .prose {
    padding: 28px 18px 70px;
  }

  .text-page .interest-grid {
    grid-template-columns: 1fr;
  }

  .text-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 18px 50px;
  }
}

@media (max-width: 400px) {
  .world-label {
    font-size: 0.62rem;
  }
}

@media (max-width: 360px) {
  .minimap-shell {
    top: calc(max(10px, env(safe-area-inset-top)) + 84px);
  }

  .hud-button {
    padding: 7px 9px;
  }
}

@media (pointer: coarse) {
  .world-label {
    min-height: 44px;
    padding: 10px 13px;
    font-size: 0.75rem;
  }

  .hud-button {
    min-height: 44px;
    padding: 10px 13px;
  }

  .hud-button--icon {
    width: 44px;
    padding: 0;
  }

  .panel__close,
  .panel__tool {
    height: 44px;
  }

  .panel__close {
    width: 44px;
  }

  .text-nav a {
    min-height: 44px;
  }
}

/* ------------------------------------------------------------------ */
/* Motion and print                                                   */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .text-header .text-nav,
  .text-actions,
  .text-footer a,
  .skip-link {
    display: none !important;
  }

  .text-page {
    overflow: visible;
    background: #fff;
  }

  .prose {
    max-width: none;
    padding: 0;
  }

  .text-section {
    break-inside: avoid;
  }
}
