/*
 * Songs by RoraLabs. Scene: someone on the sofa at 9pm, phone in hand, realising the birthday is
 * tomorrow and wanting something that will make a person laugh or well up. Light theme, warm,
 * playful, one committed colour (marigold) with plum ink and a berry call to action.
 * No third-party fonts: system rounded display + system text.
 */
:root {
  --ink: oklch(0.27 0.06 320);
  --ink-soft: oklch(0.42 0.05 320);
  --muted: oklch(0.52 0.03 320);
  --paper: oklch(0.985 0.006 320);
  --paper-2: oklch(0.955 0.012 320);
  --sun: oklch(0.87 0.14 86);
  --sun-deep: oklch(0.79 0.155 72);
  --sun-pale: oklch(0.95 0.06 90);
  --berry: oklch(0.55 0.2 12);
  --berry-deep: oklch(0.47 0.19 12);
  --mint: oklch(0.9 0.06 165);
  --sky: oklch(0.88 0.06 240);
  --rose: oklch(0.9 0.06 10);
  --line: oklch(0.86 0.02 320);
  --ok: oklch(0.55 0.13 150);
  --warn: oklch(0.62 0.14 60);
  --bad: oklch(0.55 0.19 25);
  --radius: 18px;
  --radius-sm: 10px;
  --display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--text); color: var(--ink); background: var(--paper);
  font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--berry-deep); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 750; }
