/* Design tokens ported from site_design/howl-hits-dog-landing.html.
   See site_design/README.md for the source design tokens table. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/instrument-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/instrument-sans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
}

:root {
  --ink: #1B1714;
  --cream: #FBF5EC;
  --accent: #F0663C;
  --accent-dark: #DC5730;
  --accent-deep: #C24F26;
  --peach: #FFE4D6;
  --muted: #6F635B;
  --quiet: #7A6E64;
  --line: #E7DDCE;
  --card: #fff;
  --chip-line: #E0D5C4;
  --slot-line: #D6C9B8;
  --slot-bg-a: #EFE6DA;
  --slot-bg-b: #F7F1E7;
  --error: #b00020;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* spacing scale: 6 . 8 . 12 . 14 . 20 . 22 . 24 . 36 . 40 . 52px */
  --space-1: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 14px;
  --space-5: 20px;
  --space-6: 22px;
  --space-7: 24px;
  --space-8: 36px;
  --space-9: 40px;
  --space-10: 52px;

  /* radii: 12 (small art) . 16 (step art) . 18 (input) . 20 (cards, CTA) . 22 (player) . 24 (hero art) . 999 (pills) */
  --radius-sm: 12px;
  --radius-step-art: 16px;
  --radius-input: 18px;
  --radius-card: 20px;
  --radius-player: 22px;
  --radius-hero: 24px;
  --radius-pill: 999px;

  --shadow-card: 0 2px 10px rgba(27, 23, 20, .06);
  --shadow-cta: 0 10px 24px rgba(240, 102, 60, .35);
  --shadow-player: 0 14px 32px rgba(27, 23, 20, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: #C24F26; text-decoration: none; }
a:hover { color: #9C3C18; }

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .96;
  text-wrap: pretty;
}

.wrap { max-width: 480px; margin: 0 auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--quiet);
}

.slot {
  border: 1px dashed var(--slot-line);
  background: repeating-linear-gradient(135deg, var(--slot-bg-a) 0 7px, var(--slot-bg-b) 7px 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  color: var(--quiet);
}

/* generic form controls shared by both wizard steps */
label { display: block; margin-top: var(--space-5); font-weight: 600; font-family: var(--body); }
input[type=text], input[type=email], select, textarea {
  width: 100%; padding: var(--space-5); margin-top: var(--space-2); box-sizing: border-box;
  font-size: 1rem; border: 2px solid var(--line); border-radius: var(--radius-input);
  background: #fff; color: var(--ink); font-family: var(--body);
}
input[type=text]:focus, input[type=email]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
.error { color: var(--error); margin-top: var(--space-5); font-family: var(--body); }
.honeypot { position: absolute; left: -9999px; }
.muted { color: var(--muted); font-size: .9rem; }
audio.hidden-audio { display: none; }

.btn-primary {
  width: 100%; border: 0; cursor: pointer; background: var(--accent); color: #fff;
  font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.01em;
  padding: var(--space-6); border-radius: var(--radius-card); box-shadow: var(--shadow-cta);
}
.btn-primary:hover { background: var(--accent-dark); }

.step-header {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-8) var(--space-7) var(--space-2);
}
.step-header .back {
  font-size: 20px; color: var(--ink); text-decoration: none; line-height: 1;
}

/* ---- landing page (/dog) ---- */

.hero { background: var(--peach); padding-bottom: 44px; position: relative; }
.brand { display: flex; align-items: center; gap: var(--space-2); }
.brand i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.brand span { font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
/* Top bar of the hero: brand on the left, the account link on the right. */
.hero-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--space-7) 6px;
}
/* Deliberately lighter than the orange CTA -- it's a wayfinding link for
   returning visitors, not the primary action. */
.signin-link {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--ink);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: transparent;
  transition: background-color .15s, border-color .15s;
}
.signin-link:hover { background: var(--cream); border-color: var(--ink); }
.signin-link__primary {
  font-family: var(--display); font-size: 14px; font-weight: 700;
  letter-spacing: -.01em; line-height: 1.1;
}
.signin-link__secondary {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--quiet); line-height: 1.3;
}
/* The hero photo (or, with no images configured, the placeholder) sits in
   a frame so it can fill the column while keeping its own margins. */
.hero-art-frame { display: flex; }
.hero-art {
  flex: 1; min-width: 0;
  aspect-ratio: 1 / 1; margin: var(--space-1) var(--space-5) 0;
  border-radius: var(--radius-hero); font-size: 10px;
  object-fit: cover;  /* photos of any aspect ratio fill the box */
}

