/* ============================================================
   AyAyPotters — storybook landing styles
   Palette inspired by soft-book chibi art: mint sky, sand castle,
   warm cream, coral red, gold, chocolate-brown outlines.
   ============================================================ */

:root {
  --sky: #cdeee8;
  --sky-deep: #a7dcd2;
  --sky-night: #2b2357;
  --cream: #fff9ee;
  --parchment: #fdf3dc;
  --parchment-deep: #f3e3bd;
  --sand: #efdfb4;
  --sand-deep: #dfc890;
  --roof: #8fb6cd;
  --roof-deep: #6f9cb8;
  --coral: #e2543e;
  --coral-deep: #c23f2e;
  --gold: #eebb52;
  --gold-deep: #cf9c2e;
  --grass: #b9dc9b;
  --grass-deep: #9cc47e;
  --ink: #5b4230;
  --ink-soft: #7a5b41;
  --outline: #8a6237;
  --teal-card: #bfe6df;
  --white: #ffffff;
  --shadow: 0 10px 24px rgba(91, 66, 48, 0.16);
  --radius-lg: 28px;
  --radius-md: 20px;
  --font-display: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Patrick Hand", "Comic Sans MS", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  line-height: 1.55;
}

img, svg { max-width: 100%; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }

a { color: var(--coral-deep); }

button { font-family: inherit; cursor: pointer; }

/* iOS Safari: instant, reliable taps — no double-tap-zoom hijacking */
button, a { touch-action: manipulation; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }

/* decorations must never swallow taps */
.cloud, .hero-snitch, .hero .twinkle, .cta-banner .star, .wit-cloud { pointer-events: none; }

::selection { background: var(--gold); color: var(--ink); }

/* ---------- click sparkles ---------- */
.click-spark {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 18px;
  animation: sparkFly 0.7s ease-out forwards;
}
@keyframes sparkFly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0.2); opacity: 0; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px);
  background: rgba(255, 249, 238, 0.97);
  border-bottom: 3px solid var(--sand-deep);
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.logo .bolt { color: var(--gold-deep); }
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: var(--ink);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.nav a:hover { background: var(--sand); border-color: var(--outline); transform: translateY(-2px); }
.nav a.nav-cta {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral-deep);
  box-shadow: 0 4px 0 var(--coral-deep);
}
.nav a.nav-cta:hover { background: var(--coral-deep); }

/* ---------- hero scene ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #e6f8f4 0%, var(--sky) 45%, var(--sky-deep) 100%);
  padding: clamp(20px, 5vw, 56px) clamp(14px, 4vw, 40px) 0;
}
.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(12px, 3vw, 36px);
  align-items: center;
}

/* drifting clouds */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 999px;
  opacity: 0.9;
  filter: drop-shadow(0 6px 0 rgba(138, 98, 55, 0.08));
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud-1 { width: 130px; height: 44px; top: 8%;  left: -140px; animation: drift 42s linear infinite; }
.cloud-2 { width: 90px;  height: 32px; top: 22%; left: -100px; animation: drift 55s linear 8s infinite; }
.cloud-3 { width: 160px; height: 52px; top: 4%;  left: -180px; animation: drift 65s linear 20s infinite; }
.cloud-1::before { width: 56px; height: 56px; top: -24px; left: 22px; }
.cloud-1::after  { width: 40px; height: 40px; top: -14px; right: 24px; }
.cloud-2::before { width: 40px; height: 40px; top: -18px; left: 16px; }
.cloud-2::after  { width: 28px; height: 28px; top: -10px; right: 16px; }
.cloud-3::before { width: 66px; height: 66px; top: -30px; left: 30px; }
.cloud-3::after  { width: 46px; height: 46px; top: -16px; right: 30px; }
@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 220px)); }
}

/* twinkling stars in the sky */
.hero .twinkle {
  position: absolute;
  color: var(--gold-deep);
  animation: twinkle 2.6s ease-in-out infinite;
  z-index: 1;
  font-size: 20px;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1.15) rotate(20deg); }
}

/* the flying snitch */
.hero-snitch {
  position: absolute;
  width: clamp(54px, 7vw, 84px);
  top: 12%;
  left: 0;
  z-index: 2;
  animation: snitchFly 16s ease-in-out infinite;
}
@keyframes snitchFly {
  0%   { transform: translate(-10vw, 0)      rotate(6deg); }
  25%  { transform: translate(28vw, 8vh)     rotate(-8deg); }
  50%  { transform: translate(64vw, -2vh)    rotate(6deg); }
  75%  { transform: translate(86vw, 10vh)    rotate(-6deg); }
  100% { transform: translate(110vw, 0)      rotate(6deg); }
}
.snitch-wing { transform-origin: center; }
.snitch-wing.left  { animation: flapL 0.35s ease-in-out infinite alternate; transform-origin: 78% 50%; }
.snitch-wing.right { animation: flapR 0.35s ease-in-out infinite alternate; transform-origin: 22% 50%; }
@keyframes flapL { from { transform: rotate(6deg); } to { transform: rotate(-28deg); } }
@keyframes flapR { from { transform: rotate(-6deg); } to { transform: rotate(28deg); } }

