/* ------------------------------------------------------------------
   Mercy of Ooo — palette pulled from the two hero refs
------------------------------------------------------------------ */
:root {
  --sky-top:   #6b4a8b;
  --sky-mid:   #ee5b8a;
  --sky-bot:   #f5a85e;
  --cloud:     #fbc9a0;
  --hair-a:    #f26e2e;
  --hair-b:    #ee4b7f;
  --hill:      #8fcb6b;
  --hill-2:    #6ba757;
  --mtn:       #6d8fbf;
  --mtn-2:     #a08bc4;
  --ink:       #1a1a1a;
  --gold:      #e8a64e;
  --cream:     #fbeed2;
  --card:      #fff5df;
  --card-line: #2a1f14;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body {
  font-family: "Courier New", ui-monospace, monospace;
  color: var(--ink);
  background: var(--sky-bot);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Sky / Ooo backdrop (parallax layers) ---------- */
.sky {
  position: fixed; inset: 0;
  background:
    linear-gradient(180deg,
      var(--sky-top) 0%,
      #a95b98 22%,
      var(--sky-mid) 46%,
      #f6885e 72%,
      var(--sky-bot) 100%);
  z-index: -3;
}
.sky::before, .sky::after {
  content: "";
  position: absolute;
  background: var(--cloud);
  border-radius: 50%;
  opacity: 0.85;
  filter: blur(1px);
}
.sky::before {
  width: 240px; height: 60px;
  top: 12%; left: 8%;
  box-shadow:
    360px 60px 0 -8px var(--cloud),
    720px 20px 0 -4px var(--cloud),
    1080px 80px 0 -10px var(--cloud);
}
.sky::after {
  width: 180px; height: 44px;
  top: 24%; right: 10%;
  box-shadow: -400px 40px 0 -6px var(--cloud), -820px 90px 0 -8px var(--cloud);
}

.mountains {
  position: fixed; left: 0; right: 0; bottom: 26%;
  height: 40vh;
  z-index: -2;
  background:
    linear-gradient(180deg, transparent 40%, var(--mtn-2) 40%),
    linear-gradient(135deg, transparent 40%, var(--mtn) 40%);
  clip-path: polygon(
    0 100%,
    5% 55%, 10% 70%, 18% 40%, 26% 62%, 34% 30%, 42% 55%, 50% 42%,
    58% 60%, 66% 35%, 74% 58%, 82% 45%, 90% 62%, 100% 50%,
    100% 100%);
  opacity: 0.95;
}
.hills {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 32vh;
  z-index: -1;
  background:
    radial-gradient(120% 100% at 20% 100%, var(--hill) 40%, transparent 41%),
    radial-gradient(120% 100% at 60% 100%, var(--hill-2) 45%, transparent 46%),
    radial-gradient(140% 100% at 90% 100%, var(--hill) 40%, transparent 41%),
    var(--hill-2);
}

/* ---------- Stage ---------- */
.stage {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
}

/* ---------- Title card ---------- */
.title-card {
  display: flex; justify-content: center;
  padding: 28px 0 12px;
  animation: dropIn 900ms cubic-bezier(.15,1.2,.3,1) both;
}
.title-plate {
  background: var(--cream);
  border: 4px solid var(--card-line);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--card-line);
  padding: 18px 42px 22px;
  text-align: center;
  transform: rotate(-1.2deg);
  filter: url(#wobble);
}
.title-eye {
  font-size: 22px; color: var(--gold);
  letter-spacing: 6px;
  margin-bottom: 4px;
}
.title-plate h1 {
  font-family: 'Baloo 2', Impact, "Cartoon Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: 1px;
  color: var(--cream);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--hair-b);
  line-height: 0.95;
}
.title-plate h1 span {
  color: var(--hair-b);
  font-style: italic;
  font-weight: 400;
}
.title-plate .tag {
  margin-top: 6px;
  font-size: 13px;
  color: #4a3a2c;
  letter-spacing: 1px;
}

/* ---------- Hero image ---------- */
.hero {
  position: relative;
  display: flex; justify-content: center;
  margin: 8px auto 44px;
  animation: floatIn 1100ms 200ms cubic-bezier(.2,1.1,.3,1) both;
}
.hero img {
  max-width: min(92vw, 520px);
  height: auto;
  display: block;
  border: 4px solid var(--card-line);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--card-line), 0 0 0 4px var(--cream) inset;
  background: var(--cream);
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.hero img:hover { transform: translate(-2px,-2px) rotate(-0.4deg); box-shadow: 12px 12px 0 var(--card-line); }
.pose-toggle {
  position: absolute; bottom: -18px; right: 24px;
  background: var(--gold);
  border: 3px solid var(--card-line);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: inherit; font-weight: bold;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--card-line);
  transition: transform 120ms ease;
}
.pose-toggle:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--card-line); }
.pose-toggle:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--card-line); }

/* ---------- Character shelf ---------- */
.shelf { margin-top: 20px; }
.shelf-h {
  font-family: Impact, "Cartoon Sans", sans-serif;
  font-size: 28px; letter-spacing: 4px;
  text-align: center;
  color: var(--cream);
  text-shadow: 3px 3px 0 var(--card-line);
  margin-bottom: 18px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 0 8px;
}
.card {
  background: var(--card);
  border: 4px solid var(--card-line);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--card-line);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translate(-2px,-2px) rotate(-0.6deg); box-shadow: 8px 8px 0 var(--card-line); }