.player {
  position: absolute; left: var(--space-5); right: var(--space-5); bottom: -30px;
  background: var(--ink); border-radius: var(--radius-player); padding: var(--space-4) var(--space-3);
  display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow-player);
}
.player .play {
  width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.player .play:hover { background: #FF7A52; }
.player .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.player .title {
  font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wave { display: flex; align-items: center; gap: 2px; height: 18px; cursor: pointer; }
.wave i {
  flex: 1 1 0; min-width: 2px; height: var(--h, 60%);
  background: #6E5F55; border-radius: 1px; transform-origin: center;
  transition: transform .35s ease, background-color .25s ease;
  animation: wv var(--d, .9s) ease-in-out var(--delay, 0s) infinite alternate;
}
/* Played portion: the wave doubles as the progress bar. */
.wave i.played { background: var(--accent); box-shadow: 0 0 6px rgba(255, 138, 91, .35); }
/* Paused / stopped (or autoplay blocked): the bars stop dancing and
   settle into the static waveform silhouette. */
.wave.is-idle i { animation: none; transform: scaleY(.55); }
@keyframes wv { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .wave i { animation: none; transform: scaleY(.75); }
}
.player.is-dead .play, .player.is-dead .unmute { opacity: .4; cursor: default; }
.unmute {
  flex: none; border: 1px solid #4A403A; background: transparent; color: var(--cream);
  font: 600 11px/1 var(--body); letter-spacing: .06em; text-transform: uppercase;
  padding: var(--space-2) 11px; border-radius: var(--radius-pill); cursor: pointer;
}
.unmute:hover { border-color: var(--accent); color: var(--accent); }

.pitch { padding: 52px var(--space-7) 0; display: flex; flex-direction: column; gap: var(--space-3); }
.pitch h1 { font-size: 46px; }
.pitch p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--muted); max-width: 300px; }
.cta-wrap { padding: var(--space-6) var(--space-5) 30px; }
.cta { display: block; text-align: center; text-decoration: none; }

.examples { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-1); }
.examples .eyebrow { padding: 0 var(--space-7); }
.rail { display: flex; gap: var(--space-3); overflow-x: auto; padding: 0 var(--space-7) 4px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.ex {
  flex: none; width: 200px; background: var(--card); border-radius: var(--radius-card); padding: var(--space-4);
  display: flex; gap: var(--space-3); align-items: center; box-shadow: var(--shadow-card);
}
.ex-icon {
  width: 52px; height: 52px; flex: none; border-radius: var(--radius-sm);
  background: var(--peach); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
}
.ex b { display: block; font-family: var(--display); font-size: 15px; font-weight: 700; line-height: 1.15; }
.ex small { font-size: 12px; color: #8C817A; }

.steps { padding: var(--space-8) var(--space-7) 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.steps b { display: block; margin-top: var(--space-2); font-family: var(--display); font-size: 14px; font-weight: 700; line-height: 1.2; }
.steps p { margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }

footer {
  margin-top: var(--space-9); padding: var(--space-6) var(--space-7) 34px; border-top: 1px solid var(--line);
  display: flex; gap: 18px; font-size: 13px; color: var(--quiet);
}
footer .copy { margin-left: auto; }

@media (min-width: 900px) {
  .wrap { max-width: 1040px; }
  .hero {
    display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
    padding: 0 48px 64px; border-radius: 0 0 40px 40px;
  }
  .hero-bar { grid-column: 1 / -1; padding: 28px 0 0; }
  .hero-art { height: 420px; margin: 0; }
  .player { left: 48px; right: auto; width: calc(50% - 72px); bottom: 24px; }
  .pitch { padding: 0; }
  .pitch h1 { font-size: 64px; }
  .cta-wrap { padding: 28px 0 0; }
  .cta { width: auto; display: inline-block; padding: 22px 40px; }
  .rail { padding: 0 48px 4px; }
  .examples .eyebrow, .steps, footer { padding-left: 48px; padding-right: 48px; }
}

/* ---- dog song creation form ---- */

.wizard-h2 { font-size: 38px; margin-top: var(--space-8); margin-bottom: var(--space-1); }
.wizard-body { padding: 0 var(--space-7) var(--space-8); display: flex; flex-direction: column; gap: var(--space-6); }
.name-input {
  border: 2px solid var(--line); border-radius: var(--radius-input); background: #fff;
  padding: var(--space-5); font-family: var(--display); font-size: 26px; font-weight: 700;
  color: var(--ink); width: 100%; margin-top: var(--space-2);
}
.name-input:focus { outline: none; border-color: var(--accent); }
.field-hint { font-size: 13px; color: #8C817A; padding-left: 4px; margin-top: var(--space-2); }
.wizard-footer { padding: var(--space-5) var(--space-5) 30px; display: flex; flex-direction: column; gap: var(--space-2); }
.wizard-fineprint { text-align: center; font-size: 12px; color: var(--quiet); }

/* Plain, not-yet-restyled pages (status/tombstone/already-used): a simple
   readable column, distinct from the landing page's full-bleed `.wrap`. */
.page { max-width: 480px; margin: 0 auto; padding: var(--space-9) var(--space-7) var(--space-10); }

/* These pages are short (a heading, a line or two, a button), so without an
   explicit rhythm the global `h1 { margin: 0 }` and the tight display
   line-height leave everything stacked flush against itself. */
.page h1 { font-size: 34px; line-height: 1.05; margin-bottom: var(--space-5); }
.page h2 { font-size: 22px; line-height: 1.1; margin-top: var(--space-8); margin-bottom: var(--space-3); }
.page p { margin: 0 0 var(--space-4); line-height: 1.5; }
.page p:last-child { margin-bottom: 0; }
.page ul { margin: 0 0 var(--space-4); line-height: 1.5; }
/* An `<a class="btn-primary">` is inline by default, so the class's own
   `width: 100%` does nothing and the CTA shrink-wraps its label. */
.page a.btn-primary { display: block; text-align: center; text-decoration: none; margin-bottom: var(--space-3); }
.page .btn-primary { margin-top: var(--space-5); }
/* Whatever follows a form (a "use a different email" escape hatch, fine
   print) shouldn't sit flush against the submit button. */
.page form + p { margin-top: var(--space-5); }

@media (min-width: 900px) {
  .page { padding-top: var(--space-10); padding-bottom: 64px; }
  .page h1 { font-size: 42px; }
}
audio { width: 100%; margin-top: var(--space-5); }
.btn {
  display: inline-block; margin-top: var(--space-5); margin-right: var(--space-2);
  padding: .75rem 1.25rem; background: var(--ink); color: #fff; border: none;
  border-radius: var(--radius-card); font-size: 1rem; cursor: pointer;
  text-decoration: none; font-family: var(--body);
}
.btn:hover { background: #000; }

.btn:disabled, .btn-primary:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.btn:disabled:hover, .btn-primary:disabled:hover {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* Lyrics block (``song-generation``: paid-only content, rendered server-side
   into ``song_status.html``). ``<pre>`` keeps the lyric's own section tags
   (``[Verse]``/``[Chorus]``) and blank-line section breaks intact; the
   ``user-select`` override makes sure the text stays selectable even when
   ancestors (e.g. the wizard's text-selection CSS) would otherwise disable
   it. */
.lyrics { margin-top: var(--space-6); }
.lyrics h2 { font-size: 1rem; margin: 0 0 var(--space-3); color: var(--ink); }
.lyrics-pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
  margin: 0;
  user-select: text; -webkit-user-select: text;
}

/* ---- admin console shell ---- */

/* Mobile-first, matching the site's existing 900px breakpoint: below it the
   sidebar stacks above the content as an ordinary nav row (the presentation
   the admin pages had before the shell existed); at and above it the shell
   becomes a two-column grid with a ~1/5 width sidebar rail. */
.admin-shell { padding: var(--space-7); }
.admin-sidebar { margin-bottom: var(--space-6); }
.admin-nav {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5);
}
.admin-nav-link { color: var(--ink); text-decoration: none; }
.admin-nav-link:hover { text-decoration: underline; }
.admin-nav-link.is-active { font-weight: 600; color: var(--accent-dark); }
.admin-nav-action { margin: 0; }
.admin-nav-action .btn { margin-top: var(--space-4); }
.admin-content { min-width: 0; }

@media (min-width: 900px) {
  .admin-shell {
    display: grid; grid-template-columns: minmax(180px, 1fr) 4fr;
    gap: var(--space-9); align-items: start;
    max-width: 1400px; margin: 0 auto;
  }
  .admin-sidebar { position: sticky; top: var(--space-7); margin-bottom: 0; }
  .admin-nav { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .admin-nav-link {
    display: block; padding: var(--space-3) var(--space-4);
    border-left: 3px solid transparent; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }
  .admin-nav-link:hover { background: #FBF7F1; text-decoration: none; }
  .admin-nav-link.is-active { border-left-color: var(--accent); background: #FBF7F1; }
}
