/* Noodle: Piano Improv. The app's own tokens (KeystoneKit NoodleDesign),
 * light and dark. Piano keys are fixed in both modes, as in the app. */

:root {
  --bg: #EDF0F3;
  --surface: #FFFFFF;
  --muted: #F3F5F8;
  --ink: #14202B;
  --ink2: #5B6876;
  --line: #C9D2DD;
  --tint: #EEF2FD;
  --chord: #2350D6;
  --tension: #C75A12;
  --bluet: #7A3FC4;
  --emph: #14202B;
  --on-emph: #FFFFFF;
  --panel: #FBE6D2;
  --gold: #F2B544;
  --coat: #C9844A;
  --shadow: 0 18px 50px rgba(20, 32, 43, 0.12);

  --key-white: #F7F8FA;
  --key-edge: #C9D2DD;
  --key-black: #14202B;
  --key-label: #5B6876;

  --radius: 28px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F141A;
    --surface: #19212B;
    --muted: #232D39;
    --ink: #E9EEF3;
    --ink2: #9AA7B4;
    --line: #34414F;
    --tint: #1E2B4D;
    --chord: #5C82F2;
    --tension: #E88542;
    --bluet: #A97CEB;
    --emph: #E9EEF3;
    --on-emph: #14202B;
    --panel: #251D17;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--chord); text-underline-offset: 3px; }
em { font-style: normal; color: var(--chord); }
.nowrap { white-space: nowrap; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.04; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--chord);
  background: color-mix(in srgb, var(--chord) 12%, transparent);
  padding: 7px 14px; border-radius: 999px;
}
.kicker-tension { color: var(--tension); background: color-mix(in srgb, var(--tension) 13%, transparent); }
.kicker-blue { color: var(--bluet); background: color-mix(in srgb, var(--bluet) 13%, transparent); }

.pill {
  font-size: 14px; font-weight: 700;
  padding: 8px 16px; border-radius: 999px;
  background: var(--emph); color: var(--on-emph);
  white-space: nowrap;
}

/* ── Nav ───────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 900; font-size: 26px; letter-spacing: -0.04em;
}
.wordmark-dog { width: 64px; transition: transform .3s; }
.wordmark:hover .wordmark-dog { transform: translateX(4px) rotate(-3deg); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero { position: relative; padding: 40px 0 72px; overflow: hidden; }
.staff {
  position: absolute; inset: 70px 0 auto; height: 160px;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: .55; pointer-events: none;
  transform: skewY(-4deg);
}
.staff i { height: 2px; background: var(--line); }
.notes span {
  position: absolute; bottom: -40px; left: var(--x);
  font-size: 42px; color: var(--c); opacity: 0;
  animation: float 9s linear infinite; animation-delay: var(--d);
  pointer-events: none;
}
@keyframes float {
  0%   { transform: translateY(0) rotate(-10deg); opacity: 0; }
  10%  { opacity: .55; }
  80%  { opacity: .35; }
  100% { transform: translateY(-720px) rotate(14deg); opacity: 0; }
}

.hero-inner {
  position: relative;
  max-width: 1180px; margin: 0 auto; padding: 32px 24px 0;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center;
}
.hero h1 { font-size: clamp(54px, 8.4vw, 108px); font-weight: 900; margin: 22px 0 22px; }
.hero h1 em { display: block; }
.lede { font-size: 20px; color: var(--ink2); max-width: 520px; margin: 0 0 30px; }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--emph); color: var(--on-emph);
  padding: 10px 22px 10px 16px; border-radius: 14px;
  font-weight: 700; font-size: 20px; line-height: 1.05;
}
.store-badge svg { width: 30px; height: 30px; }
.store-badge small { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.btn-ghost { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--gold); padding-bottom: 2px; }
.btn-ghost:hover { color: var(--chord); }

.hero-dog { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 70px; }
.noodle { width: min(520px, 100%); transform-origin: 50% 90%; }
.noodle.bop { animation: bop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bop { 0% { transform: scale(1); } 40% { transform: scale(1.04, .96) translateY(4px); } 100% { transform: scale(1); } }

.bubble {
  position: absolute; top: 0; left: 50%; transform: translateX(-30%);
  max-width: 330px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 18px; line-height: 1.3;
  padding: 14px 20px; border-radius: 20px;
  box-shadow: var(--shadow);
  transition: background .25s, color .25s;
}
.bubble::after {
  content: ""; position: absolute; bottom: -9px; left: 46px;
  width: 20px; height: 20px; background: inherit;
  transform: rotate(45deg); border-radius: 0 0 5px 0;
}
.bubble.happy { background: var(--chord); color: #fff; }
.bubble.pop { animation: pop .35s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes pop { from { transform: translateX(-30%) scale(.85); } to { transform: translateX(-30%) scale(1); } }

/* ── Playground ────────────────────────────────────────────────── */
.playground {
  position: relative;
  max-width: 1180px; margin: 36px auto 0; padding: 22px 24px 18px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: calc(100% - 48px);
}
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.chips-label {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink2); margin-right: 6px;
}
.chip {
  font: inherit; font-weight: 800; font-size: 17px; cursor: pointer;
  color: var(--chord); background: var(--surface);
  border: 2px dashed color-mix(in srgb, var(--chord) 55%, transparent);
  padding: 7px 16px; border-radius: 12px;
  transition: transform .15s, background .2s, color .2s;
}
.chip:hover { transform: translateY(-2px); }
.chip.done { background: color-mix(in srgb, var(--chord) 12%, transparent); border-style: solid; border-color: transparent; }
.chip.now { background: var(--emph); color: var(--on-emph); border: 2px solid var(--emph); transform: scale(1.06); }
.arrow { color: var(--ink2); font-weight: 700; }

