/* ================= THE ARTICLE AVIARY ================= */
:root {
  --paper: #F6F1E6;
  --paper-2: #EDE5D2;
  --paper-3: #FBF8F1;
  --edge: #DDD2B8;
  --ink: #1F2A24;
  --ink-soft: #55635A;
  --ink-faint: #8C958B;
  --moss: #3E5641;
  --moss-deep: #2E4231;
  --fern: #6B8A5E;
  --sage: #A9BDA3;
  --ochre: #C98B3C;
  --honey: #E8B85C;
  --robin: #86B3C1;
  --clay: #B8674A;
  --bark: #6B4F33;
  --rose: #E7A5A0;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;

  --shadow: 0 1px 2px rgba(31,42,36,.06), 0 14px 34px -16px rgba(31,42,36,.32);
  --shadow-lg: 0 2px 4px rgba(31,42,36,.06), 0 30px 70px -26px rgba(31,42,36,.45);
  --spring: cubic-bezier(.3,1.5,.5,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.kicker { font-family: var(--font-hand); font-size: 24px; margin: 0; color: var(--clay); }

/* ---------- living sky ---------- */
.sky { /* the morning sky sits at the top of the page and scrolls away, so cards rest on calm paper */
  position: absolute; left: 0; right: 0; top: 0; height: 820px; z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #F3D7B6 0%, #F2E3CC 34%, #E3ECE3 70%, #DCE7E0 100%);
}
.sky::after { /* paper fade so text sits on calm ground */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(246,241,230,0) 0%, rgba(246,241,230,0) 34%, rgba(246,241,230,.6) 66%, var(--paper) 100%);
}
.sun {
  position: absolute; width: 150px; height: 150px; border-radius: 50%; right: 9%; top: 70px;
  background: radial-gradient(circle, #FFF1C9 0 34%, rgba(255,226,166,.75) 35%, rgba(255,226,166,0) 70%);
  animation: sunBreath 9s ease-in-out infinite;
}
@keyframes sunBreath { 50% { transform: scale(1.08); opacity: .9; } }
.cloud {
  position: absolute; height: 34px; border-radius: 40px; background: #FFF9F0; opacity: .8;
  filter: blur(.3px); animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 54%; height: 150%; left: 14%; top: -62%; }
.cloud::after { width: 38%; height: 120%; left: 50%; top: -40%; }
.cl1 { width: 170px; top: 90px; animation-duration: 95s; animation-delay: -20s; }
.cl2 { width: 120px; top: 160px; animation-duration: 120s; animation-delay: -70s; opacity: .6; }
.cl3 { width: 210px; top: 40px; animation-duration: 140s; animation-delay: -100s; opacity: .55; }
.cl4 { width: 90px; top: 230px; animation-duration: 80s; animation-delay: -10s; opacity: .5; }
@keyframes drift { from { transform: translateX(-260px); } to { transform: translateX(calc(100vw + 260px)); } }
.hills { position: absolute; left: 0; right: 0; top: 300px; width: 100%; height: 300px; opacity: .6; }
.hills .h1 { fill: #C8D6C3; } .hills .h2 { fill: #ADC2A8; } .hills .h3 { fill: #DDE6D9; }
#flock, #burst { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#flock { z-index: 1; }
#burst { z-index: 60; }

/* ---------- header ---------- */
.top {
  position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  max-width: 980px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top,0px)) 20px 0;
}
.back {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--moss);
  font-weight: 500; font-size: 14px; padding: 8px 14px 8px 10px; border-radius: 999px;
  background: rgba(246,241,230,.75); backdrop-filter: blur(6px); box-shadow: 0 1px 0 rgba(31,42,36,.05);
  transition: transform .2s;
}
.back:hover { transform: translateX(-2px); }
.clock { font-size: 12.5px; color: var(--ink-soft); background: rgba(246,241,230,.7); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.preview-flag {
  position: relative; z-index: 5; width: max-content; margin: 10px auto 0; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: var(--ochre); color: #fff; padding: 5px 12px; border-radius: 999px;
}

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 2; max-width: 980px; margin: 0 auto; padding: 0 20px 40px; }

