:root {
  --ink: #261b14;
  --ink-soft: #4c392b;
  --paper: #f8f1dc;
  --paper-warm: #efe2be;
  --paper-card: #fffaf0;
  --sky: #3fa1c7;
  --cinnamon: #c96b23;
  --amber: #d47c26;
  --forest: #2f6953;
  --meadow: #9bb143;
  --blush: #eb8b9c;
  --gold: #f2c13a;

  --display: "Fraunces", Georgia, "Songti SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-ink: 0 2px 4px rgba(38, 27, 20, 0.08);
  --shadow-ink-lg: 0 6px 16px rgba(38, 27, 20, 0.12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --hairline: rgba(38, 27, 20, 0.1);
  --wash: rgba(38, 27, 20, 0.06);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

/* =========================================
   1. Morning Mist Boot Overlay
   ========================================= */
.boot-veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #fbf5e4 0%, #efe1bc 100%);
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.42s var(--ease), visibility 0.42s var(--ease);
}

body.is-ready .boot-veil {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
}

.boot-mug {
  width: 68px;
  height: 68px;
}

.boot-title {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.boot-sub {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.boot-skip {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--paper-card);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  cursor: pointer;
  transition: transform 0.32s var(--ease), background 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .boot-skip:hover {
    background: var(--gold);
    transform: translateY(-1px);
  }
}

/* =========================================
   2. Top Minimal Floating Bar (Safe-Area Aware)
   ========================================= */
.top-nav {
  position: fixed;
  top: max(14px, calc(env(safe-area-inset-top) + 10px));
  left: max(16px, calc(env(safe-area-inset-left) + 12px));
  right: max(16px, calc(env(safe-area-inset-right) + 12px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease);
}

body.is-ready .top-nav {
  opacity: 1;
  transform: translateY(0);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.nav-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(248, 241, 220, 0.94);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-ink);
  cursor: pointer;
  transition: transform 0.32s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .nav-pill:hover {
    background: #fff9e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  }
}

.nav-pill:active {
  transform: scale(0.96);
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--cinnamon));
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.pill-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
}

/* =========================================
   3. Full-Bleed Cover-Scaled Stage
      - Landscape: 16:9 cover math (1376 / 768 = 1.791667)
      - Portrait:  9:16 cover math (900 / 1600 = 0.5625), single screen, zero pan
   ========================================= */
.stage-viewport {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.squatch-stage {
  position: relative;
  width: max(100vw, calc(100dvh * 1.791667));
  height: max(100dvh, calc(100vw / 1.791667));
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--sky);
}

body.is-ready .squatch-stage {
  transform: scale(1);
}

.stage-picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.stage-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: filter 0.16s var(--ease);
}

body.is-dusk .stage-art,
body.is-dusk .sprite-frame {
  filter: brightness(0.76) saturate(0.94) contrast(1.05) hue-rotate(-7deg);
}

.dusk-tint {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 46% 68%, rgba(255, 194, 98, 0.28) 0%, rgba(255, 146, 66, 0.08) 32%, transparent 62%),
    linear-gradient(180deg, rgba(25, 29, 64, 0.46) 0%, rgba(72, 39, 64, 0.22) 48%, rgba(28, 24, 34, 0.34) 100%);
  mix-blend-mode: multiply;
  transition: opacity 0.16s var(--ease);
}

body.is-dusk .dusk-tint {
  opacity: 1;
}