/* hero text side */
.hero-copy { padding: clamp(8px, 2vw, 20px) 0 clamp(24px, 4vw, 48px); }

.star-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--sand-deep);
  animation: bobSoft 3.4s ease-in-out infinite;
}
@keyframes bobSoft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hero-title {
  margin: 14px 0 6px;
  font-size: clamp(2rem, 6.2vw, 3.7rem);
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 3px 0 #fff;
}
.hero-title .arch-word { white-space: nowrap; display: inline-block; }
.hero-title .arch-letter {
  display: inline-block;
  animation: letterBounce 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.09s);
}
@keyframes letterBounce {
  0%, 100% { transform: translateY(0); }
  20%      { transform: translateY(-9px) rotate(-3deg); }
  40%      { transform: translateY(0); }
}
.hero-title .word-potter { color: var(--coral-deep); }

.hero-sub {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.hero-hook {
  font-size: clamp(1rem, 2.8vw, 1.18rem);
  font-weight: 600;
  max-width: 34rem;
  margin-bottom: 20px;
}
.hero-hook .fable-badge {
  display: inline-block;
  background: linear-gradient(135deg, #7b5bd6, #b13fb0);
  color: #fff;
  border-radius: 8px;
  padding: 1px 9px;
  font-family: var(--font-display);
  white-space: nowrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 3.2vw, 1.4rem);
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-deep) 100%);
  border: 3px solid #8f2b1e;
  border-radius: 999px;
  padding: clamp(14px, 2.6vw, 18px) clamp(22px, 4.5vw, 38px);
  box-shadow: 0 7px 0 #8f2b1e, 0 16px 26px rgba(194, 63, 46, 0.35);
  transition: box-shadow 0.15s;
  animation: ctaPulse 2.2s ease-in-out infinite;
  text-align: center;
}
.cta-btn:hover { animation-play-state: paused; filter: brightness(1.12); }
.cta-btn:active { animation: none; transform: translateY(3px); box-shadow: 0 3px 0 #8f2b1e; }
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}
.cta-note {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* hero Ayra figure */
.hero-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 300px;
}
.duo-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2px, 1.5vw, 14px);
}
.ayra-svg {
  width: clamp(180px, 22vw, 290px);
  height: auto;
  animation: bobSoft 3.2s ease-in-out infinite;
}
.ayan-svg {
  width: clamp(140px, 17.5vw, 230px);
  height: auto;
  animation: bobSoft 3.2s ease-in-out 0.6s infinite;
}
.ball-bounce {
  animation: ballBounce 1.15s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}
@keyframes ballBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-13px) rotate(18deg); }
}
.wit-cloud {
  position: relative;
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
  box-shadow: 0 5px 0 var(--sand-deep);
  margin-bottom: 12px;
  text-align: center;
  animation: bobSoft 4s ease-in-out 0.5s infinite;
}
.wit-cloud::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 3px solid var(--outline);
  border-top: none;
  border-left: none;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 6px 0;
}

/* eyes blink */
.ayra-eyes { animation: blink 4.2s ease-in-out infinite; transform-origin: center 40%; transform-box: fill-box; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97%      { transform: scaleY(0.08); }
}
.wand-star { animation: twinkle 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scarf-tail { animation: sway 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(6deg); }
}