p { margin: 0 0 1em; max-width: 68ch; }
.hidden { display: none !important; }
.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(640px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: inline-flex; gap: 0.5rem; align-items: center; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--ink) 0 18%, var(--sun) 19% 30%, var(--ink) 31% 100%); }
.top nav a { margin-left: 1rem; color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border: 0; cursor: pointer;
  font: 700 1.05rem/1 var(--display); padding: 1rem 1.5rem; border-radius: 999px; text-decoration: none;
  background: var(--berry); color: var(--paper); transition: transform 0.2s var(--ease), background 0.2s var(--ease); min-height: 52px;
}
.btn:hover { background: var(--berry-deep); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.small { font-size: 0.92rem; padding: 0.65rem 1rem; min-height: 40px; }
.btn.block { width: 100%; }
.linkish { background: none; border: 0; color: var(--berry-deep); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border-radius: 999px;
  background: var(--sun-pale); font-size: 0.9rem; font-weight: 600;
}
.chip.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.chip.slow::before { background: var(--warn); }
.chip.offline::before, .chip.busy::before { background: var(--bad); }

/* ---------- hero ---------- */
.hero { background: var(--sun); padding: 1rem 0 3.5rem; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: repeating-radial-gradient(circle, oklch(0.27 0.06 320 / 0.07) 0 2px, transparent 3px 9px);
  pointer-events: none;
}
.hero h1 { max-width: 15ch; }
.hero .lede { font-size: 1.2rem; max-width: 34ch; color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1.5rem 0 1rem; }
.price-tag { font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
.price-tag small { font-weight: 500; font-size: 0.85rem; color: var(--ink-soft); display: block; }

/* ---------- sample "records" ---------- */
.records { display: flex; gap: 1rem; overflow-x: auto; padding: 0.5rem 0 1rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.record { flex: 0 0 auto; width: 148px; scroll-snap-align: start; text-align: center; background: none; border: 0; cursor: pointer; color: inherit; font: inherit; padding: 0; }
.disc {
  width: 132px; height: 132px; margin: 0 auto 0.6rem; border-radius: 50%; position: relative;
  background: repeating-radial-gradient(circle, oklch(0.24 0.03 320) 0 2px, oklch(0.3 0.04 320) 3px 4px);
  box-shadow: 0 10px 24px oklch(0.27 0.06 320 / 0.22); transition: transform 0.4s var(--ease);
}
.disc::before { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: var(--label, var(--rose)); }
.disc::after { content: ""; position: absolute; inset: 47%; border-radius: 50%; background: var(--paper); }
.record:hover .disc { transform: translateY(-3px); }
.record.playing .disc { animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .record.playing .disc { animation: none; } }
.record b { display: block; font-family: var(--display); }
.record span { font-size: 0.85rem; color: var(--muted); }
.record .state { font-size: 0.78rem; font-weight: 700; color: var(--berry-deep); min-height: 1.2em; }
.l-rose { --label: var(--rose); } .l-mint { --label: var(--mint); } .l-sky { --label: var(--sky); } .l-sun { --label: var(--sun); } .l-berry { --label: oklch(0.75 0.13 12); }

/* ---------- sections ---------- */
section { padding: 3rem 0; }
.steps { counter-reset: s; display: grid; gap: 1.5rem; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; }
.steps li::before {
  content: counter(s); font: 800 1.3rem/3rem var(--display); width: 3rem; height: 3rem; border-radius: 50%; text-align: center;
  background: var(--ink); color: var(--sun);
}
.split { display: grid; gap: 2rem; }
@media (min-width: 820px) { .split { grid-template-columns: 1.1fr 0.9fr; align-items: center; } .steps { grid-template-columns: repeat(3, 1fr); } .steps li { grid-template-columns: 1fr; } }
.band { background: var(--paper-2); }
.ink-band { background: var(--ink); color: var(--paper); }
.ink-band a { color: var(--sun); }
.faq details { border-top: 1px solid var(--line); padding: 1rem 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.footer { padding: 2.5rem 0 3rem; font-size: 0.9rem; color: var(--muted); }
.footer a { color: var(--ink-soft); margin-right: 1rem; }

/* ---------- wizard ---------- */
.wizard { padding-bottom: 6rem; }
.track { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin: 0.5rem 0 1.5rem; }
.track i { display: block; height: 100%; width: 0; background: var(--berry); transition: width 0.4s var(--ease); }
.step-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; min-width: 0; }
legend, .label { font-weight: 700; margin-bottom: 0.6rem; display: block; font-size: 1.02rem; }
.hint { font-size: 0.88rem; color: var(--muted); margin-top: 0.35rem; }
input[type=text], input[type=email], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem; transition: border-color 0.2s var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
.tiles { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile span {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.7rem 1rem; border-radius: 999px; border: 2px solid var(--line);
  font-weight: 600; background: var(--paper); transition: all 0.15s var(--ease); min-height: 46px;
}
.tile input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tile input:focus-visible + span { outline: 3px solid var(--berry); outline-offset: 2px; }
.tile input:disabled + span { opacity: 0.4; }
.tiles.fun .tile span { background: var(--sun-pale); border-color: var(--sun-deep); }
.tiles.fun .tile input:checked + span { background: var(--berry); border-color: var(--berry); color: var(--paper); }
.genre-tile span button { background: none; border: 0; padding: 0 0 0 0.2rem; cursor: pointer; color: inherit; font-size: 0.9rem; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 0.7rem; align-items: start; margin: 0.8rem 0; font-size: 0.95rem; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }
.counter { font-size: 0.82rem; color: var(--muted); text-align: right; }
.counter.over { color: var(--bad); font-weight: 700; }
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; background: oklch(0.985 0.006 320 / 0.96); border-top: 1px solid var(--line);
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
}
.navbar .narrow { display: flex; gap: 0.75rem; justify-content: space-between; align-items: center; }
.mode-switch { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; margin-bottom: 1rem; }
.mode-switch button { border: 0; background: none; padding: 0.5rem 1rem; border-radius: 999px; font: 600 0.92rem var(--text); cursor: pointer; color: var(--ink-soft); }
.mode-switch button[aria-pressed=true] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px oklch(0.27 0.06 320 / 0.12); }
.error-box { background: oklch(0.95 0.04 25); color: var(--bad); padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0; font-weight: 600; }
.note { background: var(--sun-pale); padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0; }
.banner { background: var(--ink); color: var(--sun); padding: 0.7rem 0; font-weight: 600; font-size: 0.95rem; text-align: center; }

/* ---------- order page ---------- */
.order-head { padding: 1.5rem 0 0.5rem; }
.status-pill { display: inline-block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }
.panel.sunny { background: var(--sun-pale); border-color: var(--sun-deep); }
.code-input { font: 800 1.8rem/1 var(--display); letter-spacing: 0.4em; text-align: center; max-width: 240px; }
.section-ed { margin: 0 0 1rem; }
.section-ed .label { text-transform: capitalize; font-size: 0.9rem; color: var(--ink-soft); }
.section-ed textarea { min-height: 0; font-size: 1rem; line-height: 1.6; }
.issues { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.9rem; }
.issues li.error { color: var(--bad); font-weight: 600; }
.issues li.warn { color: var(--warn); }
.chips-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.lyrics-view { white-space: pre-line; font-size: 1.02rem; line-height: 1.7; }
.lyrics-view .tag { display: block; font-weight: 700; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1em; }
.lyrics-view mark { background: var(--sun); color: inherit; border-radius: 4px; padding: 0 2px; }
.making { text-align: center; padding: 2.5rem 1rem; }
.making .disc { width: 160px; height: 160px; animation: spin 3.2s linear infinite; --label: var(--sun); }
.player { display: grid; gap: 0.5rem; margin: 1rem 0; }
.player audio { width: 100%; }
.version { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.version-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }
.danger-zone { border-top: 2px dashed var(--line); margin-top: 2rem; padding-top: 1rem; }
.qa { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.qa button { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer; font: 600 0.88rem var(--text); color: var(--ink); }
.qa button[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- admin ---------- */
.admin table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin th, .admin td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin pre { white-space: pre-wrap; word-break: break-word; background: var(--paper-2); padding: 0.75rem; border-radius: var(--radius-sm); font-size: 0.82rem; max-height: 420px; overflow: auto; }
.admin .grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .admin .grid { grid-template-columns: 1fr 1fr; } }

/* ---------- legal ---------- */
.draft-flag { background: var(--bad); color: var(--paper); padding: 0.6rem 1rem; font-weight: 700; text-align: center; }
.legal h2 { margin-top: 1.6em; font-size: 1.3rem; }

/* ---------- print (lyric sheet) ---------- */
@media print {
  .no-print, .top, .footer, .navbar { display: none !important; }
  body { background: white; color: black; font-size: 14pt; }
  .sheet { border: 0; }
}
.sheet { padding: 2rem; border: 2px solid var(--line); border-radius: var(--radius); margin: 2rem auto; max-width: 640px; text-align: center; }
.sheet h1 { font-size: 2rem; }