.hero { text-align: center; padding: 34px 0 10px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 8vw, 78px); line-height: 1; margin: 6px 0 14px;
  letter-spacing: -.02em; color: var(--moss-deep);
}
.hero h1 em { font-style: italic; color: var(--clay); }
.hero h1, .hero .lede, .hero .kicker { animation: rise .9s var(--spring) both; }
.hero .lede { animation-delay: .08s; }
.lede { max-width: 560px; margin: 0 auto; color: var(--ink-soft); font-size: 16.5px; line-height: 1.55; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 720px; margin: 26px auto 0; }
.stat {
  background: rgba(251,248,241,.82); backdrop-filter: blur(8px); border-radius: 18px; padding: 14px 10px 12px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: rise .8s var(--spring) both;
}
.stat:nth-child(2) { animation-delay: .06s; } .stat:nth-child(3) { animation-delay: .12s; } .stat:nth-child(4) { animation-delay: .18s; }
.stat b { font-family: var(--font-display); font-size: 30px; font-weight: 500; color: var(--moss-deep); line-height: 1.1; }
.stat span { font-size: 12px; color: var(--ink-soft); }
.stat i { font-style: normal; }

.journey { position: relative; max-width: 720px; margin: 22px auto 0; padding-top: 26px; }
.journey-track { height: 8px; border-radius: 8px; background: rgba(107,79,51,.15); overflow: hidden; }
.journey-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--fern), var(--honey)); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.journey-bird {
  position: absolute; top: 0; left: 0; width: 34px; color: var(--moss); transform: translateX(-50%);
  transition: left 1.4s cubic-bezier(.2,.8,.2,1); animation: bob 2.6s ease-in-out infinite;
}
.journey-bird svg { display: block; width: 100%; }
@keyframes bob { 50% { transform: translateX(-50%) translateY(-4px); } }
.journey-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
.journey-labels #journeyPct { color: var(--moss); font-weight: 600; }

