/* Singbud app base: tokens, type, buttons, inputs, squiggle, ticket and Bud motion.
   Copied from the landing page (css/styles.css) so the app has the same hand. Edit here, not there.
   Refined for adults: a warm off-white page, hairline borders and soft shadows instead of solid
   bottom edges, tighter corners, coral kept for the main action and teal for progress and selection. */
:root {
  /* --mint was the page colour; it is now the warm off-white page and the quiet fill inside cards.
     The real brand mint lives on as --mint-brand. */
  --mint: #F7F5F0;
  --mint-brand: #EDFBFC;
  --teal-wash: #E6F4F3;
  --teal-text: #2A7172;
  --cream: #FFF7EC;
  --cream-deep: #F3E6D2;
  --teal: #91D7D7;
  --teal-dark: #74C7C8;
  --teal-deeper: #5BB0B1;
  --belly: #D3F0EB;
  --coral: #F27165;
  --coral-dark: #C9564B;
  --coral-text: #C24F44;
  --blush: #FDE1DE;
  --ink: #2E3D44;
  --ink-soft: #55656C;
  --cheek: #FAA39F;
  --yellow: #D7D79C;
  --sun: #F8F3D6;
  --sun-deep: #EFE4AE;
  --dash: #B5C5CA;
  --white: #FFFFFF;

  --font-head: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;

  --panel: #FCFBF8;   /* side rail and Bud's panel */
  --line: #E8E3DA;
  --line-strong: #D9D2C5;
  --sh-card: 0 0 0 1px var(--line), 0 1px 2px rgba(46, 61, 68, 0.04);
  --sh-raise: 0 0 0 1px var(--line), 0 2px 4px rgba(46, 61, 68, 0.04), 0 10px 24px -14px rgba(46, 61, 68, 0.22);
  --sh-solid: 0 1px 2px rgba(46, 61, 68, 0.16);
  --sh-press: 0 0 0 1px var(--line);
  --ring: 0 0 0 3px rgba(91, 176, 177, 0.35);

  --r-card: 20px;
  --r-lg: 24px;
  --r-btn: 14px;
  --wrap: 1180px;
  --gutter: 20px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(2.1rem, 1.45rem + 2.6vw, 3.25rem); }
h3 { font-size: 1.4rem; }
p { margin: 0; }

/* SVG text styles used by the illustrations */
.f-head { font-family: var(--font-head); font-weight: 700; }
.f-sans { font-family: var(--font-body); }
.f-b { font-weight: 700; }
.f-hand { font-family: var(--font-hand); font-weight: 700; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 10px; }

/* ---------- Sections ---------- */



.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-text);
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
/* Each variant sets its own shadow tokens, so any rule elsewhere that says var(--sh-card) on a
   button resolves to that button's look, not a card's. */

.btn {
  --sh-card: var(--sh-solid);
  --sh-press: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--sh-card);
  transition: transform 120ms ease-out, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { box-shadow: var(--sh-card); }
.btn:active { transform: scale(0.98); box-shadow: var(--sh-press); transition-duration: 60ms; }
.btn:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: var(--r-btn); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { --sh-card: 0 1px 2px rgba(201, 86, 75, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14); background: var(--coral); color: var(--white); }
.btn-primary:hover { background: #E8665A; }
.btn-primary:active { background: #DC5D51; }
.btn-secondary { --sh-card: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgba(46, 61, 68, 0.05); --sh-press: inset 0 0 0 1px var(--line-strong); background: var(--white); color: var(--ink); }
.btn-secondary:hover { background: #FBFAF7; --sh-card: inset 0 0 0 1px #C9C1B2, 0 1px 2px rgba(46, 61, 68, 0.06); }
.btn-ink { --sh-card: 0 1px 2px rgba(24, 36, 42, 0.3); background: var(--ink); color: var(--white); }
.btn-ink:hover { background: #3A4B53; }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1.1rem; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; border-radius: 12px; box-shadow: var(--sh-card); }
.btn-sm:hover { box-shadow: var(--sh-card); }
.btn-sm:active { transform: scale(0.98); box-shadow: var(--sh-press); }

.btn-link {
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px; text-underline-offset: 5px;
  transition: text-decoration-color 160ms ease, color 160ms ease;
}
.btn-link:hover { text-decoration-color: var(--ink); }

.pill {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--sh-card);
  font-weight: 600; font-size: 0.9rem;
}

/* ---------- Brand ---------- */


.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  font-family: var(--font-head); font-weight: 700; font-size: 1.7rem;
  letter-spacing: -0.01em;
}
/* Logo: Bud on his own, cut from the app icon. Rebuild with tools/make-mark.py */
.brand-tile { flex: none; display: inline-block; line-height: 0; }
.brand-tile img { max-width: none; } /* the global max-width would squash him */
/* Snug: the beak tip stops just short of the first letter */
.brand-tile img { width: 64px; height: 64px; margin: -6px -7px -6px -6px; }
.brand-sm { font-size: 1.3rem; gap: 10px; }
.brand-sm .brand-tile img { width: 42px; height: 42px; margin: -4px -5px -4px -4px; }

.nowrap { white-space: nowrap; }
.br-wide { display: none; }
.squiggle {
  position: relative; display: inline-block; white-space: nowrap;
  isolation: isolate; /* keeps the line behind the letters but above the page */
}
/* Sits under the descender of "g", not through it */
.squiggle-line {
  position: absolute; left: -3%; bottom: -0.14em; z-index: -1;
  width: 106%; height: 0.2em; overflow: visible;
}
.squiggle-line path {
  stroke-width: 0.075em;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
@keyframes draw-on { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.ticket {
  position: relative;
  display: grid; grid-template-columns: 1fr 112px;
  width: 100%; max-width: 500px;
  background: var(--cream);
  border-radius: 18px;
  box-shadow: var(--sh-card);
  transform: rotate(-2.5deg);
}
.ticket.is-punched { animation: punch 420ms ease-out; }
.ticket-main { padding: 26px 22px 28px 28px; min-width: 0; }
.ticket-kicker { font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--teal-text); }
.ticket-title {
  margin-top: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.7rem); line-height: 1.02;
}
.ticket-count { margin-top: 16px; }
.ticket-count span {
  display: inline-block;
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem;
  background: var(--sun); padding: 2px 16px; border-radius: 999px;
}
.ticket-plan { margin-top: 16px; color: var(--ink-soft); font-size: 0.98rem; }
.ticket-stub {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border-left: 3px dashed var(--dash);
  padding: 18px 8px;
}
.ticket-stub::before, .ticket-stub::after {
  content: ''; position: absolute; left: -16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal);
}
.ticket-stub::before { top: -15px; }
.ticket-stub::after { bottom: -15px; }
.ticket-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--white); display: grid; place-items: center; }
.ticket-icon svg { width: 62px; height: 62px; }
.ticket-admit { font-weight: 700; font-size: 0.9rem; line-height: 1.2; text-align: center; }

