/* Faithful Song Maker web: tokens mirror song-maker-app/constants/theme.ts */
:root {
  --bg: #F7F1E6;
  --bg-alt: #F1E8D8;
  --surface: #FFFCF6;
  --surface-muted: #F3ECDF;

  --ink: #1B2540;
  --ink-muted: #44507A;
  --ink-deep: #0F1628;
  --ink-soft: rgba(27, 37, 64, 0.07);
  --ink-gradient: linear-gradient(135deg, #1B2540, #0F1628);

  --gold: #B8923E;
  --gold-light: #D9BC7A;
  --gold-dark: #8F6F28;
  --gold-soft: rgba(184, 146, 62, 0.12);
  --gold-gradient: linear-gradient(135deg, #D6B46E, #B08A3A);

  --text: #1B2540;
  --text-secondary: #5B6275;
  --text-muted: #9097A6;
  --text-on-ink: #FFFCF6;
  --text-on-ink-muted: rgba(255, 252, 246, 0.66);

  --border: rgba(27, 37, 64, 0.09);
  --border-strong: rgba(27, 37, 64, 0.16);
  --rule: rgba(27, 37, 64, 0.07);
  --margin-line: rgba(184, 146, 62, 0.28);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 12px 28px rgba(27, 37, 64, 0.08);
  --shadow-soft: 0 4px 12px rgba(27, 37, 64, 0.05);
  --shadow-button: 0 8px 20px rgba(143, 111, 40, 0.3);
  --shadow-lift: 0 30px 60px -20px rgba(15, 22, 40, 0.35);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 40%, var(--bg-alt) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.section { padding: 96px 0; }
.section__head { max-width: 620px; margin: 0 auto 56px; text-align: center; }
.section__head h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; margin-top: 12px; }
.section__head p { margin-top: 14px; font-size: 18px; color: var(--text-secondary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border: 0;
  border-radius: 999px;
  font: 600 16px/1 var(--sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--gold { background: var(--gold-gradient); color: var(--ink); box-shadow: var(--shadow-button); }
.btn--ink { background: var(--ink); color: var(--text-on-ink); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-strong); }
.btn--ghost:hover { background: var(--ink-soft); }

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 252, 246, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.brand em { font-style: italic; font-weight: 400; color: var(--gold-dark); margin-left: 6px; }
.brand--small span { font-size: 17px; }

.site-footer { border-top: 1px solid var(--border); padding: 36px 0; background: var(--surface); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.site-footer__links { display: flex; gap: 24px; }
.site-footer__links a, .site-footer__legal { font-size: 14px; color: var(--text-secondary); text-decoration: none; }
.site-footer__links a:hover { color: var(--ink); }

/* ---------- Store buttons ---------- */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 16px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--text-on-ink);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, background .15s ease;
}
.store-btn:hover { transform: translateY(-2px); background: var(--ink-deep); }
.store-btn svg { width: 24px; height: 24px; }
.store-btn span { display: flex; flex-direction: column; font-weight: 600; font-size: 17px; line-height: 1.1; }
.store-btn small { font-size: 11px; font-weight: 500; opacity: .75; }
.store-buttons--on-dark .store-btn { background: var(--surface); color: var(--ink); }
.store-buttons--on-dark .store-btn:hover { background: #fff; }
.store-soon {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px dashed var(--margin-line);
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 600;
}
.store-buttons--on-dark .store-soon { color: var(--gold-light); border-color: rgba(217, 188, 122, .4); }

/* ---------- Song cover (mirrors app SongCover) ---------- */
.cover {
  --size: 52px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: calc(var(--size) * 0.22);
  background: var(--ink-gradient);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.cover__ring {
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  border: 1px solid rgba(214, 180, 110, 0.35);
}
.cover__initial { font-family: var(--serif); font-weight: 500; font-size: calc(var(--size) * 0.46); line-height: 1; color: var(--gold-light); }
.cover--sm { --size: 44px; }
.cover--lg { --size: 232px; box-shadow: var(--shadow-lift); }

/* ---------- Landing: hero ---------- */
.hero { position: relative; padding: 72px 0 96px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 180, 110, 0.28), transparent 65%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 56px; }
.hero__mark { width: 64px; height: 64px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(42px, 6vw, 68px); line-height: 1.04; letter-spacing: -0.03em; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--gold-dark); }
.hero__lede { margin: 22px 0 32px; max-width: 520px; font-size: 19px; color: var(--text-secondary); }
.hero__note { margin-top: 18px; font-size: 14px; color: var(--text-muted); }

/* CSS phone mockup of the app's Write screen */
.phone {
  position: relative;
  justify-self: center;
  width: 320px;
  padding: 12px;
  border-radius: 48px;
  background: var(--ink-deep);
  box-shadow: var(--shadow-lift), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  text-align: left;
  transform: rotate(2deg);
}
.phone__screen {
  position: relative;
  border-radius: 38px;
  padding: 44px 20px 22px;
  background: linear-gradient(180deg, var(--surface), var(--bg));
  overflow: hidden;
}
.phone__notch { position: absolute; top: 12px; left: 50%; width: 92px; height: 24px; margin-left: -46px; border-radius: 999px; background: var(--ink-deep); }
.phone__top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.phone__top img { width: 30px; height: 30px; border-radius: 8px; }
.phone__top span { font-family: var(--serif); font-weight: 600; font-size: 16px; }
.phone h3 { font-size: 22px; line-height: 1.2; margin-bottom: 12px; }
.journal {
  position: relative;
  padding: 2px 14px 2px 26px;
  border-radius: var(--radius-md);
  background: var(--surface) repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px);
  border: 1px solid var(--border);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 28px;
  color: var(--ink);
}
.journal::before { content: ""; position: absolute; top: 0; bottom: 0; left: 16px; width: 1px; background: var(--margin-line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.chip { padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--ink-soft); color: var(--ink-muted); }
.chip--active { background: var(--ink); color: var(--gold-light); }
.phone__cta { width: 100%; padding: 13px; font-size: 14px; }

.mini-song {
  position: absolute;
  left: -72px;
  bottom: -44px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 270px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transform: rotate(-4deg);
  animation: float 6s ease-in-out infinite;
}
.mini-song__text { flex: 1; min-width: 0; }
.mini-song__text strong, .mini-song__text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-song__text strong { font-family: var(--serif); font-weight: 500; font-size: 15px; }
.mini-song__text small { font-size: 12px; color: var(--text-secondary); }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.eq i { width: 3px; border-radius: 2px; background: var(--gold); animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
.eq i:nth-child(4) { animation-delay: -.9s; }

@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@keyframes float { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-8px); } }

/* ---------- Landing: steps & features ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding: 32px 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.step__num { font-family: var(--serif); font-style: italic; font-size: 44px; line-height: 1; color: var(--gold); }
.step h3, .feature h3 { font-size: 22px; margin: 16px 0 8px; }
.step p, .feature p { color: var(--text-secondary); }

.features { background: var(--surface-muted); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { padding: 32px 28px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.feature__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--gold-gradient); color: var(--ink); box-shadow: var(--shadow-button); }
.feature__icon svg { width: 24px; height: 24px; }

/* ---------- Landing: testimonial & CTA ---------- */
.testimonial { position: relative; padding: 110px 0; background: var(--ink-gradient); color: var(--text-on-ink); text-align: center; overflow: hidden; }
.testimonial__mark { position: absolute; right: -60px; bottom: -80px; width: 360px; opacity: .07; }
.testimonial blockquote { position: relative; max-width: 780px; margin: 0 auto; font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px); line-height: 1.3; font-style: italic; }
.testimonial blockquote::before { content: "\201C"; display: block; font-size: 80px; line-height: .6; color: var(--gold); margin-bottom: 18px; font-style: normal; }
.testimonial cite { display: block; margin-top: 24px; font: 600 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); font-style: normal; }