/* ---------- tabs ---------- */
.tabs {
  position: sticky; top: 8px; z-index: 10; display: flex; gap: 6px; margin: 30px auto 22px; width: max-content; max-width: 100%;
  padding: 6px; border-radius: 999px; background: rgba(251,248,241,.86); backdrop-filter: blur(10px); box-shadow: var(--shadow);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-soft);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background .25s, color .25s;
}
.tab .ic { font-size: 15px; }
.tab .lbs { display: none; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--moss); color: #F6F1E6; }
.count { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: rgba(107,138,94,.2); color: var(--moss); }
.tab.on .count { background: rgba(246,241,230,.22); color: #fff; }
.count.warn { background: var(--clay); color: #fff; }

.panel { display: none; }
.panel.on { display: block; animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.panel-intro { text-align: center; color: var(--ink-soft); max-width: 600px; margin: 0 auto 22px; line-height: 1.55; font-size: 15px; }

/* ---------- nest ---------- */
.nest-stage { display: flex; flex-direction: column; align-items: center; padding: 6px 0 10px; }
.date-line { font-family: var(--font-hand); font-size: 26px; color: var(--moss); margin: 0 0 6px; }
.nest { position: relative; border: 0; background: none; padding: 0; width: min(340px, 86vw); height: 210px; }
.nest-bowl { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; filter: drop-shadow(0 16px 18px rgba(62,40,20,.25)); }
.eggs { position: absolute; left: 0; right: 0; bottom: 56px; display: flex; justify-content: center; align-items: flex-end; gap: 2px; }
.egg {
  position: relative; width: 74px; height: 98px; display: block;
  animation: wobble 3.4s ease-in-out infinite; transform-origin: 50% 92%;
}
/* both halves are the full egg, cut along a zig-zag crack, so the outline stays a true egg */
.egg i {
  position: absolute; inset: 0; display: block;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background:
    radial-gradient(ellipse 30% 22% at 34% 26%, rgba(255,255,255,.85), rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 80% 60% at 70% 92%, rgba(80,60,40,.16), rgba(80,60,40,0) 70%),
    radial-gradient(circle at 62% 40%, rgba(107,79,51,.32) 0 2.2%, transparent 2.5%),
    radial-gradient(circle at 40% 64%, rgba(107,79,51,.28) 0 1.9%, transparent 2.2%),
    radial-gradient(circle at 72% 68%, rgba(107,79,51,.3) 0 2.4%, transparent 2.7%),
    radial-gradient(circle at 26% 46%, rgba(107,79,51,.22) 0 1.7%, transparent 2%),
    radial-gradient(circle at 54% 84%, rgba(107,79,51,.22) 0 2%, transparent 2.3%),
    radial-gradient(circle at 48% 20%, rgba(107,79,51,.2) 0 1.5%, transparent 1.8%),
    var(--eg, #EAD9C0);
}
.egg .top {
  clip-path: polygon(0 0, 100% 0, 100% 50%, 88% 57%, 76% 49%, 63% 57%, 50% 48%, 37% 57%, 24% 49%, 12% 57%, 0 50%);
  transition: transform .8s var(--spring), opacity .8s;
}
.egg .bot { clip-path: polygon(0 50%, 12% 57%, 24% 49%, 37% 57%, 50% 48%, 63% 57%, 76% 49%, 88% 57%, 100% 50%, 100% 100%, 0 100%); }
.egg::before { /* soft shadow under each egg */
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 14px; border-radius: 50%;
  background: rgba(62,40,20,.25); filter: blur(4px); z-index: -1;
}
.e1 { --eg: #CFE1E6; transform: rotate(-9deg); animation-delay: -.4s; }
.e2 { --eg: #F1D9C6; width: 82px; height: 108px; animation-delay: -1.6s; z-index: 2; margin-bottom: 6px; }
.e3 { --eg: #DCE6CF; transform: rotate(9deg); animation-delay: -2.4s; }
@keyframes wobble { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -5deg; } 82% { rotate: 4deg; } 88% { rotate: -3deg; } 94% { rotate: 1deg; } }
.nest:hover .egg { animation-duration: 1.2s; }
.nest.hatching .egg { animation: shake .12s linear 6; }
@keyframes shake { 50% { rotate: 4deg; } 0%, 100% { rotate: -4deg; } }
.nest.hatched .egg .top { transform: translate(var(--tx, 0), -70px) rotate(var(--tr, -30deg)); opacity: 0; }
.nest.hatched .e1 { --tx: -30px; --tr: -40deg; } .nest.hatched .e3 { --tx: 30px; --tr: 40deg; }
.nest.hatched .egg { animation: none; }
.egg .num {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, 0) scale(.4); opacity: 0; z-index: 3;
  font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--moss-deep); white-space: nowrap;
  transition: transform .8s var(--spring) .25s, opacity .4s .25s;
}
.nest.hatched .egg .num { transform: translate(-50%, -84px) scale(1); opacity: 1; }

.pill {
  border: 0; background: var(--moss); color: #F6F1E6; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 22px -10px rgba(46,66,49,.7); transition: transform .25s var(--spring), background .2s, box-shadow .2s;
}
.pill:hover { transform: translateY(-2px); background: var(--moss-deep); }
.pill:active { transform: scale(.97); }
.pill.big { font-size: 17px; padding: 16px 30px; margin-top: 14px; }
.pill.ghost { background: transparent; color: var(--moss); box-shadow: inset 0 0 0 1.5px var(--sage); }
.pill.ghost:hover { background: rgba(169,189,163,.2); }
.pill.soft { background: var(--paper-2); color: var(--moss-deep); box-shadow: none; }
.pill[disabled] { opacity: .5; cursor: default; transform: none; }
.nest-note { font-size: 12.5px; color: var(--ink-faint); margin: 12px 0 0; }
#hatchBtn { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 10px 30px -6px rgba(201,139,60,.75); } }

/* ---------- question cards ---------- */
.cards { display: grid; gap: 18px; max-width: 760px; margin: 0 auto; }
.qcard {
  position: relative; background: var(--paper-3); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden;
  animation: cardIn .7s var(--spring) both;
}
.qcard:nth-child(2) { animation-delay: .1s; } .qcard:nth-child(3) { animation-delay: .2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.qcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent, var(--robin)); }
.qcard.c0 { --accent: #86B3C1; --tint: #E3EEF1; } .qcard.c1 { --accent: #D9A07A; --tint: #F6E7DC; } .qcard.c2 { --accent: #8FAE7E; --tint: #E7EFDF; }
.q-main { display: grid; grid-template-columns: 116px 1fr; gap: 20px; padding: 22px 22px 22px 26px; align-items: start; }
.q-num {
  border-radius: 20px; background: var(--tint, #EEE); height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--moss-deep); position: relative;
}
.q-num small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.q-num b { font-family: var(--font-display); font-size: 46px; font-weight: 500; line-height: 1; }
.q-num .tag { position: absolute; bottom: 8px; font-size: 10px; color: var(--ink-faint); }
.q-body h3 { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin: 2px 0 4px; }
.q-sub { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft); }
.q-body textarea {
  width: 100%; min-height: 76px; resize: vertical; border-radius: 14px; border: 1.5px solid var(--edge); background: #fff;
  padding: 12px 14px; font-size: 15.5px; line-height: 1.45; outline: none; transition: border-color .2s, box-shadow .2s;
}
.q-body textarea:focus { border-color: var(--fern); box-shadow: 0 0 0 4px rgba(107,138,94,.15); }
.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.q-actions .pill { padding: 11px 20px; font-size: 14.5px; }
.linkish { border: 0; background: none; color: var(--moss); font-weight: 500; font-size: 14px; padding: 6px 4px; text-decoration: underline; text-decoration-color: var(--sage); text-underline-offset: 3px; }
.linkish:hover { color: var(--moss-deep); }
.q-msg { min-height: 20px; margin: 10px 0 0; font-size: 14.5px; color: var(--clay); font-weight: 500; }
.q-msg.good { color: var(--moss); }
.qcard.shake { animation: nope .5s ease; }
@keyframes nope { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.tries { display: inline-flex; gap: 4px; margin-left: auto; }
.tries i { width: 8px; height: 8px; border-radius: 50%; background: var(--edge); }
.tries i.used { background: var(--clay); }

.reveal-ans { margin: 14px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); font-size: 14.5px; line-height: 1.5; }
.reveal-ans b { font-family: var(--font-display); font-weight: 600; display: block; font-size: 16px; margin-bottom: 4px; }
.reveal-ans .waiting { display: block; margin-top: 8px; font-family: var(--font-hand); font-size: 20px; color: var(--clay); }

/* won state: the bird */
.qcard.won .q-body textarea, .qcard.won .q-actions, .qcard.won .q-msg { display: none; }
.bird-reveal { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0; border-top: 1px dashed var(--edge); background: linear-gradient(135deg, var(--tint, #EEE), var(--paper-3) 70%); }
.bird-photo { position: relative; min-height: 240px; overflow: hidden; }
.bird-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.bird-photo img.bg { object-fit: cover; filter: blur(18px) saturate(1.1); transform: scale(1.2); opacity: .75; }
.bird-photo.anim img.bg { animation: none; }
.bird-photo.anim img { animation: flyIn 1.1s var(--spring) both; }
@keyframes flyIn { from { clip-path: circle(0% at 50% 50%); transform: scale(1.3) rotate(-4deg); } to { clip-path: circle(75% at 50% 50%); transform: none; } }
.bird-photo .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-faint); font-size: 13px; }
.bird-text { padding: 22px 24px; }
.bird-text .yay { font-family: var(--font-hand); font-size: 28px; color: var(--clay); margin: 0; line-height: 1.1; }
.bird-text .ans { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 12px; line-height: 1.45; }
.bird-text .ans b { color: var(--moss-deep); font-weight: 600; }
.bird-text .gift { margin: 0; font-size: 15px; line-height: 1.5; }
.bird-text .gift strong { font-family: var(--font-display); font-weight: 600; font-size: 21px; display: block; color: var(--moss-deep); margin: 2px 0; }
.bird-text .fact { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 10px 0 12px; }
.bird-text .more { display: flex; gap: 14px; flex-wrap: wrap; }
.bird-text details { font-size: 13.5px; color: var(--ink-soft); margin-top: 10px; }
.bird-text summary { cursor: pointer; color: var(--moss); font-weight: 500; }
.bird-text details p { margin: 8px 0 0; line-height: 1.5; }
.qcard.won::after {
  content: "✓"; position: absolute; top: 14px; right: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fern); color: #fff; font-weight: 700; animation: pop .6s var(--spring) both .4s;
}
@keyframes pop { from { transform: scale(0); } }
.qcard.missed .q-num { filter: saturate(.6); }

/* done banner */
.done-banner {
  max-width: 760px; margin: 26px auto 0; text-align: center; padding: 26px 22px; border-radius: 26px;
  background: linear-gradient(135deg, #2E4231, #3E5641 60%, #55744F); color: #F6F1E6; box-shadow: var(--shadow-lg);
  animation: cardIn .8s var(--spring) both;
}
.done-banner .kicker { color: var(--honey); }
.done-banner h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 4px 0 16px; }
.done-birds { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.done-birds figure { margin: 0; width: 92px; }
.done-birds img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(246,241,230,.8); display: block; }
.done-birds .empty { width: 92px; height: 92px; border-radius: 50%; border: 2px dashed rgba(246,241,230,.45); display: grid; place-items: center; font-size: 28px; }
.done-birds figcaption { font-size: 11.5px; margin-top: 6px; opacity: .85; line-height: 1.25; }
.done-next { margin: 18px 0 0; font-size: 14px; opacity: .9; }
.done-next b { font-variant-numeric: tabular-nums; font-size: 16px; color: var(--honey); }

/* ---------- hints ---------- */
.hint-card { max-width: 760px; margin: 0 auto 16px; background: var(--paper-3); border-radius: 22px; box-shadow: var(--shadow); padding: 20px 22px; display: grid; grid-template-columns: 70px 1fr; gap: 18px; animation: cardIn .6s var(--spring) both; }
.hint-card .hn { width: 70px; height: 70px; border-radius: 18px; background: var(--tint, var(--paper-2)); display: grid; place-items: center; font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--moss-deep); }
.hint-card h4 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.hint-step { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; }
.hint-step .lvl { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); margin-top: 2px; }
.brief-box { position: relative; border-radius: 14px; background: var(--paper-2); padding: 12px 14px; font-size: 14.5px; line-height: 1.55; }
.brief-box.locked p { filter: blur(6px); user-select: none; }
.brief-box .peek { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; }
.brief-box p { margin: 0; transition: filter .5s; }
.brief-box .htitle { display: block; font-weight: 600; color: var(--moss-deep); margin-bottom: 4px; }
.empty-note { text-align: center; color: var(--ink-soft); font-size: 15px; padding: 30px 10px; }
.empty-note .big { font-size: 46px; display: block; margin-bottom: 6px; }

/* ---------- aviary ---------- */
.aviary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.bird-card {
  border: 0; padding: 0; text-align: left; background: var(--paper-3); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .3s var(--spring), box-shadow .3s; animation: cardIn .6s var(--spring) both;
}
.bird-card:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: var(--shadow-lg); }
.bird-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--paper-2); }
.bird-card div { padding: 10px 12px 12px; }
.bird-card b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 15.5px; line-height: 1.2; }
.bird-card span { font-size: 11.5px; color: var(--ink-faint); }