/* castle skyline at bottom of hero */
.castle-strip {
  position: relative;
  z-index: 2;
  margin-top: clamp(-30px, -2vw, -8px);
  overflow: hidden;
  line-height: 0;
}
.castle-strip svg {
  display: block;
  width: max(100%, 760px);
  height: auto;
  margin: 0 auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.castle-flag { transform-box: fill-box; transform-origin: left center; animation: flagWave 2.4s ease-in-out infinite; }
.castle-flag.f2 { animation-delay: 0.5s; }
.castle-flag.f3 { animation-delay: 1s; }
@keyframes flagWave {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50%      { transform: skewY(-6deg) scaleX(0.94); }
}
.castle-window { animation: windowGlow 3.4s ease-in-out infinite; }
.castle-window.w2 { animation-delay: 1.2s; }
.castle-window.w3 { animation-delay: 2.1s; }
@keyframes windowGlow {
  0%, 100% { fill: #f7d879; }
  50%      { fill: #b98d4e; }
}

/* ---------- shared section chrome ---------- */
.section {
  padding: clamp(44px, 7vw, 90px) clamp(14px, 4vw, 40px);
}
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-title {
  font-size: clamp(1.6rem, 4.6vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 2.7vw, 1.15rem);
  max-width: 44rem;
  margin: 0 auto 34px;
}

/* ---------- about Ayra & Ayan ---------- */
.about { background: var(--cream); }
.star-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3.2vw, 1.45rem);
  color: var(--coral-deep);
  text-align: center;
  margin: 34px 0 16px;
}
.star-name.first { margin-top: 0; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.fact-card {
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 0 var(--sand-deep);
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.2s;
}
.fact-card:hover { transform: translateY(-6px) rotate(-1deg); }
.fact-card .fact-emoji { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.fact-card h3 { font-size: 1.06rem; color: var(--coral-deep); margin-bottom: 4px; }
.fact-card p { font-weight: 700; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- features ---------- */
.features { background: linear-gradient(180deg, var(--sky) 0%, #dcf2ec 100%); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.feature-card {
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 20px;
  text-align: center;
  position: relative;
  transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-8px) scale(1.02); }
.feature-card .feat-emoji {
  display: inline-grid;
  place-items: center;
  width: 74px;
  height: 74px;
  font-size: 2.3rem;
  background: var(--teal-card);
  border: 3px solid var(--outline);
  border-radius: 50%;
  margin-bottom: 12px;
}
.feature-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.feature-card p { font-weight: 700; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- big CTA banner ---------- */
.cta-banner {
  background:
    radial-gradient(circle at 18% 30%, rgba(238, 187, 82, 0.25), transparent 42%),
    radial-gradient(circle at 84% 70%, rgba(226, 84, 62, 0.22), transparent 40%),
    var(--sky-night);
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-banner .section-title { color: #ffe9b0; text-shadow: 0 3px 0 rgba(0,0,0,0.3); }
.cta-banner .section-sub { color: #d8cff5; }
.cta-banner .star {
  position: absolute;
  color: #ffe9b0;
  animation: twinkle 3s ease-in-out infinite;
  font-size: 18px;
}

/* ---------- quiz ---------- */
.quiz { background: var(--parchment); }
.quiz-progress {
  max-width: 560px;
  margin: 0 auto 24px;
  text-align: center;
}
.quiz-progress .bar {
  height: 22px;
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--coral) 100%);
  border-radius: 999px;
  transition: width 0.45s ease;
}
.quiz-progress .label {
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 8px;
  color: var(--ink-soft);
}
.quiz-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}
.quiz-tab {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 4px 0 var(--sand-deep);
  transition: transform 0.15s, background 0.15s;
}
.quiz-tab:hover { transform: translateY(-3px); }
.quiz-tab.active { background: var(--coral); color: #fff; border-color: var(--coral-deep); box-shadow: 0 4px 0 var(--coral-deep); }
.quiz-tab.surprise { background: var(--gold); border-color: var(--gold-deep); box-shadow: 0 4px 0 var(--gold-deep); }

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.q-card {
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 0 var(--sand-deep);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.q-card.flash {
  animation: cardFlash 1.2s ease-in-out 2;
}
@keyframes cardFlash {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 0 var(--sand-deep); }
  50%      { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(238, 187, 82, 0.55); }
}
.q-chip {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--outline);
}
.q-chip.wizard { background: #e8ddf7; }
.q-chip.joke   { background: #ffe1d6; }
.q-chip.riddle { background: #d6ecff; }
.q-chip.animal { background: #ddf3d2; }
.q-num { color: var(--ink-soft); font-weight: 800; font-size: 0.8rem; }
.q-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  flex-grow: 1;
}
.q-reveal-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--ink);
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 12px 16px;
  box-shadow: 0 4px 0 var(--outline);
  transition: transform 0.15s;
}
.q-reveal-btn:hover { transform: translateY(-2px); }
.q-reveal-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
.q-answer {
  display: none;
  background: var(--teal-card);
  border: 3px dashed var(--outline);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
}
.q-card.revealed .q-answer { display: block; animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- parent note & footer ---------- */
.parents { background: var(--cream); padding-bottom: 24px; }
.parent-note {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 3px solid var(--outline);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 0 var(--sand-deep);
  padding: 20px 24px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.parent-note .shield { font-size: 2rem; }
.parent-note h3 { font-size: 1.05rem; margin-bottom: 2px; }
.parent-note p { font-size: 0.92rem; font-weight: 700; color: var(--ink-soft); }

.site-footer {
  text-align: center;
  padding: 26px 16px 34px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}
.site-footer .made { font-size: 0.92rem; margin-bottom: 6px; color: var(--ink); }

/* ============================================================
   THE OWL POST LETTER OVERLAY
   ============================================================ */
.letter-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)) 16px;
  background:
    radial-gradient(circle at 50% 20%, rgba(238, 187, 82, 0.18), transparent 50%),
    rgba(43, 35, 87, 0.92);
  opacity: 1;
  transition: opacity 0.5s ease;
}
.letter-overlay.hidden { opacity: 0; pointer-events: none; }
.letter-overlay .skip-x {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 210;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: rgba(43, 35, 87, 0.55);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}
.letter-stage {
  position: relative;
  width: min(560px, 94vw);
  text-align: center;
  margin: auto; /* centers when it fits, scrolls when it doesn't */
  flex-shrink: 0;
}

/* owl */
.owl-fly {
  width: clamp(110px, 20vw, 150px);
  margin: 0 auto -8px;
  animation: owlHover 2.6s ease-in-out infinite;
}
@keyframes owlHover {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
.owl-wing { transform-box: fill-box; }
.owl-wing.left  { transform-origin: 90% 20%; animation: owlFlapL 0.5s ease-in-out infinite alternate; }
.owl-wing.right { transform-origin: 10% 20%; animation: owlFlapR 0.5s ease-in-out infinite alternate; }
@keyframes owlFlapL { from { transform: rotate(8deg); }  to { transform: rotate(-30deg); } }
@keyframes owlFlapR { from { transform: rotate(-8deg); } to { transform: rotate(30deg); } }

.overlay-title {
  font-family: var(--font-display);
  color: #ffe9b0;
  font-weight: 700;
  font-size: clamp(1.3rem, 4.5vw, 1.9rem);
  text-shadow: 0 3px 0 rgba(0,0,0,0.35);
  margin: 10px 0 16px;
}

/* envelope stage */
.envelope-wrap { display: grid; place-items: center; }
.envelope {
  position: relative;
  width: min(340px, 82vw);
  cursor: pointer;
  border: none;
  background: none;
  animation: bobSoft 2.6s ease-in-out infinite;
}
.envelope:hover { animation-play-state: paused; transform: scale(1.04); }
.tap-hint {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  animation: hintPulse 1.6s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
.addr-shimmer { animation: addrShimmer 2.2s ease-in-out infinite; }
@keyframes addrShimmer {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.4; }
}

/* the letter itself */
.letter-card {
  display: none;
  background: var(--parchment);
  border: 4px solid var(--outline);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45), inset 0 0 60px rgba(138, 98, 55, 0.12);
  padding: clamp(18px, 4vw, 34px);
  text-align: left;
  /* no inner scroll — the whole overlay scrolls, so the button is always reachable */
}
.letter-stage.opened .envelope-wrap { display: none; }
.letter-stage.opened .letter-card { display: block; animation: letterIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes letterIn {
  from { transform: translateY(48px) scale(0.7) rotate(-3deg); opacity: 0; }
  to   { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}
.letter-card .crest {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 4px;
}
.letter-card h2 {
  font-family: var(--font-hand);
  text-align: center;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--coral-deep);
  margin-bottom: 12px;
}
.letter-card p, .letter-card li {
  font-family: var(--font-hand);
  font-size: clamp(1.12rem, 3.6vw, 1.35rem);
  color: var(--ink);
  line-height: 1.5;
}
.letter-card p { margin-bottom: 10px; }
.letter-card ul { list-style: none; margin: 10px 0 14px; }
.letter-card li { margin-bottom: 8px; }
.letter-card .sign {
  text-align: right;
  font-family: var(--font-hand);
  color: var(--ink-soft);
}
.enter-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  color: #fff;
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-deep) 100%);
  border: 3px solid #8f2b1e;
  border-radius: 999px;
  padding: 14px 18px;
  box-shadow: 0 6px 0 #8f2b1e;
  transition: transform 0.15s;
}
.enter-btn:hover { transform: translateY(-2px); }
.enter-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f2b1e; }

/* ---------- responsive ---------- */
/* short screens (small phones, Safari with its toolbars): shrink the owl post so
   the envelope and buttons fit — and the overlay scrolls if they still don't */
@media (max-height: 740px) {
  .owl-fly { width: 86px; margin-bottom: -4px; }
  .overlay-title { font-size: 1.1rem; margin: 6px 0 10px; }
  .envelope { width: min(280px, 74vw); }
  .tap-hint { margin-top: 12px; }
}

@media (max-width: 780px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; order: 1; }
  .hero-hook { margin-left: auto; margin-right: auto; }
  .hero-figure { order: 2; min-height: 0; margin-bottom: -6px; }
  .ayra-svg { width: clamp(150px, 40vw, 230px); }
  .ayan-svg { width: clamp(118px, 32vw, 185px); }
  .nav a:not(.nav-cta) { display: none; }
}

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