.cta-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 40px;
  padding: 56px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.cta-card__icon { width: 140px; height: 140px; border-radius: 36px; box-shadow: var(--shadow-lift); }
.cta-card h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; }
.cta-card p { margin: 12px 0 26px; font-size: 18px; color: var(--text-secondary); }

/* ---------- Player ---------- */
.player-page { padding: 56px 0 80px; }
.player-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 44px 40px 36px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.player-card .cover { margin: 0 auto 32px; }
.player-card .cover__mark { position: absolute; bottom: 16px; width: 30px; opacity: .9; }
.player-card .eyebrow {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.player-card h1 { margin-top: 10px; font-size: clamp(30px, 5vw, 40px); line-height: 1.12; }
.player-card__byline { margin-top: 10px; font-size: 14px; color: var(--text-muted); }

.player { display: flex; align-items: center; gap: 18px; margin: 32px 0 8px; text-align: left; }
.play-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--ink);
  box-shadow: var(--shadow-button);
  cursor: pointer;
  transition: transform .15s ease;
}
.play-btn:hover { transform: scale(1.04); }
.play-btn svg { width: 28px; height: 28px; }
.play-btn .icon-pause, .play-btn.is-playing .icon-play { display: none; }
.play-btn.is-playing .icon-pause { display: block; }
.play-btn.is-loading { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }

.player__track { flex: 1; min-width: 0; }
.seek {
  --pct: 0%;
  width: 100%;
  height: 6px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) var(--pct), var(--ink-soft) var(--pct));
  cursor: pointer;
}
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: var(--shadow-soft); }
.seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); }
.player__times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.player-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

.lyrics { margin-top: 28px; border-top: 1px solid var(--border); text-align: left; }
.lyrics__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 0 4px;
  border: 0;
  background: none;
  font: 600 13px var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  cursor: pointer;
}
.lyrics__toggle svg { width: 18px; height: 18px; transition: transform .2s ease; }
.lyrics__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.lyrics__body { padding-top: 14px; font-family: var(--serif); font-size: 18px; line-height: 1.7; white-space: pre-line; color: var(--ink); }

.made-with {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--ink-gradient);
  color: var(--text-on-ink);
  text-align: center;
}
.made-with img { width: 48px; margin: 0 auto 12px; }
.made-with h2 { font-size: 24px; }
.made-with p { margin: 8px 0 20px; color: var(--text-on-ink-muted); }
.made-with .store-buttons { justify-content: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--text-on-ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  transform: translateX(-50%);
  display: none;
}

/* ---------- Unavailable ---------- */
.empty-state { max-width: 520px; margin: 0 auto; padding: 96px 24px; text-align: center; }
.empty-state img { width: 88px; margin: 0 auto 24px; }
.empty-state h1 { font-size: 36px; line-height: 1.15; }
.empty-state p { margin: 14px 0 28px; font-size: 18px; color: var(--text-secondary); }
.empty-state .store-buttons { justify-content: center; margin-top: 16px; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; padding-top: 64px; padding-bottom: 96px; color: var(--text-secondary); }
.legal h1, .legal h2, .legal h3, .legal strong { color: var(--ink); }
.legal h1 { margin-top: 10px; font-size: clamp(36px, 5vw, 48px); line-height: 1.1; }
.legal__updated { margin-top: 10px; font-size: 14px; color: var(--text-muted); }
.legal h2 { margin: 40px 0 12px; font-size: 24px; }
.legal h3 { margin: 24px 0 8px; font: 600 16px var(--sans); letter-spacing: 0; }
.legal p, .legal li { font-size: 16px; line-height: 1.7; }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0 0; padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal strong { font-weight: 600; }
.legal a { color: var(--gold-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding-top: 48px; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__mark { margin-left: auto; margin-right: auto; }
  .hero__lede { margin-left: auto; margin-right: auto; }
  .hero .store-buttons { justify-content: center; }
  .phone { margin-top: 24px; }
  .mini-song { left: -24px; }
  .steps, .feature-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .cta-card { grid-template-columns: 1fr; text-align: center; padding: 40px 24px; }
  .cta-card__icon { margin: 0 auto; }
  .cta-card .store-buttons { justify-content: center; }
}
@media (max-width: 560px) {
  .section { padding: 72px 0; }
  .brand em { display: none; }
  .phone { width: 290px; }
  .mini-song { width: 240px; left: -10px; }
  .player-card { padding: 32px 22px 26px; }
  .cover--lg { --size: 200px; }
  .site-footer__inner { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