/* ---------- map ---------- */
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg.learned, .cell.learned { background: var(--fern); color: #fff; }
.lg.missed, .cell.missed { background: var(--clay); color: #fff; }
.lg.today, .cell.today { background: var(--honey); color: var(--ink); }
.lg.upcoming { background: rgba(251,248,241,.9); box-shadow: inset 0 0 0 1px var(--edge); }
.lg.rep { background: repeating-linear-gradient(135deg, var(--paper-2) 0 3px, var(--edge) 3px 5px); }
.map-part { background: rgba(251,248,241,.8); backdrop-filter: blur(6px); border-radius: 20px; padding: 16px 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.map-part h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 10px; }
.map-part h4 b { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--moss-deep); margin-right: 8px; }
.map-part h4 em { font-style: normal; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.cell {
  border: 0; height: 34px; border-radius: 8px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: #fff; color: var(--ink-faint); box-shadow: inset 0 0 0 1px var(--edge); transition: transform .2s var(--spring);
}
.cell:hover { transform: scale(1.12); }
.cell.rep { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(140,149,139,.18) 4px 6px); }
.cell.seen { color: var(--moss); box-shadow: inset 0 0 0 1.5px var(--sage); }
.cell.today { animation: todayPulse 2s ease-in-out infinite; box-shadow: none; }
@keyframes todayPulse { 50% { box-shadow: 0 0 0 4px rgba(232,184,92,.35); } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(31,42,36,.45); backdrop-filter: blur(4px); animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { position: relative; width: min(520px, 100%); max-height: 88svh; overflow: auto; background: var(--paper-3); border-radius: 24px; box-shadow: var(--shadow-lg); animation: cardIn .45s var(--spring) both; }
.x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(246,241,230,.9); font-size: 22px; line-height: 1; box-shadow: var(--shadow); }
.sheet .m-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); border-radius: 24px 24px 0 0; }
.sheet .m-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sheet .m-photo img.bg { object-fit: cover; filter: blur(18px); transform: scale(1.2); opacity: .7; }
.sheet .m-body { padding: 20px 22px 24px; }
.sheet h3 { font-family: var(--font-display); font-weight: 500; font-size: 26px; margin: 0 0 6px; }
.sheet .m-meta { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 12px; }
.sheet p { line-height: 1.55; font-size: 14.5px; }
.sheet .m-art { background: var(--paper-2); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.sheet .m-art b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 15.5px; margin-bottom: 4px; }
.sheet a { color: var(--moss); }

