/* /bio: the Instagram link page (lib/bio-page.js). Phone first, one column, thumbs only.
   The same paper, ink and lime as the rest of the site, with the hard offset shadow under
   every card so a tap can visibly press it down. */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/anton-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f5f2ea;
  --card: #fffdf7;
  --ink: #0f1f1a;
  --soft: #52645d;
  --line: #0f1f1a;
  --lime: #c9f558;
  --on-lime: #0f1f1a;
  --gold: #f6c65b;
  --coral: #ff7a59;
  --sky: #c6c9ff;
  --shadow: #0f1f1a;
  --done: #e9eee0;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101a17;
    --card: #1a2622;
    --ink: #f0ece2;
    --soft: #9fb0a7;
    --line: #3a4a44;
    --shadow: #000;
    --done: #16211d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.2px);
  background-size: 18px 18px;
  color: var(--ink);
  font: 16px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 64px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ---------- the bar across the top: level and XP ---------- */
.hud {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.hud-lv {
  font: 15px/1 Anton, Impact, sans-serif; letter-spacing: 0.04em;
  background: var(--ink); color: var(--paper); padding: 5px 8px 4px; border-radius: 6px; flex: none;
}
.hud-lv.pop { animation: pop 0.5s var(--ease); }
.hud-bar {
  flex: 1; height: 12px; border: 2px solid var(--line); border-radius: 99px; overflow: hidden;
  background: var(--card); max-width: 380px;
}
.hud-bar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(-45deg, var(--lime) 0 6px, color-mix(in srgb, var(--lime) 75%, #fff) 6px 12px);
  transition: width 0.7s var(--ease);
}
.hud-xp { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; flex: none; min-width: 52px; text-align: right; }

/* ---------- Aashish, waving ---------- */
.hero { text-align: center; padding: 8px 0 6px; }
.stage { position: relative; height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.avatar {
  position: relative; z-index: 1; border: 0; background: none; padding: 0; cursor: pointer;
  animation: bob 2.6s ease-in-out infinite;
}
.avatar canvas { display: block; width: 70px; height: 110px; image-rendering: pixelated; image-rendering: crisp-edges; }
.avatar.jump { animation: jump 0.45s var(--ease); }
.ground {
  position: absolute; bottom: -4px; left: 50%; width: 84px; height: 10px; transform: translateX(-50%);
  background: color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 50%;
}
.bubble {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  margin: 0; max-width: min(300px, 88vw); width: max-content;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 7px 12px; font-size: 14px; font-weight: 600; box-shadow: 3px 3px 0 var(--shadow);
  transition: opacity 0.2s;
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px;
  background: var(--card); border: solid var(--line); border-width: 0 2px 2px 0;
  transform: translateX(-50%) rotate(45deg);
}
.name { font: 44px/1 Anton, Impact, sans-serif; letter-spacing: 0.01em; margin: 18px 0 2px; text-transform: uppercase; }
.handle { margin: 0; font-weight: 700; color: var(--soft); }
.tagline { margin: 8px auto 0; max-width: 34ch; font-size: 15px; color: var(--soft); text-wrap: balance; }
.rank {
  display: inline-block; margin: 14px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 5px 10px; border: 1.5px dashed var(--line); border-radius: 99px; color: var(--soft);
}
.rank b { color: var(--ink); }

/* ---------- section heads ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 12px; }
.sec-head h2 { font: 22px/1 Anton, Impact, sans-serif; letter-spacing: 0.03em; text-transform: uppercase; margin: 0; }
.sec-count { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--soft); }

/* ---------- the quests: one link each ---------- */
.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.q { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.q-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 12px 14px;
  background: var(--card); color: var(--ink); text-decoration: none;
  border: 2px solid var(--line); border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background 0.2s;
  -webkit-user-select: none; user-select: none;
}
.q-link:active, .q-link.pressed { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--shadow); }
.q-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; font-size: 24px;
  background: var(--paper); border: 2px solid var(--line); border-radius: 12px;
}
.q-thumb { padding: 0; overflow: hidden; background: #000; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.q-title { font-weight: 750; font-size: 16.5px; line-height: 1.2; overflow-wrap: anywhere; }
.q-note { font-size: 13.5px; color: var(--soft); line-height: 1.3; overflow-wrap: anywhere; }
.q-xp { flex: none; display: grid; place-items: center; }
.q-xp-n {
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap;
  background: var(--gold); color: #0f1f1a; border: 1.5px solid #0f1f1a; border-radius: 99px; padding: 3px 7px;
}
.q-check {
  display: none; width: 30px; height: 30px; place-items: center; border-radius: 50%;
  background: var(--lime); color: var(--on-lime); border: 2px solid #0f1f1a; font-weight: 900; font-size: 15px;
}
.q.done .q-link { background: var(--done); }
.q.done .q-xp-n { display: none; }
.q.done .q-check { display: grid; animation: stamp 0.4s var(--ease); }
.q.done .q-title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }

.q-badge {
  position: absolute; top: -10px; right: 12px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 6px; border: 1.5px solid #0f1f1a; color: #0f1f1a; background: var(--sky);
  transform: rotate(3deg);
}
.q-badge--hot { background: var(--coral); }
.q-badge--live { background: var(--coral); color: #fff; }
.q-badge--live::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #fff; vertical-align: 1px; animation: blink 1s steps(2) infinite; }
.q-badge--drop { background: var(--lime); }
.q-badge--fresh { background: var(--gold); right: auto; left: 12px; transform: rotate(-3deg); }

/* The featured one is a boss quest: bigger, lime, with light running across it. */
.q--featured .q-link { min-height: 92px; background: var(--lime); color: var(--on-lime); }
.q--featured .q-note { color: color-mix(in srgb, var(--on-lime) 72%, transparent); }
.q--featured .q-title { font-size: 19px; }
.q--featured .q-icon { width: 56px; height: 56px; font-size: 30px; background: #fffdf7; border-color: #0f1f1a; }
.q--featured .q-link { border-color: #0f1f1a; }
/* The light moves by background position, not transform, so the card needs no overflow: hidden
   and the sticker can still hang off its top edge. */
.q--featured .q-link::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%) no-repeat;
  background-size: 300% 100%; background-position: 150% 0; animation: shine 3.6s ease-in-out 1.2s infinite;
}
.q--featured.done .q-link { background: color-mix(in srgb, var(--lime) 55%, var(--done)); }
.empty { color: var(--soft); text-align: center; padding: 20px 0; }

/* ---------- the daily chest ---------- */
.chest {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  padding: 14px; min-height: 84px;
  background: var(--ink); color: var(--paper); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 4px 4px 0 var(--gold);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.chest:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--gold); }
.chest canvas { width: 64px; height: 56px; image-rendering: pixelated; flex: none; }
.chest.ready canvas { animation: wiggle 1.8s ease-in-out infinite; }
.chest.shake canvas { animation: shake 0.5s linear; }
.chest.opened { cursor: default; background: var(--card); color: var(--ink); box-shadow: 4px 4px 0 var(--shadow); }
.chest-text { display: grid; gap: 3px; }
.chest-text b { font-size: 16.5px; }
.chest-text span { font-size: 13.5px; opacity: 0.75; }
.loot-line {
  margin: 12px 0 0; padding: 14px 16px; border-radius: 14px; border: 2px dashed var(--line);
  font-size: 15.5px; font-weight: 600; line-height: 1.4; background: var(--card);
  animation: rise 0.45s var(--ease) both;
}
.loot-line::before { content: '“'; font: 34px/0 Anton, serif; vertical-align: -12px; margin-right: 4px; color: var(--soft); }

/* ---------- badges ---------- */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge {
  display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px 6px 10px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); font-size: 12px; font-weight: 700; line-height: 1.2;
}
.badge i { font-style: normal; font-size: 26px; line-height: 1.1; }
.badge small { font-weight: 500; color: var(--soft); font-size: 11px; }
.badge.locked { border-style: dashed; background: transparent; color: var(--soft); }
.badge.locked i { filter: grayscale(1); opacity: 0.35; }
.badge.fresh { animation: pop 0.6s var(--ease); background: var(--lime); color: var(--on-lime); }
.badge.fresh small { color: inherit; }