.input {
  min-height: 52px; width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: inherit; font-size: 1.0625rem; color: var(--ink);
}
.input::placeholder { color: #8A979C; }
.input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--teal-deeper), var(--ring); }
.input[aria-invalid="true"] { outline: 3px solid var(--sun); }
.form-error { min-height: 1.5em; margin-top: 10px; color: var(--ink); font-weight: 700; }

/* ---------- Bud ---------- */

.bud-stage { position: relative; }
.bud { width: 100%; height: auto; overflow: visible; }

/* ---------- Motion (gentle) ---------- */

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
/* Logo: one small hello hop on load, a wiggle on hover or tap. Never loops. */
@keyframes logo-hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-6px) rotate(-6deg); }
  55% { transform: translateY(0) rotate(0); }
  72% { transform: translateY(-2px) rotate(2deg); }
}
@keyframes logo-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: translateY(-3px) rotate(-9deg); }
  50% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
}
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(0.12); } }
@keyframes wave {
  0%, 55%, 100% { transform: rotate(0deg); }
  62% { transform: rotate(24deg); }
  70% { transform: rotate(4deg); }
  78% { transform: rotate(24deg); }
  86% { transform: rotate(0deg); }
}
@keyframes drift {
  0% { transform: translateY(6px); opacity: 0; }
  20%, 70% { opacity: 1; }
  100% { transform: translateY(-26px); opacity: 0; }
}
@keyframes sing-up { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-8deg); } }
@keyframes sing-lo { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(12deg); } }
@keyframes hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-18px) rotate(-3deg); }
  55% { transform: translateY(0) rotate(0); }
  72% { transform: translateY(-7px); }
}
@keyframes tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
@keyframes sound { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes punch { 0% { transform: rotate(-2.5deg) scale(1); } 40% { transform: rotate(-1deg) scale(1.03); } 100% { transform: rotate(-2.5deg) scale(1); } }
/* Hummingbird hover: a slow, loose figure of eight around one spot */
@keyframes hover {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-10px, -7px); }
  40% { transform: translate(-16px, 2px); }
  60% { transform: translate(-6px, 6px); }
  80% { transform: translate(6px, -4px); }
}
@keyframes flap { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-12deg); } }

.brand-tile img { transform-origin: 50% 85%; }
.bud-float { animation: bob 4.5s ease-in-out infinite; }
.bud .bud-eye { animation: blink 5.5s infinite; }
.bud-wave .bud-wing { animation: wave 6s ease-in-out infinite; }
.bud-note { animation: drift 5s ease-in-out infinite; }
.bud-note-2 { animation-delay: 2.5s; }
.bud-note-3 { animation-delay: 1.2s; }
.bud-think { animation: tilt 7s ease-in-out infinite; transform-origin: 50% 80%; }
.bud-sing .bud-sound { opacity: 0.25; }
.bud-sing .bud-note { opacity: 0; animation: none; }


.is-singing .bud-beak-up { animation: sing-up 0.42s ease-in-out infinite; }
.is-singing .bud-beak-lo { animation: sing-lo 0.42s ease-in-out infinite; }
.is-singing .bud-sound { animation: sound 0.42s ease-in-out infinite; }
.is-singing .bud-note { animation: drift 1.6s ease-out infinite; }
.is-hopping { animation: hop 0.9s ease-out; }
.bud-cheer { animation: hop 1.1s ease-out 0.1s; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .btn:active, .btn:hover { transform: none; }
  .bud-sing .bud-sound { opacity: 1; }
}