.piano {
  position: relative; display: flex; height: 150px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  border-radius: 10px; overflow: hidden;
}
.key-w {
  flex: 1; position: relative;
  background: var(--key-white); border: 1px solid var(--key-edge); border-top: 0;
  cursor: pointer; transition: background .08s;
}
.key-w:first-child { border-radius: 0 0 0 10px; }
.key-w:last-child { border-radius: 0 0 10px 0; }
.key-w .lbl {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--key-label);
}
.key-b {
  position: absolute; top: 0; height: 62%;
  background: var(--key-black); border-radius: 0 0 6px 6px;
  cursor: pointer; z-index: 2; transition: background .08s;
}
.key-w.on { background: #C9D6FA; }
.key-b.on { background: #2350D6; }
.key-w.on::before {
  content: ""; position: absolute; left: 50%; bottom: 30px; width: 14px; height: 14px;
  margin-left: -7px; border-radius: 50%; background: #2350D6;
}
.piano-hint { font-size: 14px; color: var(--ink2); margin: 12px 0 0; }
kbd {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  background: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; color: var(--ink);
}

/* ── Features ──────────────────────────────────────────────────── */
.features { padding: 60px 0 30px; }
.feature {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center;
  margin-bottom: 110px;
}
.feature-flip .feature-copy { order: 2; }
.feature h2 { font-size: clamp(36px, 4.6vw, 58px); font-weight: 900; margin: 18px 0 18px; }
.feature p { color: var(--ink2); font-size: 19px; margin: 0; }

.ipad {
  position: relative; margin: 0;
  background: #1A2430; padding: 14px; border-radius: 34px;
  box-shadow: var(--shadow), inset 0 0 0 2px #2C3846;
  transform: rotate(-1.2deg);
  transition: transform .4s cubic-bezier(.3, 1.4, .5, 1);
}
.feature-flip .ipad { transform: rotate(1.2deg); }
.ipad:hover { transform: rotate(0) scale(1.01); }
.ipad picture img { border-radius: 22px; }
.peek { position: absolute; width: 170px; z-index: 3; pointer-events: none; }
.peek-top { top: -76px; right: 40px; }
.peek-side { bottom: -30px; left: -60px; transform: scaleX(-1); }

/* ── Moods ─────────────────────────────────────────────────────── */
.moods { padding: 70px 0; background: var(--panel); }
.section-title { font-size: clamp(38px, 5vw, 60px); font-weight: 900; text-align: center; }
.section-sub { text-align: center; color: var(--ink2); margin: 14px auto 0; max-width: 560px; }
.mood-row {
  list-style: none; padding: 0; margin: 46px 0 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px;
}
.mood-row li {
  background: var(--surface); border-radius: 22px; padding: 18px 16px 20px;
  text-align: center; box-shadow: 0 6px 20px rgba(20, 32, 43, 0.06);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.mood-row li:hover { transform: translateY(-6px) rotate(-1.5deg); }
.mood-row li:nth-child(even):hover { transform: translateY(-6px) rotate(1.5deg); }
.mood-row li { min-width: 0; }
.mood-row img { margin: 0 auto 10px; width: 100%; }
.mood-row b { display: block; font-size: 18px; }
.mood-row span { display: block; font-size: 15px; color: var(--ink2); margin-top: 4px; line-height: 1.4; }

/* ── How ───────────────────────────────────────────────────────── */
.how { padding: 100px 0 70px; }
.steps {
  list-style: none; padding: 0; margin: 50px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  counter-reset: none;
}
.steps li {
  position: relative; background: var(--surface); border-radius: var(--radius);
  padding: 34px 28px 30px; box-shadow: 0 6px 20px rgba(20, 32, 43, 0.06);
}
.step-n {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--chord); color: #fff; font-weight: 900; font-size: 20px;
  margin-bottom: 18px;
}
.steps li:nth-child(2) .step-n { background: var(--tension); }
.steps li:nth-child(3) .step-n { background: var(--bluet); }
.steps h3 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.steps p { margin: 0; color: var(--ink2); }

/* ── FAQ ───────────────────────────────────────────────────────── */
.faq { padding: 40px 0 90px; }
.faq .section-title { margin-bottom: 36px; }
details {
  background: var(--surface); border-radius: 20px; margin-bottom: 12px;
  padding: 0 24px; box-shadow: 0 4px 14px rgba(20, 32, 43, 0.05);
}
summary {
  cursor: pointer; list-style: none; padding: 20px 0;
  font-weight: 800; font-size: 19px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "♪"; color: var(--chord); font-size: 22px; transition: transform .25s; }
details[open] summary::after { transform: rotate(-20deg) scale(1.2); color: var(--tension); }
details p { margin: 0 0 22px; color: var(--ink2); }

/* ── Finish + footer ───────────────────────────────────────────── */
.finish { text-align: center; padding: 30px 24px 100px; }
.finish img { width: 280px; margin: 0 auto 10px; animation: wag 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wag { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.finish h2 { font-size: clamp(44px, 6vw, 76px); font-weight: 900; }
.finish p { color: var(--ink2); margin: 16px 0 0; }

.foot { border-top: 1px solid var(--line); padding: 34px 0 40px; font-size: 15px; color: var(--ink2); }
.foot-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 84px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-links a, .foot-brand a { color: var(--ink2); font-weight: 600; text-decoration: none; }
.foot-links a:hover, .foot-brand a:hover { color: var(--ink); }
.foot-copy { width: 100%; font-size: 13px; }

/* ── Legal + support pages ─────────────────────────────────────── */
.doc { padding: 50px 0 90px; }
.doc-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 46px 48px 40px; box-shadow: var(--shadow);
}
.doc-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.doc-head img { width: 130px; }
.doc h1 { font-size: clamp(38px, 5vw, 56px); font-weight: 900; }
.doc .doc-date { font-family: var(--mono); font-size: 13px; color: var(--ink2); margin: 10px 0 30px; }
.doc h2 { font-size: 26px; font-weight: 800; margin: 38px 0 12px; }
.doc h3 { font-size: 20px; font-weight: 800; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--ink2); }
.doc strong { color: var(--ink); }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc code { font-family: var(--mono); font-size: 15px; background: var(--muted); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.tldr {
  background: var(--tint); border-radius: 18px; padding: 18px 22px; margin: 0 0 10px;
  color: var(--ink); font-weight: 600;
}
.tldr b { color: var(--chord); }
.doc-back { display: inline-block; margin-top: 36px; font-weight: 700; text-decoration: none; }

/* ── Release notes ─────────────────────────────────────────────── */
.release-title { margin-top: 18px; }
.release { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.release-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.release-head img { width: 110px; }
.release-head h2 { margin: 0; font-family: var(--mono); font-size: 30px; color: var(--chord); letter-spacing: -0.02em; }
.release-date { margin: 4px 0 0; font-family: var(--mono); font-size: 13px; color: var(--ink2); }
.release ul { list-style: none; padding: 0; }
.release li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.release li::before { content: "♪"; position: absolute; left: 4px; top: 0; color: var(--chord); }
.release li:nth-child(3n+2)::before { color: var(--tension); }
.release li:nth-child(3n)::before { color: var(--bluet); }

/* ── Small screens ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 10px; }
  .hero-dog { padding-top: 84px; }
  .bubble { transform: translateX(-50%); }
  @keyframes pop { from { transform: translateX(-50%) scale(.85); } to { transform: translateX(-50%) scale(1); } }
  .feature, .feature-flip { grid-template-columns: 1fr; gap: 36px; margin-bottom: 90px; }
  .feature-flip .feature-copy { order: 0; }
  .mood-row { grid-template-columns: repeat(2, 1fr); }
  .mood-row li:last-child { grid-column: span 2; }
  .steps { grid-template-columns: 1fr; }
  .peek-side { left: -16px; }
  .feature .ipad { margin-top: 40px; }
  .mood-row img { max-width: 170px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .nav-links a { display: none; }
  .wordmark { font-size: 22px; }
  .wordmark-dog { width: 50px; }
  .hero { padding-top: 16px; }
  .lede { font-size: 18px; }
  .playground { width: calc(100% - 32px); padding: 18px 14px 14px; }
  .piano { height: 120px; }
  .piano-hint { display: none; }
  .wrap, .wrap-narrow { padding: 0 16px; }
  .nav-inner, .foot-inner, .hero-inner { padding-left: 16px; padding-right: 16px; }
  .ipad { padding: 8px; border-radius: 20px; }
  .ipad picture img { border-radius: 13px; }
  .peek { width: 120px; }
  .peek-top { top: -54px; right: 20px; }
  .doc-card { padding: 30px 22px 28px; }
  .doc-head img { width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .notes { display: none; }
  html { scroll-behavior: auto; }
}