.paper-grain {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.atmosphere-canvas {
  position: absolute;
  inset: 0;
  z-index: 16;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* =========================================
   4. Sky Hero Typography (Always Above Scene Elements)
   ========================================= */
.sky-hero {
  position: absolute;
  left: 48.5%;
  top: 23.5%;
  transform: translate(-50%, calc(-50% + 6px));
  z-index: 30;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.42s var(--ease) 0.05s, transform 0.42s var(--ease) 0.05s;
}

body.is-ready .sky-hero {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.sky-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--paper);
  -webkit-text-stroke: clamp(1.5px, 0.22vw, 2.8px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
  white-space: nowrap;
}

.sky-tagline {
  margin: 9px auto 0;
  display: inline-block;
  padding: 3px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(248, 241, 220, 0.94);
  color: var(--ink);
  font-size: clamp(0.72rem, 1.05vw, 0.92rem);
  font-weight: 700;
  box-shadow: 2px 3px 0 rgba(38, 27, 20, 0.9);
  white-space: nowrap;
}

/* =========================================
   5. Transparent-PNG Interactive Sprite Shells (Landscape 16:9 Coordinates)
   ========================================= */
.sprite-shell {
  position: absolute;
  z-index: 12;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.sprite-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 85%;
  transition: transform 0.32s var(--ease);
}

.sprite-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.16s var(--ease), filter 0.16s var(--ease);
}

.frame-idle {
  opacity: 1;
}

.frame-active {
  opacity: 0;
}

/* 1. Squatch + Pine Mug (Steady warm cheers pose on hover/click — no frantic mug bounce) */
.sprite-squatch {
  left: 34.5%;
  top: 47.5%;
  width: 22.8%;
  aspect-ratio: 483 / 520;
  z-index: 14;
}

.sprite-squatch .sprite-frame {
  transition: opacity 0.16s var(--ease), filter 0.16s var(--ease);
}

/* 2. Squirrel on Empty Wooden Stump */
.sprite-squirrel {
  left: 60.5%;
  top: 59.8%;
  width: 10.6%;
  aspect-ratio: 198 / 126;
  z-index: 14;
}

/* 3. Blue Singing Bird perched on Left Tree Branch */
.sprite-bluebird {
  left: 20.6%;
  top: 22.8%;
  width: 9.2%;
  aspect-ratio: 175 / 108;
  z-index: 13;
}

/* 4. White Flying Bird soaring in upper sky */
.sprite-whitebird {
  left: 58.2%;
  top: 14.2%;
  width: 9.4%;
  aspect-ratio: 175 / 160;
  z-index: 11;
}

.sprite-whitebird .sprite-stage {
  transform-origin: 50% 50%;
}

/* 5. Hanging Monkey on Upper-Right Vine Loop */
.sprite-monkey {
  left: 78.2%;
  top: 15.2%;
  width: 11.4%;
  aspect-ratio: 239 / 286;
  z-index: 12;
}

.sprite-monkey .sprite-stage {
  transform-origin: 50% 10%;
}

/* 6. Orange Rabbit on Bottom-Left Meadow */
.sprite-rabbit {
  left: 22.8%;
  top: 72.5%;
  width: 9.6%;
  aspect-ratio: 194 / 210;
  z-index: 14;
}

/* 7. Sleeping Spotted Fawn on Bottom-Right Meadow */
.sprite-fawn {
  left: 72.8%;
  top: 73.5%;
  width: 14.2%;
  aspect-ratio: 280 / 224;
  z-index: 14;
}

/* =========================================
   6. Storybook Floating Signposts (3 Main Portals)
   ========================================= */
.signpost {
  position: absolute;
  left: 50%;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: clamp(3px, 0.42vw, 5px) clamp(9px, 1vw, 13px);
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(0.74rem, 1.05vw, 0.9rem);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  opacity: 0;
  transform: translate(-50%, 0);
  transition:
    transform 0.32s var(--ease),
    background 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    opacity 0.42s var(--ease);
}

body.is-ready .signpost {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.signpost-squatch {
  left: 44%;
  top: -8%;
}

.signpost-squirrel {
  left: 52%;
  top: -28%;
}

.signpost-bluebird {
  left: 48%;
  top: 108%;
}
@media (hover: hover) and (pointer: fine) {
  body.is-ready .sprite-shell:hover .signpost,
  body.is-ready .sprite-shell:focus-visible .signpost,
  body.is-ready .sprite-shell.is-gif-playing .signpost {
    transition-delay: 0s;
    background: var(--gold);
    transform: translate(-50%, -1px);
    box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  }
}

.sign-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--cinnamon));
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.sign-badge {
  font-family: var(--mono);
  font-size: 0.72em;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
}

/* =========================================
   7. Easter-Egg Speech Bubble
   ========================================= */
.egg-bubble {
  position: absolute;
  z-index: 25;
  max-width: min(260px, 68%);
  padding: 8px 13px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--paper-card);
  color: var(--ink);
  font-size: clamp(0.76rem, 1.05vw, 0.88rem);
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  transform: translate(-50%, -100%);
  pointer-events: none;
  animation: bubblePop 0.32s var(--ease);
}

.egg-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 12px;
  height: 12px;
  background: var(--paper-card);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  transform: translateX(-50%) rotate(45deg);
}