/* ---------- footer ---------- */
.foot { text-align: center; margin-top: 36px; }
.world {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 22px;
  font: 18px/1 Anton, Impact, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  color: var(--paper); background: var(--ink); border-radius: 99px; border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--lime);
}
.world:active { transform: translate(4px, 4px); box-shadow: none; }
.foot p { font-size: 12.5px; color: var(--soft); margin: 14px 0 0; }
.foot .guides-link { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- toast and the coins ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; top: calc(62px + env(safe-area-inset-top));
  transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper); padding: 10px 16px 10px 12px; border-radius: 14px;
  box-shadow: 4px 4px 0 var(--lime); font-weight: 700; font-size: 14px;
  animation: drop 0.4s var(--ease) both;
}
.toast i { font-style: normal; font-size: 24px; }
.toast small { display: block; font-weight: 500; opacity: 0.75; font-size: 12px; }
.toast.out { animation: lift 0.3s ease-in both; }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.coin {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: var(--gold); border: 2px solid #0f1f1a; border-radius: 3px;
  animation: coin 0.8s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
.coin.lime { background: var(--lime); }
.coin.sky { background: var(--sky); border-radius: 50%; }
.float {
  position: absolute; transform: translate(-50%, -50%);
  font: 22px/1 Anton, Impact, sans-serif; letter-spacing: 0.04em; color: var(--ink);
  -webkit-text-stroke: 0; text-shadow: 2px 2px 0 var(--gold);
  animation: float 0.9s var(--ease) forwards;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes jump { 0% { transform: translateY(0); } 40% { transform: translateY(-26px) rotate(-4deg); } 100% { transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-20deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shine { 0%, 55% { background-position: 150% 0; } 85%, 100% { background-position: -50% 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-7deg); } 82% { transform: rotate(6deg); } 88% { transform: rotate(-4deg); } 94% { transform: rotate(2deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes lift { to { opacity: 0; transform: translate(-50%, -20px); } }
@keyframes coin {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0.6); opacity: 0; }
}
@keyframes float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); } 20% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -220%) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 560px) {
  .wrap { padding-top: 88px; }
  .name { font-size: 54px; }
}