.card[data-locked="true"] {
  background: repeating-linear-gradient(45deg, #efe0be, #efe0be 8px, #e0d0a5 8px, #e0d0a5 16px);
  cursor: not-allowed;
  filter: grayscale(0.4);
  animation: wobble 3s ease-in-out infinite;
}
.card .avatar {
  width: 100%; aspect-ratio: 1 / 1;
  background: var(--cream);
  border: 3px solid var(--card-line);
  border-radius: 14px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.card .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
/* Marceline lives in the lower-left corner of the hero image — zoom + crop to her */
.card[data-key="marceline"] .avatar { background: var(--cream); position: relative; }
.card[data-key="marceline"] .avatar img { display: none; }
.card[data-key="marceline"] .avatar::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("art/mercy-hero.png");
  background-size: 620%;
  background-position: 10% 96%;
  background-repeat: no-repeat;
}
.card .avatar .locked-glyph {
  font-family: Impact, sans-serif;
  font-size: 64px; color: var(--card-line);
  opacity: 0.35;
}
.card h3 {
  font-family: Impact, "Cartoon Sans", sans-serif;
  font-size: 22px; letter-spacing: 2px;
  color: var(--ink);
}
.card .cls {
  font-size: 12px; letter-spacing: 2px;
  color: var(--hair-b);
  margin-top: 2px;
  text-transform: uppercase;
}
.card .status-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  background: var(--gold);
  border: 2px solid var(--card-line);
  border-radius: 999px;
  font-size: 11px; font-weight: bold;
  letter-spacing: 1px;
}
.card[data-locked="true"] .status-pill { background: #c4b18a; }

/* ---------- Sheet (character detail overlay) ---------- */
.sheet {
  position: fixed; inset: 0;
  background: rgba(26, 15, 40, 0.72);
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 200ms ease both;
}
.sheet.hidden { display: none; }
.sheet-body {
  max-width: 720px; width: 100%;
  background: var(--card);
  border: 5px solid var(--card-line);
  border-radius: 22px;
  box-shadow: 10px 10px 0 var(--card-line);
  padding: 28px;
  max-height: 88vh; overflow-y: auto;
  animation: popIn 300ms cubic-bezier(.2,1.2,.3,1) both;
}
.sheet-x {
  position: absolute; top: 24px; right: 24px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--card-line);
  font-size: 24px; font-weight: bold; cursor: pointer;
  box-shadow: 3px 3px 0 var(--card-line);
  z-index: 21;
}
.sheet h2 {
  font-family: Impact, sans-serif;
  font-size: 36px; letter-spacing: 3px;
  margin-bottom: 4px;
}
.sheet .sheet-cls {
  color: var(--hair-b); letter-spacing: 3px;
  font-weight: bold; font-size: 13px;
  margin-bottom: 16px;
}
.sheet .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}
.sheet .stat {
  background: var(--cream);
  border: 3px solid var(--card-line);
  border-radius: 12px;
  padding: 10px 12px;
}
.sheet .stat b { display: block; font-size: 11px; letter-spacing: 2px; color: #7a5a2a; margin-bottom: 2px; }
.sheet .stat span { font-size: 15px; font-weight: bold; }
.sheet .lore {
  font-family: Georgia, serif;
  font-size: 15px; line-height: 1.55;
  color: #3a2a1e;
  border-left: 4px solid var(--gold);
  padding: 6px 0 6px 14px;
  margin-top: 8px;
}

/* ---------- Footer ---------- */
.ooo-foot {
  margin-top: 60px;
  text-align: center;
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 rgba(26,15,40,0.5);
}
.ooo-foot a { color: var(--gold); }

/* ---------- Animations ---------- */
@keyframes dropIn { from { transform: translateY(-40px) rotate(-4deg); opacity: 0 } to { transform: rotate(-1.2deg); opacity: 1 } }
@keyframes floatIn { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { transform: scale(0.85) rotate(-2deg); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes wobble {
  0%,100% { transform: rotate(-0.4deg) }
  50%     { transform: rotate(0.4deg) }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .title-plate { filter: none; }
}

@media (max-width: 640px) {
  .stage { padding: 20px 12px 60px; }
  .sheet-body { padding: 22px 16px; }
}

/* ---------- Polish: cursor hearts ---------- */
.heart-trail {
  position: fixed;
  width: 20px; height: 20px;
  pointer-events: none;
  z-index: 100;
  animation: heartRise 1.2s ease-out forwards;
}
@keyframes heartRise {
  0%   { transform: translate(-50%, -50%) scale(0.6) rotate(-8deg); opacity: 0; }
  20%  { opacity: 0.9; }
  100% { transform: translate(-50%, -140%) scale(1) rotate(6deg); opacity: 0; }
}

/* ---------- Polish: hover whispers ---------- */
.card { position: relative; }
.card .whisper {
  position: absolute;
  bottom: -22px; left: 50%;
  transform: translate(-50%, 4px);
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 15px;
  color: var(--cream);
  text-shadow: 1px 1px 0 rgba(26,15,40,0.6);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 260ms ease 600ms, transform 260ms ease 600ms;
  pointer-events: none;
}
.card:hover .whisper {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Polish: locked-card scribble overlay ---------- */
.scribble {
  position: absolute; inset: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 245, 223, 0.9);
  border-radius: 12px;
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 22px;
  color: var(--card-line);
  text-align: center;
  padding: 12px;
  transform: rotate(-3deg);
  animation: scribbleFlash 2.5s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}
@keyframes scribbleFlash {
  0%   { opacity: 0; transform: rotate(-6deg) scale(0.7); }
  15%  { opacity: 1; transform: rotate(-3deg) scale(1); }
  75%  { opacity: 1; transform: rotate(-3deg) scale(1); }
  100% { opacity: 0; transform: rotate(1deg) scale(0.95); }
}

/* ---------- Bible teaser under lore ---------- */
.sheet .bible-teaser {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255, 245, 223, 0.6);
  border: 2px dashed var(--card-line);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.sheet .bible-teaser b { color: var(--hair-b); letter-spacing: 1px; font-size: 11px; text-transform: uppercase; }
.sheet .bible-teaser ul { margin: 8px 0 0; padding-left: 20px; }
.sheet .bible-teaser li { margin: 4px 0; }

/* ---------- Postcard From Seth ---------- */
.hero { position: relative; }
.seth-envelope {
  position: absolute; top: 12px; right: 12px; z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 8px 8px;
  background: transparent; border: none; cursor: pointer;
  font-family: "Caveat", "Kalam", cursive;
  color: #1a1a1a;
  transform-origin: 50% 60%;
  transition: transform .25s ease;
  filter: drop-shadow(0 3px 0 rgba(26,26,26,.35));
}
.seth-envelope:hover { animation: sethWobble 1.1s ease-in-out infinite; }
.seth-envelope-svg { width: 68px; height: 48px; display: block; }
.seth-envelope-label {
  font-size: 20px; line-height: 1;
  padding: 2px 8px;
  background: #fbeed2; border: 2px solid #1a1a1a; border-radius: 10px;
  transform: rotate(-3deg);
}
.seth-envelope-opened {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5a85e, #f26e2e 65%, #ee4b7f);
  border: 2px solid #1a1a1a;
  opacity: 0; transform: scale(.4);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.seth-envelope.is-opened .seth-envelope-opened { opacity: 1; transform: scale(1); }
@keyframes sethWobble {
  0%,100% { transform: rotate(-4deg) translateY(0); }
  50%     { transform: rotate(4deg)  translateY(-2px); }
}

.seth-postcard {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.seth-postcard[hidden] { display: none; }
.seth-postcard-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(107,74,139,.55), rgba(26,26,26,.72));
  backdrop-filter: blur(3px);
  animation: sethFade .28s ease-out;
}
.seth-letter {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  border: 3px solid #1a1a1a;
  border-radius: 8px;
  box-shadow: 8px 8px 0 #1a1a1a, 0 30px 60px rgba(26,26,26,.45);
  background: #fbeed2;
  overflow: hidden;
  transform: rotate(-1deg);
  animation: sethPop .35s cubic-bezier(.2,1.3,.4,1);
}
.seth-letter-tear { display: block; width: 100%; height: 18px; margin-top: -1px; }
.seth-letter-paper {
  position: relative;
  padding: 14px 34px 28px;
  overflow-y: auto;
  background-color: #fbeed2;
  background-image:
    linear-gradient(to right, transparent 0, transparent 30px, rgba(238,75,127,.35) 30px, rgba(238,75,127,.35) 32px, transparent 32px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 30px, rgba(109,143,191,.28) 30px, rgba(109,143,191,.28) 31px);
  color: #1a1a1a;
  font-family: "Caveat", "Kalam", cursive;
  font-size: 22px;
  line-height: 31px;
}
.seth-letter-title {
  font-family: "Caveat", "Kalam", cursive;
  font-size: 34px;
  margin: 0 0 12px;
  padding-left: 12px;
  color: #6b4a8b;
}
.seth-letter-body { padding-left: 12px; }
.seth-letter-body p { margin: 0 0 12px; }
.seth-letter-sign {
  margin: 20px 0 0; padding-left: 12px;
  font-size: 28px; color: #ee4b7f;
  text-align: right;
  transform: rotate(-2deg);
}
.seth-letter-x {
  position: absolute; top: 8px; right: 10px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #1a1a1a;
  background: #f5a85e;
  color: #1a1a1a;
  font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 2px 2px 0 #1a1a1a;
  font-family: inherit;
}
.seth-letter-x:hover { background: #ee5b8a; color: #fbeed2; }
@keyframes sethFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes sethPop {
  0%   { transform: rotate(-1deg) translateY(24px) scale(.9); opacity: 0; }
  100% { transform: rotate(-1deg) translateY(0) scale(1); opacity: 1; }
}

/* ---------- Time-of-Day Sky ---------- */
:root {
  --tod-sky-top: #6b4a8b;
  --tod-sky-mid: #ee5b8a;
  --tod-sky-low: #f5a85e;
  transition: --tod-sky-top 2s ease, --tod-sky-mid 2s ease, --tod-sky-low 2s ease;
}
:root[data-tod="dawn"] { --tod-sky-top: #b8a7d9; --tod-sky-mid: #f5b9c9; --tod-sky-low: #ffd9b0; }
:root[data-tod="day"]  { --tod-sky-top: #6d8fbf; --tod-sky-mid: #a8c8e8; --tod-sky-low: #fbeed2; }
:root[data-tod="dusk"] { --tod-sky-top: #6b4a8b; --tod-sky-mid: #ee5b8a; --tod-sky-low: #f5a85e; }
:root[data-tod="night"]{ --tod-sky-top: #0f0c2c; --tod-sky-mid: #241a4a; --tod-sky-low: #4a2a6b; }

.tod-starfield {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity 2s ease;
}
:root[data-tod="night"] .tod-starfield { opacity: 1; }
.tod-starfield svg { width: 100%; height: 100%; display: block; }
.tod-starfield circle { animation: tod-twinkle 4s ease-in-out infinite; }
@keyframes tod-twinkle { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- Idle ambience: clouds + bat ---------- */
.idle-ambience {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1;
}
.idle-sky { position: absolute; inset: 0 0 40% 0; pointer-events: none; }
.idle-cloud {
  position: absolute;
  width: 140px; height: auto;
  opacity: .55;
  filter: drop-shadow(0 2px 0 rgba(26,26,26,.15));
  will-change: transform;
  animation-name: idleCloudDrift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.idle-cloud--a { top: 8%;  width: 150px; animation-duration: 78s; animation-delay: 0s;   }
.idle-cloud--b { top: 18%; width: 110px; animation-duration: 92s; animation-delay: -28s; opacity: .48; }
.idle-cloud--c { top: 28%; width: 130px; animation-duration: 66s; animation-delay: -50s; opacity: .5; }
@keyframes idleCloudDrift {
  0%   { transform: translate3d(110vw, 0, 0); }
  100% { transform: translate3d(-20vw, 0, 0); }
}

.idle-bat {
  position: absolute; top: 14%; left: -80px;
  width: 52px; height: auto; opacity: 0;
  will-change: transform, opacity;
}
.idle-bat.is-flying { animation: idleBatCross 4s ease-in-out forwards; }
.idle-bat__wing { transform-origin: 30px 15px; animation: idleBatFlap .18s ease-in-out infinite alternate; }
.idle-bat__wing--r { animation-delay: -.09s; }
@keyframes idleBatCross {
  0%   { opacity: 0; transform: translate(-10vw, 0) rotate(-4deg); }
  10%  { opacity: .85; }
  50%  { transform: translate(50vw, -30px) rotate(3deg); }
  90%  { opacity: .85; }
  100% { opacity: 0; transform: translate(110vw, 10px) rotate(-2deg); }
}
@keyframes idleBatFlap {
  0%   { transform: scaleY(1) rotate(0deg); }
  100% { transform: scaleY(.55) rotate(-4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .idle-cloud, .idle-bat, .idle-bat__wing { animation: none !important; }
  .idle-ambience { display: none; }
  .seth-letter { animation: none; }
  :root { transition: none; }
  .tod-starfield circle { animation: none; }
}



/* ---------- Subpage nav (from workflow) ---------- */

/* ====================================================================
   ATIM subpage nav — hand-drawn chip row, sits above the title-card
   ==================================================================== */
.atim-nav{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem .7rem;
  justify-content:center;
  align-items:center;
  margin:0 auto 1.4rem;
  padding:.55rem .8rem;
  max-width:min(760px,92%);
  font-family:"Kalam","Patrick Hand",var(--atim-hand,"Comic Neue"),cursive;
  font-size:13px;
  line-height:1;
  letter-spacing:.02em;
  text-transform:lowercase;
  background:var(--atim-cream,#f7ecd6);
  border:1.5px solid var(--atim-ink,#231b12);
  border-radius:14px;
  box-shadow:2px 3px 0 0 rgba(35,27,18,.85);
  transform:rotate(-.35deg);
}
.atim-nav a{
  position:relative;
  display:inline-block;
  padding:.35rem .7rem;
  color:var(--atim-ink,#231b12);
  text-decoration:none;
  background:transparent;
  border-radius:9px;
  transition:background .18s ease, transform .18s ease;
}
.atim-nav a::after{
  content:"";
  position:absolute;
  left:.7rem; right:.7rem; bottom:.22rem;
  height:2px;
  background:currentColor;
  border-radius:2px;
  transform:scaleX(0);
  transform-origin:left center;
  transition:transform .22s ease;
  opacity:.75;
}
.atim-nav a:hover{
  background:rgba(255,255,255,.55);
  transform:translateY(-1px) rotate(.4deg);
}
.atim-nav a:hover::after{transform:scaleX(1);}
.atim-nav a[aria-current="page"]{
  background:var(--atim-pink,#ee5b8a);
  color:#fff8ee;
  box-shadow:1px 2px 0 0 rgba(35,27,18,.6);
}
.atim-nav a[aria-current="page"]::after{display:none;}
@media (max-width:520px){
  .atim-nav{font-size:12px;padding:.45rem .6rem;gap:.4rem .5rem;}
  .atim-nav a{padding:.3rem .55rem;}
}


/* ============ JOY FEATURES (recovered bundles) ============ */
/* ---- FEATURE: easter-eggs ---- */


/* === tender-secrets easter eggs === */
.ts-rose-corner{
  position:fixed; right:22px; bottom:22px; width:120px; height:120px;
  pointer-events:none; z-index:9998; opacity:0; transform:scale(.4) rotate(-14deg);
  transition:opacity .5s ease, transform .9s cubic-bezier(.2,1.4,.4,1);
  filter:drop-shadow(0 6px 10px rgba(238,91,138,.35));
}
.ts-rose-corner.on{ opacity:1; transform:scale(1) rotate(0deg); }
.ts-envelope-glow{
  animation:tsEnvWiggle 1.6s ease-in-out;
  filter:drop-shadow(0 0 14px #e8a64e) drop-shadow(0 0 4px #f5a85e) !important;
}
@keyframes tsEnvWiggle{
  0%,100%{ transform:rotate(0deg); }
  15%{ transform:rotate(-6deg) translateY(-2px); }
  30%{ transform:rotate(5deg); }
  45%{ transform:rotate(-4deg) translateY(-1px); }
  60%{ transform:rotate(3deg); }
  80%{ transform:rotate(-1deg); }
}
.ts-title-hilove{
  color:#ee5b8a !important;
  text-shadow:0 2px 0 #1a1a1a, 0 0 22px rgba(238,91,138,.55);
  transition:color .4s ease;
}
.ts-spectral-preview{
  position:fixed; z-index:9999; pointer-events:none;
  padding:6px 12px; border:2px solid #1a1a1a;
  background:rgba(251,238,210,.92); color:#6b4a8b;
  font-family:inherit; font-size:13px; letter-spacing:.02em;
  border-radius:14px; box-shadow:0 4px 0 #1a1a1a, 0 0 24px rgba(107,74,139,.4);
  transform:translate(-50%,-140%); opacity:0;
  transition:opacity .18s ease;
}
.ts-spectral-preview.on{ opacity:1; }
.ts-spectral-preview::before{
  content:"~ "; color:#ee5b8a;
}
.ts-toast{
  position:fixed; left:50%; top:22%; transform:translate(-50%,-50%) scale(.9);
  background:#fbeed2; color:#6b4a8b;
  border:3px solid #1a1a1a; border-radius:18px;
  padding:14px 22px; font-family:inherit; font-weight:700;
  font-size:20px; letter-spacing:.02em;
  box-shadow:0 6px 0 #1a1a1a, 0 0 40px rgba(238,75,127,.35);
  z-index:10000; opacity:0; pointer-events:none;
  transition:opacity .3s ease, transform .5s cubic-bezier(.2,1.5,.4,1);
}
.ts-toast.on{ opacity:1; transform:translate(-50%,-50%) scale(1); }
.ts-toast small{ display:block; font-size:12px; font-weight:400; color:#ee5b8a; margin-top:4px; letter-spacing:.08em; }
.ts-petal{
  position:fixed; top:-24px; width:14px; height:14px; pointer-events:none;
  z-index:9997; will-change:transform, opacity;
}
.ts-petal svg{ display:block; width:100%; height:100%; }
@keyframes tsPetalFall{
  0%{ transform:translate(0,-20px) rotate(0deg); opacity:0; }
  10%{ opacity:1; }
  100%{ transform:translate(var(--tsx,20px), 105vh) rotate(var(--tsr,360deg)); opacity:.2; }
}
.ts-secret-star{ cursor:pointer; }
.ts-secret-star.ts-hot{ filter:drop-shadow(0 0 8px #e8a64e); }


/* ---- FEATURE: guestbook ---- */


/* ============================================================
   Guest Book — private, hand-drawn, ATIM canon
   ============================================================ */

/* trigger — pinned notebook icon, hero corner OPPOSITE the postcard envelope.
   Postcard envelope is typically top-right, so we anchor top-left. */
.atim-gb-trigger{
  position: fixed;
  top: clamp(14px, 3vw, 28px);
  left: clamp(14px, 3vw, 28px);
  z-index: 45;
  width: 78px;
  height: 92px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transform: rotate(-6deg);
  transition: transform .25s ease;
  filter: drop-shadow(3px 4px 0 rgba(26,26,26,.85));
}
.atim-gb-trigger:hover,
.atim-gb-trigger:focus-visible{
  transform: rotate(-3deg) translateY(-2px);
  outline: none;
}
.atim-gb-trigger:focus-visible .atim-gb-trigger__cover{
  box-shadow: 0 0 0 3px #f26e2e, 0 0 0 6px #1a1a1a;
}
.atim-gb-trigger__cover{
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      transparent 0 14px,
      rgba(107,74,139,.18) 14px 15px
    ),
    #fbeed2;
  border: 3px solid #1a1a1a;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
}
.atim-gb-trigger__cover::before{
  /* corner fold */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 18px; height: 18px;
  background: #ee5b8a;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  border-left: 3px solid #1a1a1a;
  border-bottom: 3px solid #1a1a1a;
}
.atim-gb-trigger__spiral{
  position: absolute;
  left: -3px;
  width: 10px;
  height: 6px;
  border: 3px solid #1a1a1a;
  border-right: none;
  border-radius: 6px 0 0 6px;
  background: #6b4a8b;
}
.atim-gb-trigger__spiral:nth-child(1){ top: 6px; }
.atim-gb-trigger__spiral:nth-child(2){ top: 20px; }
.atim-gb-trigger__spiral:nth-child(3){ top: 34px; }
.atim-gb-trigger__spiral:nth-child(4){ top: 48px; }
.atim-gb-trigger__spiral:nth-child(5){ top: 62px; }
.atim-gb-trigger__title{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: 10px;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 15px;
  line-height: 1;
  color: #1a1a1a;
  letter-spacing: .5px;
  text-transform: lowercase;
  transform: rotate(-2deg);
}
.atim-gb-trigger__doodle{
  position: absolute;
  bottom: 4px;
  right: 6px;
  opacity: .8;
}
.atim-gb-trigger__count{
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 22px;
  border: 2.5px solid #1a1a1a;
  background: #8fcb6b;
  color: #1a1a1a;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  transform: rotate(6deg);
}
.atim-gb-trigger__count[data-empty="1"]{ background: #fbc9a0; }

/* dialog */
.atim-gb-dialog{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 40px);
}
.atim-gb-dialog[hidden]{ display: none; }
.atim-gb-dialog__scrim{
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 30%, rgba(107,74,139,.55), rgba(26,26,26,.85));
  backdrop-filter: blur(3px);
  animation: atimGbScrimIn .28s ease both;
}
@keyframes atimGbScrimIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

.atim-gb-book{
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fbeed2;
  border: 3px solid #1a1a1a;
  border-radius: 6px 14px 14px 6px;
  box-shadow:
    10px 12px 0 rgba(26,26,26,.9),
    inset 0 0 40px rgba(238,91,138,.12);
  overflow: hidden;
  transform-origin: 50% 40%;
  animation: atimGbBookIn .32s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes atimGbBookIn{
  from{ transform: translateY(20px) rotate(-1.5deg) scale(.94); opacity: 0; }
  to{ transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
.atim-gb-book__close{
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #1a1a1a;
  background: #ee5b8a;
  color: #1a1a1a;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transform: rotate(4deg);
  transition: transform .18s ease;
}
.atim-gb-book__close:hover{ transform: rotate(-6deg) scale(1.06); }

.atim-gb-book__spine{
  position: absolute;
  left: 14px;
  top: 24px;
  bottom: 24px;
  width: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}
.atim-gb-book__spine span{
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b4a8b;
  border: 2.5px solid #1a1a1a;
}

.atim-gb-book__page{
  position: relative;
  padding: clamp(20px, 4vw, 36px) clamp(20px, 4vw, 36px) 26px clamp(38px, 6vw, 56px);
  overflow-y: auto;
  background:
    /* red margin line */
    linear-gradient(to right,
      transparent 0,
      transparent calc(clamp(38px, 6vw, 56px) - 12px),
      rgba(238,75,127,.55) calc(clamp(38px, 6vw, 56px) - 12px),
      rgba(238,75,127,.55) calc(clamp(38px, 6vw, 56px) - 10px),
      transparent calc(clamp(38px, 6vw, 56px) - 10px)),
    /* ruled lines */
    repeating-linear-gradient(
      transparent 0 27px,
      rgba(109,143,191,.35) 27px 28px
    ),
    #fbeed2;
}
.atim-gb-book__head{
  margin-bottom: 14px;
}
.atim-gb-book__title{
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1;
  margin: 0 0 6px 0;
  color: #1a1a1a;
  letter-spacing: .5px;
  text-shadow: 2px 2px 0 #ee5b8a;
  transform: rotate(-1.2deg);
  display: inline-block;
}
.atim-gb-book__sub{
  margin: 0;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 15px;
  color: #6b4a8b;
}

/* form */
.atim-gb-form{
  margin: 12px 0 22px;
  padding: 14px 16px 12px;
  border: 3px dashed #1a1a1a;
  border-radius: 10px;
  background: rgba(251,201,160,.35);
  transform: rotate(-.4deg);
}
.atim-gb-form__label{
  display: block;
  margin-bottom: 8px;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  color: #1a1a1a;
}
.atim-gb-form__name{
  display: block;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6b4a8b;
  margin-bottom: 2px;
}
.atim-gb-form__name-input,
.atim-gb-form__note{
  width: 100%;
  padding: 6px 10px;
  border: 2.5px solid #1a1a1a;
  border-radius: 6px;
  background: #fbeed2;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 17px;
  color: #1a1a1a;
  resize: vertical;
  box-sizing: border-box;
}
.atim-gb-form__name-input:focus,
.atim-gb-form__note:focus{
  outline: none;
  box-shadow: 0 0 0 3px #f5a85e;
}
.atim-gb-form__note{ min-height: 68px; }
.atim-gb-form__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.atim-gb-form__count{
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 13px;
  color: #6b4a8b;
}
.atim-gb-form__count[data-warn="1"]{ color: #f26e2e; }
.atim-gb-form__submit{
  padding: 6px 18px;
  border: 3px solid #1a1a1a;
  border-radius: 999px;
  background: #f26e2e;
  color: #1a1a1a;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1a1a;
  transform: rotate(1.5deg);
  transition: transform .12s ease, box-shadow .12s ease;
}
.atim-gb-form__submit:hover{
  transform: rotate(-1deg) translate(-1px, -1px);
  box-shadow: 4px 4px 0 #1a1a1a;
}
.atim-gb-form__submit:active{
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #1a1a1a;
}

/* stack of sticky notes */
.atim-gb-stack{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px 14px;
  padding: 6px 0 6px;
}
.atim-gb-empty{
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 6px;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 17px;
  color: #6b4a8b;
  opacity: .8;
}
.atim-gb-note{
  position: relative;
  padding: 14px 14px 12px;
  border: 2.5px solid #1a1a1a;
  border-radius: 4px;
  background: var(--atim-gb-note-bg, #fbc9a0);
  box-shadow: 3px 4px 0 rgba(26,26,26,.75);
  color: #1a1a1a;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  transform: rotate(var(--atim-gb-note-rot, -2deg));
  animation:
    atimGbNoteIn .35s cubic-bezier(.2,.9,.3,1.2) both,
    atimGbWobble 4.8s ease-in-out var(--atim-gb-wobble-delay, 0s) infinite;
  cursor: grab;
  user-select: none;
  touch-action: manipulation;
  will-change: transform;
}
.atim-gb-note::before{
  /* pin/tape */
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 40px;
  height: 14px;
  background: rgba(238,91,138,.7);
  border: 2px solid #1a1a1a;
  border-radius: 2px;
  transform: translateX(-50%) rotate(-4deg);
  box-shadow: 1px 2px 0 rgba(26,26,26,.5);
}
.atim-gb-note[data-color="pink"]{ --atim-gb-note-bg: #fbc9a0; }
.atim-gb-note[data-color="mint"]{ --atim-gb-note-bg: #8fcb6b; }
.atim-gb-note[data-color="sky"]{ --atim-gb-note-bg: #b8d0ea; }
.atim-gb-note[data-color="rose"]{ --atim-gb-note-bg: #f5a5c0; }
.atim-gb-note[data-color="gold"]{ --atim-gb-note-bg: #e8a64e; }
.atim-gb-note[data-color="cream"]{ --atim-gb-note-bg: #fbeed2; }

.atim-gb-note__body{
  font-size: 16px;
  line-height: 1.35;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  margin: 0 0 8px 0;
}
.atim-gb-note__foot{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  border-top: 1.5px dashed rgba(26,26,26,.35);
  padding-top: 4px;
  font-size: 13px;
  color: #1a1a1a;
}
.atim-gb-note__from{ font-weight: 400; }
.atim-gb-note__date{ opacity: .65; font-size: 12px; }

/* long-press progress */
.atim-gb-note[data-pressing="1"]{
  animation: none;
  transform: rotate(var(--atim-gb-note-rot, -2deg)) scale(1.04);
  cursor: grabbing;
}
.atim-gb-note[data-pressing="1"]::after{
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  height: 4px;
  border-radius: 4px;
  background: #1a1a1a;
  transform-origin: left center;
  animation: atimGbHold .5s linear forwards;
}
@keyframes atimGbHold{
  from{ transform: scaleX(0); }
  to{ transform: scaleX(1); }
}
.atim-gb-note[data-removing="1"]{
  animation: atimGbNoteOut .3s ease forwards;
}

@keyframes atimGbNoteIn{
  from{
    opacity: 0;
    transform: rotate(var(--atim-gb-note-rot, -2deg)) translateY(-10px) scale(.9);
  }
  to{
    opacity: 1;
    transform: rotate(var(--atim-gb-note-rot, -2deg)) translateY(0) scale(1);
  }
}
@keyframes atimGbNoteOut{
  to{
    opacity: 0;
    transform: rotate(calc(var(--atim-gb-note-rot, -2deg) + 12deg)) translateY(20px) scale(.85);
  }
}
@keyframes atimGbWobble{
  0%, 100% { transform: rotate(var(--atim-gb-note-rot, -2deg)) translateY(0); }
  25%      { transform: rotate(calc(var(--atim-gb-note-rot, -2deg) + 1.2deg)) translateY(-2px); }
  50%      { transform: rotate(var(--atim-gb-note-rot, -2deg)) translateY(0); }
  75%      { transform: rotate(calc(var(--atim-gb-note-rot, -2deg) - 1.2deg)) translateY(2px); }
}
@media (prefers-reduced-motion: reduce){
  .atim-gb-note,
  .atim-gb-book,
  .atim-gb-trigger{
    animation: none !important;
    transition: none !important;
  }
}

.atim-gb-hint{
  margin: 14px 0 4px 0;
  text-align: center;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 13px;
  color: #6b4a8b;
  opacity: .8;
}

/* body scroll lock */
body[data-atim-gb-open="1"]{ overflow: hidden; }

@media (max-width: 540px){
  .atim-gb-trigger{ width: 66px; height: 78px; }
  .atim-gb-trigger__title{ font-size: 13px; }
  .atim-gb-stack{ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---- FEATURE: treasure ---- */



/* ============================================================
   TREASURE HUNT — main page hotspots (invisible but not hidden)
   ============================================================ */
.hunt-spot {
  position: fixed;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: 40;
  cursor: pointer;
  background: transparent;
  /* very subtle breath so a careful mouse gets a hint */
  transition: transform .5s ease, box-shadow .5s ease, background .5s ease;
}
.hunt-spot::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238,91,138,0.0), rgba(238,91,138,0.0));
  transition: background .6s ease;
  pointer-events: none;
}
.hunt-spot:hover::after {
  background: radial-gradient(circle, rgba(238,91,138,0.28), rgba(238,91,138,0.0) 70%);
}
.hunt-spot.found::after {
  background: radial-gradient(circle, rgba(232,166,78,0.35), rgba(232,166,78,0.0) 70%);
}
.hunt-spot.just-found {
  animation: huntPop .9s ease;
}
@keyframes huntPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* placements — bell floats near the top-left companion strip,
   tombstone hides bottom-right near footer negative space. */
#hunt-spot-bell     { top: 92px;    left: 18px; }
#hunt-spot-tombstone{ bottom: 28px; right: 22px; }

/* ============================================================
   TREASURE HUNT — map page hotspots
   ============================================================ */
.map-hunt-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #1a1a1a;
  background: rgba(251,238,210,0.0);
  cursor: pointer;
  pointer-events: auto;
  transition: background .4s ease, transform .4s ease, box-shadow .4s ease;
  box-shadow: 0 0 0 0 rgba(238,91,138,0);
}
.map-hotspot:hover {
  background: rgba(238,91,138,0.35);
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 0 6px rgba(238,91,138,0.15);
}
.map-hotspot.found {
  background: #e8a64e;
  box-shadow: 0 0 0 5px rgba(232,166,78,0.25);
}
.map-hotspot.just-found { animation: huntPop .9s ease; }

/* ============================================================
   TREASURE HUNT — HUD (progress dots) + toast
   ============================================================ */
.hunt-hud {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fbeed2;
  border: 3px solid #1a1a1a;
  border-radius: 999px;
  font-family: monospace, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: lowercase;
  color: #1a1a1a;
  box-shadow: 3px 3px 0 #1a1a1a;
}
.hunt-hud__label { opacity: .7; }
.hunt-hud__dots  { display: inline-flex; gap: 5px; }
.hunt-hud__dots i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #1a1a1a;
  transition: background .3s ease, transform .3s ease;
}
.hunt-hud__dots i.found {
  background: #ee5b8a;
  transform: scale(1.1);
}
.hunt-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 60;
  padding: 10px 16px;
  background: #1a1a1a;
  color: #fbeed2;
  border: 3px solid #1a1a1a;
  border-radius: 12px;
  font-family: monospace, monospace;
  font-size: 12px;
  letter-spacing: .04em;
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  box-shadow: 4px 4px 0 #ee5b8a;
}
.hunt-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   HIDDEN LETTER — postcard reveal
   ============================================================ */
.hidden-letter {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: radial-gradient(ellipse at top, rgba(107,74,139,0.75), rgba(26,26,26,0.92));
  animation: letterFade .8s ease both;
}
.hidden-letter[hidden] { display: none; }
@keyframes letterFade { from { opacity: 0; } to { opacity: 1; } }
.hidden-letter__card {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fbeed2;
  color: #1a1a1a;
  border: 3px solid #1a1a1a;
  border-radius: 14px;
  padding: 28px 26px 22px;
  box-shadow: 8px 8px 0 #ee5b8a, 8px 8px 0 3px #1a1a1a;
  font-family: Georgia, "Times New Roman", serif;
  animation: letterPop .9s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes letterPop {
  from { transform: translateY(24px) rotate(-1.4deg); }
  to   { transform: translateY(0)    rotate(-0.6deg); }
}
.hidden-letter__stamp {
  position: absolute;
  top: -14px;
  right: 22px;
  width: 74px;
  height: 74px;
  background: #f26e2e;
  border: 3px solid #1a1a1a;
  border-radius: 6px;
  transform: rotate(6deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: monospace, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: lowercase;
  color: #1a1a1a;
  box-shadow: 3px 3px 0 #1a1a1a;
}
.hidden-letter__stamp span { line-height: 1.2; }
.hidden-letter__stamp span:first-child { font-weight: 700; }
.hidden-letter__meta {
  margin: 0 0 6px;
  font-family: monospace, monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: lowercase;
  color: #6b4a8b;
}
.hidden-letter__title {
  margin: 0 0 14px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-style: italic;
  color: #1a1a1a;
  border-bottom: 2px dashed #6b4a8b;
  padding-bottom: 10px;
}
.hidden-letter__body p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.65;
}
.hidden-letter__sign {
  font-style: italic;
  color: #6b4a8b;
}
.hidden-letter__ps {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #1a1a1a;
  font-family: monospace, monospace;
  font-size: 12px;
  color: #1a1a1a;
}
.hidden-letter__close {
  margin-top: 16px;
  padding: 8px 16px;
  background: #8fcb6b;
  color: #1a1a1a;
  border: 3px solid #1a1a1a;
  border-radius: 999px;
  font-family: monospace, monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: transform .2s ease;
}
.hidden-letter__close:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #1a1a1a;
}

/* respect the whole-site cursor being nice on small screens */
@media (max-width: 520px) {
  #hunt-spot-bell     { top: 74px; left: 12px; }
  #hunt-spot-tombstone{ bottom: 18px; right: 12px; }
  .hunt-hud { top: 8px; right: 8px; }
}


/* ---- FEATURE: birthday ---- */

/* ===== birthday mode ===== */
.bday-layer{position:fixed;inset:0;pointer-events:none;z-index:60;display:none}
body.bday-on .bday-layer{display:block}

.bday-banner{
  position:absolute;top:8px;left:50%;transform:translateX(-50%) translateY(-140%);
  width:min(720px,92vw);height:auto;
  filter:drop-shadow(0 4px 0 rgba(26,26,26,.35));
  transition:transform .9s cubic-bezier(.2,1.2,.3,1);
  pointer-events:none;
}
body.bday-on .bday-banner{transform:translateX(-50%) translateY(0)}

.bday-crown{
  position:absolute;width:64px;height:40px;
  left:var(--bday-crown-x,50%);top:var(--bday-crown-y,20px);
  transform:translate(-50%,-100%) rotate(-6deg);
  opacity:0;transition:opacity .5s ease .4s;
  filter:drop-shadow(0 2px 0 rgba(26,26,26,.35));
  pointer-events:none;
}
body.bday-on .bday-crown{opacity:1}

.bday-confetti{position:absolute;inset:0;width:100%;height:100%}

/* dialog */
.bday-dialog{
  position:fixed;inset:0;background:rgba(26,26,26,.55);
  display:flex;align-items:center;justify-content:center;
  z-index:120;padding:20px;
}
.bday-dialog[hidden]{display:none}
.bday-dialog-card{
  background:#fbeed2;border:3px solid #1a1a1a;border-radius:18px;
  padding:22px 22px 18px;max-width:360px;width:100%;
  box-shadow:6px 6px 0 #1a1a1a;position:relative;
  font-family:'Fredoka','Comic Sans MS',cursive;color:#1a1a1a;
}
.bday-dialog-close{
  position:absolute;top:8px;right:10px;background:#ee5b8a;color:#1a1a1a;
  border:2px solid #1a1a1a;border-radius:50%;width:28px;height:28px;
  font-weight:700;cursor:pointer;line-height:1;
}
.bday-dialog-title{margin:0 0 4px;font-size:1.2rem}
.bday-dialog-sub{margin:0 0 14px;font-size:.85rem;opacity:.75}
.bday-form label{display:flex;justify-content:space-between;align-items:center;
  gap:10px;font-size:.95rem;padding:5px 0;border-bottom:1px dashed rgba(26,26,26,.25)}
.bday-form input[type=date]{
  border:2px solid #1a1a1a;background:#fff;border-radius:8px;
  padding:3px 6px;font-family:inherit;font-size:.85rem;
}
.bday-form-row{display:flex;gap:10px;margin-top:12px}
.bday-save,.bday-clear{
  flex:1;padding:8px 10px;border:2px solid #1a1a1a;border-radius:10px;
  font-family:inherit;font-weight:600;cursor:pointer;
  box-shadow:3px 3px 0 #1a1a1a;
}
.bday-save{background:#8fcb6b}
.bday-clear{background:#fbc9a0}
.bday-save:active,.bday-clear:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #1a1a1a}
.bday-hint{font-size:.72rem;text-align:center;margin:10px 0 0;opacity:.65}
.bday-hint em{font-style:italic;background:#ee5b8a;padding:0 4px;border-radius:4px;color:#1a1a1a}

@media (prefers-reduced-motion:reduce){
  .bday-banner{transition:none}
  .bday-confetti{display:none}
}

/* ============ MOBILE POLISH (recovered) ============ */

/* ==============================================================
   Mobile responsive polish (<=480px)
   Applies to /adventuretime/ main + all subpages
   ============================================================== */
@media (max-width: 480px) {

  /* ---- Main stage tightening ---- */
  .stage { padding: 16px 10px 60px; }

  /* ---- Title card ---- */
  .title-card { padding: 18px 0 8px; }
  .title-plate {
    padding: 14px 20px 16px;
    border-width: 3px;
    box-shadow: 4px 4px 0 var(--card-line);
    border-radius: 18px;
    transform: rotate(-0.8deg);
    max-width: 100%;
  }
  .title-plate h1 { font-size: clamp(30px, 8vw, 42px); letter-spacing: 0; }
  .title-plate .tag { font-size: 12px; }
  .title-eye { font-size: 18px; letter-spacing: 4px; }

  /* ---- Hero image ---- */
  .hero { margin: 4px auto 32px; }
  .hero img {
    max-width: min(94vw, 420px);
    border-width: 3px;
    box-shadow: 5px 5px 0 var(--card-line), 0 0 0 3px var(--cream) inset;
    border-radius: 18px;
  }
  .hero img:hover {
    transform: none;
    box-shadow: 5px 5px 0 var(--card-line), 0 0 0 3px var(--cream) inset;
  }

  /* ---- Pose toggle (hero) ---- */
  .pose-toggle {
    right: 12px; bottom: -14px;
    padding: 6px 14px;
    font-size: 12px;
    box-shadow: 2px 2px 0 var(--card-line);
  }

  /* ---- Seth envelope: shrink so it doesn't cover the portrait ---- */
  .seth-envelope { top: 8px; right: 8px; padding: 4px; gap: 2px; }
  .seth-envelope-svg { width: 44px; height: 32px; }
  .seth-envelope-label { font-size: 13px; padding: 1px 6px; border-width: 1.5px; }

  /* ---- Character cards ---- */
  .shelf-h { font-size: 22px; letter-spacing: 2px; margin-bottom: 12px; }
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 2px;
  }
  .card { padding: 10px; border-width: 3px; box-shadow: 3px 3px 0 var(--card-line); border-radius: 14px; }
  .card h3 { font-size: 17px; letter-spacing: 1px; }
  .card .cls { font-size: 10px; letter-spacing: 1px; }
  .card .status-pill { font-size: 10px; padding: 2px 8px; }
  .card .whisper { font-size: 13px; bottom: -18px; }

  /* ---- Character detail sheet ---- */
  .sheet { padding: 10px; align-items: flex-start; }
  .sheet-body {
    padding: 20px 16px 22px;
    border-width: 4px;
    box-shadow: 6px 6px 0 var(--card-line);
    max-height: 92vh;
    margin-top: 20px;
    position: relative; /* anchor sheet-x here */
  }
  .sheet-x {
    top: -14px; right: -6px;
    width: 36px; height: 36px;
    font-size: 20px;
    box-shadow: 2px 2px 0 var(--card-line);
  }
  .sheet h2 { font-size: 26px; letter-spacing: 2px; padding-right: 40px; }
  .sheet .sheet-cls { font-size: 11px; letter-spacing: 2px; }
  .sheet .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sheet .stat { padding: 8px 10px; }
  .sheet .stat span { font-size: 13px; }
  .sheet .lore { font-size: 14px; padding-left: 10px; }
  .sheet .bible-teaser { font-size: 13px; padding: 10px 12px; }

  /* ---- Seth postcard letter ---- */
  .seth-postcard { padding: 12px; }
  .seth-letter { transform: rotate(-0.5deg); box-shadow: 4px 4px 0 #1a1a1a, 0 20px 40px rgba(26,26,26,.4); }
  .seth-letter-paper {
    padding: 12px 18px 22px;
    font-size: 18px;
    line-height: 27px;
    background-image:
      linear-gradient(to right, transparent 0, transparent 14px, rgba(238,75,127,.35) 14px, rgba(238,75,127,.35) 16px, transparent 16px),
      repeating-linear-gradient(to bottom, transparent 0, transparent 26px, rgba(109,143,191,.28) 26px, rgba(109,143,191,.28) 27px);
  }
  .seth-letter-title { font-size: 26px; padding-left: 8px; margin-bottom: 8px; }
  .seth-letter-body { padding-left: 8px; }
  .seth-letter-body p { margin-bottom: 8px; }
  .seth-letter-sign { font-size: 22px; padding-left: 8px; margin-top: 14px; }

  /* ---- Shared subpage .atim-nav (overrides inline styles via specificity) ---- */
  body .atim-nav {
    gap: 6px 8px !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    max-width: 96% !important;
  }
  body .atim-nav a {
    padding: 8px 10px !important; /* WCAG 44px-ish tap */
    min-height: 32px;
    display: inline-flex; align-items: center;
    line-height: 1;
  }

  /* ---- STORY subpage ---- */
  body .book-header { padding: 24px 14px 18px; }
  body .toc { padding: 16px 16px; margin: 20px 8px 32px; }
  body main { padding: 24px 14px 60px !important; }

  /* ---- CODEX subpage ---- */
  body header.codex-head h1 {
    font-size: 28px !important;
    text-shadow: 2px 2px 0 var(--peach, #f5a85e), 4px 4px 0 var(--purple, #6b4a8b) !important;
  }
  body main.codex { padding: 0 6px; }
  body .cat { padding: 12px 14px 16px; margin-bottom: 18px; border-radius: 16px; box-shadow: 3px 3px 0 var(--ink, #1a1a1a); }
  body .cat > h2 { font-size: 22px; }
  body .content { padding: 6px 0 4px; }
  body .content ul { padding-left: 16px; }

  /* ---- LETTERS subpage ---- */
  body .cards { padding: 12px 8px 24px !important; grid-template-columns: 1fr !important; gap: 14px; }
  body .letter-card, body .cards > * { padding: 14px 12px 20px !important; }
  body .paper {
    padding: 24px 18px 32px !important;
    max-width: 100% !important;
  }
  body .paper h2 { font-size: 26px !important; }
  body .paper .body { font-size: 17px !important; line-height: 26px; }

  /* ---- MAP subpage ---- */
  body .map-wrap { padding: 0 6px; }
  body .parchment { border-width: 3px; box-shadow: 4px 4px 0 var(--ink, #1a1a1a), 8px 8px 0 rgba(0,0,0,0.12); border-radius: 14px; }
  body svg.map { max-height: none; } /* let it scale by width on portrait */
  body .hotspot text.pin-label { font-size: 13px; }
  body .legend { font-size: 11px; gap: 12px; padding: 10px 6px; }
  body .popup { padding: 16px 14px 14px !important; max-width: 94% !important; }
  body .popup h2 { font-size: 18px !important; }

  /* ---- BROADCASTS subpage ---- */
  body .observatory {
    max-width: 260px !important;
    filter: drop-shadow(0 0 12px rgba(232,166,78,0.5)) drop-shadow(0 0 24px rgba(238,91,138,0.25)) !important;
  }
  body .hero { padding: 0 14px !important; margin: 18px auto 8px !important; }

  /* ---- QUIZ subpage ---- */
  body .qtext { font-size: 17px; }
  body .qmeta { font-size: 17px; }
  body .answers .a { padding: 10px 12px; font-size: 15px; }
  body .result h2 {
    font-size: clamp(26px, 8vw, 34px) !important;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  body .share { grid-template-columns: 1fr 1fr !important; }
}

/* ==============================================================
   Very narrow devices (<=360px) — final squeeze
   ============================================================== */
@media (max-width: 360px) {
  .stage { padding: 12px 8px 48px; }
  .cards { grid-template-columns: 1fr; }
  .title-plate { padding: 12px 14px 14px; }
  .title-plate h1 { font-size: 28px; }
  .seth-envelope-svg { width: 36px; height: 26px; }
  .seth-envelope-label { display: none; }
  body .atim-nav { font-size: 11px !important; }
}


/* ============ PHONE-FIRST: nav chip-row + ambient throttle ============ */
@media (max-width: 640px) {
  .atim-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 8px;
    padding: 8px 4px 12px;
    margin: 0 -4px 8px;
    scrollbar-width: none;
  }
  .atim-nav::-webkit-scrollbar { display: none; }
  .atim-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px !important;
    font-size: 14px !important;
    background: var(--cream, #fbeed2);
    border: 2px solid var(--card-line, #2a1f14);
    border-radius: 999px;
    box-shadow: 2px 2px 0 var(--card-line, #2a1f14);
    text-decoration: none;
    color: var(--ink, #1a1a1a);
  }
  .atim-nav a[aria-current="page"] { background: var(--gold, #e8a64e); }

  /* hero: keep title + hero + first card row near the fold */
  .hero img { max-width: 86vw; max-height: 52vh; object-fit: contain; }
  .title-card { padding: 12px 0 6px; }

  /* two-column compact cards on phones */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 2px; }
  .card { padding: 10px; }
  .card h3 { font-size: 17px; }
  .card .cls { font-size: 10px; }

  /* sheet + letter comfortable on phone */
  .sheet { padding: 10px; }
  .sheet-body { max-height: 92vh; padding: 18px 14px; }
  .seth-postcard { padding: 10px; }
  .seth-letter { max-height: calc(100vh - 20px); }
  .seth-letter-paper { padding: 12px 16px 22px; font-size: 19px; line-height: 27px; }
}

/* ambient calm on touch devices — parallax off, fewer moving layers */
@media (pointer: coarse) {
  .idle-cloud--b, .idle-cloud--c { display: none; }
}
/* ============ FIRST-VISIT SPLASH ============ */
.first-visit {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  background:
    linear-gradient(180deg, #6b4a8b 0%, #a95b98 26%, #ee5b8a 52%, #f6885e 76%, #f5a85e 100%);
  transition: opacity 900ms ease;
}
.first-visit[hidden] { display: none; }
.first-visit.fv-leaving { opacity: 0; pointer-events: none; }
.fv-envelope {
  background: transparent; border: none; cursor: pointer;
  width: min(64vw, 300px);
  filter: drop-shadow(0 6px 0 rgba(26,26,26,.4));
  animation: fvBreathe 2.6s ease-in-out infinite;
  transition: transform 300ms ease;
}
.fv-envelope svg { width: 100%; height: auto; display: block; }
.fv-envelope:active { transform: scale(0.96); }
.first-visit.fv-opening .fv-envelope { animation: fvPop 700ms ease forwards; }
.first-visit.fv-opening .fv-flap { transform-origin: 80px 12px; animation: fvFlap 600ms ease forwards; }
.first-visit.fv-opening .fv-wax { animation: fvWaxDrop 500ms ease forwards; }
.fv-label {
  font-family: "Caveat", "Kalam", cursive;
  font-size: clamp(34px, 8vw, 52px);
  color: #fbeed2;
  text-shadow: 3px 3px 0 rgba(26,26,26,.45);
  transform: rotate(-2deg);
}
.fv-hint {
  font-family: "Courier New", monospace;
  font-size: 13px; letter-spacing: 3px;
  color: rgba(251,238,210,.75);
  animation: fvHintPulse 2s ease-in-out infinite;
}
@keyframes fvBreathe { 0%,100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.03); } }
@keyframes fvPop { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(2deg); } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes fvFlap { to { transform: rotate(180deg) translateY(-8px); opacity: 0.4; } }
@keyframes fvWaxDrop { to { transform: translate(80px, 120px) rotate(30deg); opacity: 0; } }
@keyframes fvHintPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fv-envelope, .fv-hint { animation: none; }
}
/* ============ FIXES ============ */
/* [hidden] must always win over display rules on feature elements */
.hunt-hud[hidden], .hunt-toast[hidden], .hidden-letter[hidden],
.seth-postcard[hidden], .first-visit[hidden] { display: none !important; }

/* ============ SHARED POLISH (wf at-hub) ============ */
/* episode marker under the title plate tag */
.title-plate .ep-mark {
  margin-top: 4px;
  font-family: "Caveat", "Kalam", cursive;
  font-size: 17px;
  color: var(--sky-top);
  transform: rotate(-0.8deg);
  letter-spacing: 0.5px;
}

/* keyboard focus — same chunky ink-and-gold language as the hover states */
.atim-nav a:focus-visible,
.card:focus-visible,
.pose-toggle:focus-visible,
.seth-envelope:focus-visible,
.sheet-x:focus-visible,
.hidden-letter__close:focus-visible,
.atim-gb-form__submit:focus-visible,
.ooo-foot a:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}
.card:focus-visible { transform: translate(-2px,-2px); }

/* footer link gets a real hover */
.ooo-foot a { text-decoration: none; border-bottom: 2px dotted transparent; transition: border-color 160ms ease, color 160ms ease; }
.ooo-foot a:hover, .ooo-foot a:focus-visible { border-bottom-color: var(--gold); color: var(--cream); }