/* =========================================
   8. Storybook Modal Window
   ========================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 18, 13, 0.5);
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-backdrop[hidden] {
  display: none;
}

.story-modal {
  width: min(560px, 100%);
  max-height: min(82dvh, 660px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-ink-lg), 0 24px 64px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  transform: translateY(6px);
  transition: transform 0.32s var(--ease);
}

.modal-backdrop.is-open .story-modal {
  transform: translateY(0) scale(1);
}

.modal-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 13px 18px;
  border-bottom: 1px solid var(--hairline);
  background: var(--cinnamon);
  color: var(--paper);
}

.modal-chrome[data-theme="projects"] {
  background: var(--amber);
}

.modal-chrome[data-theme="blog"] {
  background: var(--sky);
}

.modal-chrome[data-theme="about"] {
  background: var(--forest);
}

.modal-chrome-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(38, 27, 20, 0.22);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}

.modal-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  transition: transform 0.32s var(--ease), background 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .modal-close:hover {
    background: var(--gold);
    transform: translateY(-1px);
  }
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--paper-card);
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  transition: transform 0.32s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    background: #fffdf6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  }
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-name {
  font-family: var(--display);
  font-size: 1.04rem;
  font-weight: 900;
  color: var(--ink);
}

.project-arrow {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: transform 0.32s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover .project-arrow {
    transform: translate(2px, -2px);
    color: var(--ink);
  }
}

.project-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--paper-warm);
  color: var(--ink-soft);
}

.project-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.project-domain {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: #7c624d;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blog-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--paper-card);
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  transition: transform 0.32s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .blog-item:hover {
    background: #fffdf6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  }
}

.blog-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.blog-item-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ink);
}

.blog-item-date {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: #7a604a;
  white-space: nowrap;
}

.blog-item-excerpt {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.about-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--paper-warm);
  font-size: 0.86rem;
  font-weight: 700;
}

.about-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.shortcut-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--paper-card);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  cursor: pointer;
  transition: transform 0.32s var(--ease), box-shadow 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .shortcut-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  }
}

.shortcut-card strong {
  font-size: 0.95rem;
}

.shortcut-card span {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.about-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #7a604a;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: rgba(239, 226, 190, 0.45);
}

.footer-tabs {
  display: flex;
  gap: 6px;
}

.btn-story {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--paper-card);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  cursor: pointer;
  transition: transform 0.32s var(--ease), background 0.16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn-story:hover {
    background: var(--gold);
    transform: translateY(-1px);
  }
}

.btn-story-primary {
  background: var(--forest);
  color: var(--paper);
}
@media (hover: hover) and (pointer: fine) {
  .btn-story-primary:hover {
    background: #387b62;
    color: var(--paper);
  }
}

/* =========================================
   9. Plan A: Dedicated 9:16 Portrait Storybook Layout
      - Zero horizontal scroll, all 7 animals + title in one cohesive vertical screen
      - Generous touch hitboxes + safe-area insets + bottom-sheet modals
   ========================================= */
@media (orientation: portrait) {
  .squatch-stage {
    /* Exact 9:16 (0.5625) cover math: fills every portrait phone & tablet edge-to-edge */
    width: max(100vw, calc(100dvh * 0.5625));
    height: max(100dvh, calc(100vw / 0.5625));
  }

  /* Sky hero moved cleanly down below Blue Bird ("我的博客") and above Squirrel/Squatch */
  .sky-hero {
    left: 50%;
    top: 31.2%;
  }

  .sky-title {
    font-size: clamp(1.95rem, 9.2vw, 3.2rem);
    -webkit-text-stroke: 2px var(--ink);
  }

  .sky-tagline {
    margin-top: 6px;
    font-size: clamp(0.74rem, 3vw, 0.9rem);
    padding: 3px 12px;
  }

  /* Generous invisible touch halo for easier thumb taps */
  .sprite-shell::before {
    content: "";
    position: absolute;
    inset: -12%;
  }

  /* Portrait-optimized coordinates locked to forest-bg-9x16.jpg */
  .sprite-whitebird {
    left: 58%;
    top: 7.8%;
    width: 17.5%;
  }

  .sprite-bluebird {
    left: 11.5%;
    top: 17.2%;
    width: 17%;
  }

  .sprite-monkey {
    left: 77.5%;
    top: 8.8%;
    width: 19.5%;
  }

  .sprite-squirrel {
    left: 61.8%;
    top: 39.4%;
    width: 19.5%;
  }

  .sprite-squatch {
    left: 12.5%;
    top: 46.5%;
    width: 53%;
  }

  .sprite-rabbit {
    left: 11%;
    top: 75.2%;
    width: 22%;
  }

  .sprite-fawn {
    left: 56%;
    top: 75.2%;
    width: 33%;
  }

  .signpost {
    font-size: clamp(0.76rem, 3.3vw, 0.92rem);
    padding: 4px 10px;
  }

  .signpost-squatch {
    left: 44%;
    top: -6%;
  }

  .signpost-squirrel {
    left: 50%;
    top: -28%;
  }

  .signpost-bluebird {
    left: 54%;
    top: 102%;
  }

  .egg-bubble {
    max-width: 72%;
    font-size: clamp(0.78rem, 3.4vw, 0.92rem);
  }

  .dusk-tint {
    background:
      radial-gradient(circle at 38% 62%, rgba(255, 194, 98, 0.3) 0%, rgba(255, 146, 66, 0.08) 34%, transparent 64%),
      linear-gradient(180deg, rgba(25, 29, 64, 0.46) 0%, rgba(72, 39, 64, 0.22) 48%, rgba(28, 24, 34, 0.34) 100%);
  }
}