/* ---------- footer ---------- */
.foot { text-align: center; margin-top: 50px; font-size: 13px; color: var(--ink-soft); }
.foot p { margin: 4px 0; }
.foot .credit { font-size: 11.5px; color: var(--ink-faint); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px 30px; }
  .hero { padding-top: 22px; }
  .lede { font-size: 15px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat b { font-size: 26px; }
  .tabs { margin: 22px -16px 18px; width: calc(100% + 32px); max-width: none; border-radius: 0; padding: 6px 6px calc(6px); top: 0; gap: 2px; }
  .tab { flex: 1 1 0; flex-direction: column; gap: 2px; padding: 7px 2px 6px; font-size: 11.5px; border-radius: 14px; position: relative; }
  .tab .ic { font-size: 19px; line-height: 1.1; }
  .tab .lb { display: none; } .tab .lbs { display: inline; }
  .tab .count { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .q-main { grid-template-columns: 1fr; gap: 14px; padding: 18px 18px 18px 22px; }
  .q-num { height: auto; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 12px 16px; align-items: baseline; }
  .q-num b { font-size: 34px; }
  .q-num .tag { position: static; margin-left: auto; }
  .bird-reveal { grid-template-columns: 1fr; }
  .bird-photo { min-height: 230px; }
  .hint-card { grid-template-columns: 1fr; gap: 10px; }
  .hint-card .hn { display: none; }
  .aviary-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cells { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
  .clock { font-size: 11.5px; }
  .egg { width: 68px; height: 88px; } .e2 { width: 76px; height: 98px; }
  .nest { height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* answered / missed details */
.q-you { margin: 0 0 4px; font-size: 13.5px; color: var(--ink-soft); }
.q-you q { font-style: italic; color: var(--ink); }
.qcard.missed[data-ctx="today"] textarea, .qcard.missed[data-ctx="today"] .q-actions > .check,
.qcard.missed[data-ctx="today"] .q-actions > .hint, .qcard.missed[data-ctx="today"] .q-actions > .reveal,
.qcard.missed[data-ctx="today"] .q-actions > .tries, .qcard.missed[data-ctx="today"] .q-msg { display: none; }
.chip { display: inline-block; vertical-align: middle; margin-left: 8px; font-family: var(--font-body); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(107,138,94,.16); color: var(--moss); }
.chip.warn { background: rgba(184,103,74,.14); color: var(--clay); }

/* bird reward: number badge + "did you know" */
.bird-no {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(31,42,36,.72); color: #F6F1E6; padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.dyk {
  position: relative; margin: 12px 0 10px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,.7); box-shadow: inset 3px 0 0 var(--honey);
}
.dyk span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ochre); margin-bottom: 4px; }
.dyk p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.sheet .dyk { background: var(--paper-2); }

/* ---------- swipeable bird photos + tap to hear ---------- */
.bird-photo.gallery { position: relative; min-height: 260px; overflow: hidden; background: #DCE4D6; }
.g-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.g-track::-webkit-scrollbar { display: none; }
.g-slide { position: relative; flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; cursor: pointer; overflow: hidden; }
.g-slide img { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-slide img.pic { object-fit: contain; }
.g-slide img.bg { object-fit: cover; filter: blur(18px) saturate(1.1); transform: scale(1.2); opacity: .75; }
.g-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 46px; font-size: 12px; line-height: 1.35; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.55)); text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.bird-photo.anim .g-slide:first-child img.pic { animation: flyIn 1.1s var(--spring) both; }
.bird-photo.anim img.bg { animation: none; }
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(246,241,230,.85); color: var(--moss-deep); font-size: 22px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); opacity: 0; transition: opacity .25s;
}
.g-nav.prev { left: 10px; } .g-nav.next { right: 10px; }
.bird-photo.gallery:hover .g-nav { opacity: 1; }
@media (hover: none) { .g-nav { display: none; } }
.g-dots { position: absolute; top: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.g-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.08); transition: transform .25s, background .25s; }
.g-dots i.on { background: #fff; transform: scale(1.3); }
.bird-no { z-index: 3; }
.play-call {
  position: absolute; right: 12px; bottom: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 8px; border: 0;
  padding: 9px 14px 9px 11px; border-radius: 999px; background: rgba(246,241,230,.94); color: var(--moss-deep); font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.35); animation: callHint 2.4s ease-in-out infinite;
}
.play-call svg { flex: none; color: var(--clay); }
.play-call .pc-bars { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.play-call .pc-bars i { width: 3px; height: 4px; border-radius: 2px; background: var(--clay); animation: eqBar .9s ease-in-out infinite; }
.play-call .pc-bars i:nth-child(2) { animation-delay: .15s; } .play-call .pc-bars i:nth-child(3) { animation-delay: .3s; }
.play-call .pc-bars i:nth-child(4) { animation-delay: .45s; } .play-call .pc-bars i:nth-child(5) { animation-delay: .6s; }
.play-call.playing { background: var(--moss); color: #F6F1E6; animation: none; }
.play-call.playing svg { display: none; }
.play-call.playing .pc-bars { display: inline-flex; }
.play-call.playing .pc-bars i { background: var(--honey); }
.play-call.loading { animation: none; opacity: .9; }
.play-call.loading svg { animation: spinPulse 1s ease-in-out infinite; }
@keyframes eqBar { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes callHint { 0%, 100% { box-shadow: 0 6px 18px -6px rgba(0,0,0,.35), 0 0 0 0 rgba(232,184,92,.6); } 50% { box-shadow: 0 6px 18px -6px rgba(0,0,0,.35), 0 0 0 8px rgba(232,184,92,0); } }
@keyframes spinPulse { 50% { transform: scale(.8); opacity: .5; } }
.tap-hint { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ochre); font-weight: 600; }
.credit-line { font-size: 11.5px; color: var(--ink-faint); margin: 10px 0 0; line-height: 1.45; }
.credit-line a { color: var(--moss); }
.flow-note { text-align: center; max-width: 620px; margin: 6px auto 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.bird-photo.in-modal { aspect-ratio: 4 / 3; min-height: 0; border-radius: 24px 24px 0 0; }
.sheet .bird-photo.in-modal .play-call { bottom: 14px; }

/* done banner birds you can tap to hear */
.done-bird { position: relative; display: block; width: 92px; height: 92px; padding: 0; border: 0; border-radius: 50%; background: none; }
.done-bird img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(246,241,230,.8); display: block; }
.done-bird .db-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(232,184,92,0); }
.done-bird.playing .db-ring { animation: ringPulse 1.2s ease-out infinite; }
.done-bird .db-play { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--honey); color: var(--moss-deep); display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.done-bird.playing .db-play { background: #fff; }
@keyframes ringPulse { 0% { border-color: rgba(232,184,92,.9); transform: scale(1); } 100% { border-color: rgba(232,184,92,0); transform: scale(1.35); } }
.done-tap { margin: 12px 0 0; font-size: 12.5px; opacity: .75; }

.av-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom,0px)); z-index: 70; transform: translate(-50%, 20px); opacity: 0;
  max-width: min(92vw, 420px); padding: 11px 16px; border-radius: 14px; background: var(--moss-deep); color: #F6F1E6; font-size: 13.5px; text-align: center;
  box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s; pointer-events: none;
}
.av-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) {
  .bird-photo.gallery { min-height: 0; aspect-ratio: 4 / 3.4; }
  .play-call { font-size: 12.5px; padding: 8px 12px 8px 10px; }
}
.rare-tag { display: inline-block; margin: 2px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--clay); background: rgba(184,103,74,.12); padding: 3px 9px; border-radius: 999px; }