@media (max-width: 760px) {
  .nav-pill {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.82rem;
  }

  .modal-backdrop {
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
    align-items: end;
  }

  .story-modal {
    max-height: 82dvh;
    border-radius: 18px 18px 14px 14px;
  }

  .project-grid,
  .about-shortcuts {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-wrap: wrap;
  }
}

/* Shared interaction details; hover feedback is limited to hover-capable pointers. */
.boot-sub, .pill-count, .sign-badge, .modal-badge, .project-tag,
.project-domain, .blog-item-date, .modal-footer > span {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.modal-badge {
  background: var(--paper-warm);
}

:is(button, a, .boot-skip, .nav-pill, .modal-close, .btn-story, .project-card, .blog-item, .shortcut-card) {
  -webkit-tap-highlight-color: transparent;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease), transform 0.32s var(--ease);
}

.project-arrow, .blog-item-excerpt, .shortcut-card span {
  transition: color 0.16s var(--ease), transform 0.32s var(--ease);
}

/* Text links keep their underline on wrapped lines; cards only underline their title. */
.modal-body p a, .project-name, .blog-item-title {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  text-decoration: none;
  transition: color 0.16s var(--ease), background-size 0.25s var(--ease);
}

.modal-body p a { color: var(--ink-soft); }

@media (hover: hover) and (pointer: fine) {
  .project-card:hover, .shortcut-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(38, 27, 20, 0.12);
  }

  .blog-item:hover {
    background: var(--wash);
    transform: none;
    box-shadow: 0 2px 4px rgba(38, 27, 20, 0.08);
  }

  .blog-item:hover .blog-item-excerpt,
  .shortcut-card:hover span { color: var(--ink); }

  .modal-body p a:hover, .project-card:hover .project-name,
  .blog-item:hover .blog-item-title {
    color: var(--ink);
    background-size: 100% 1px;
  }
}

.modal-body p a:focus-visible, .project-card:focus-visible .project-name,
.blog-item:focus-visible .blog-item-title { background-size: 100% 1px; }

/* Only this small rabbit gets the playful rebound. */
.sprite-rabbit .sprite-stage {
  transition-timing-function: cubic-bezier(.28, 1.28, .36, 1);
}

.sprite-shell:is(:focus-visible, .is-gif-playing) .frame-idle { opacity: 0; }
.sprite-shell:is(:focus-visible, .is-gif-playing) .frame-active { opacity: 1; }
.sprite-shell:is(:focus-visible, .is-gif-playing) .sprite-stage {
  transform: translateY(-1px);
}
.sprite-rabbit:is(:focus-visible, .is-gif-playing) .sprite-stage {
  transform: translateY(-3px);
}

@media (hover: hover) and (pointer: fine) {
  .sprite-shell:hover .frame-idle { opacity: 0; }
  .sprite-shell:hover .frame-active { opacity: 1; }
  .sprite-shell:hover .sprite-stage { transform: translateY(-1px); }
  .sprite-rabbit:hover .sprite-stage { transform: translateY(-3px); }
}

/* Press duration applies only while held; release uses the normal 0.32s ease. */
:is(button, a, .boot-skip, .nav-pill, .modal-close, .btn-story, .sprite-shell, .project-card, .blog-item, .shortcut-card):active {
  transform: scale(0.96);
  transition-duration: 0.16s;
}
.project-card:active, .blog-item:active, .shortcut-card:active { transform: scale(0.98); }
.btn-story-primary:active { transform: scale(0.94); }

/* Five entrance groups, spaced 50ms apart. No retained animation can mask a press. */
body.is-ready .signpost { animation: signEnter 0.42s var(--ease) 0.1s backwards; }
body.is-ready .signpost-squirrel { animation-delay: 0.15s; }
body.is-ready .signpost-bluebird { animation-delay: 0.2s; }
@keyframes signEnter {
  from { opacity: 0; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes bubblePop {
  from { opacity: 0; transform: translate(-50%, calc(-100% + 6px)); }
  to { opacity: 1; transform: translate(-50%, -100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .boot-veil { display: none; }
  .top-nav, .sky-hero, .signpost { opacity: 1; }
  .top-nav { transform: none; }
  .sky-hero { transform: translate(-50%, -50%); }
  .signpost { transform: translate(-50%, 0); }
}
