/* ============================================================
   Clefly landing: design tokens mirror the app's CleflyTokens
   ============================================================ */

:root {
  --cream: #FAF6F0;
  --paper: #FFF8F2;
  --sunken: #F2EDE6;
  --ink: #2C1A0E;
  --muted: #7A5C48;
  --faint: #B89880;
  --terra: #C4622D;
  --terra-deep: #8C3D16;
  --terra-tint: #F0D5C4;
  --gold: #D4A017;
  --line: #E8DDD4;
  --green: #3A7D44;

  --font-display: "Fredoka", "Avenir Next Rounded", -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-music: "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif;

  --max: 1060px;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--terra-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terra); }

:focus-visible {
  outline: 3px solid var(--terra);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Type scale ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 0 0 14px;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 34em;
}

/* ---------- Chunky game button (mirrors the app's GameButtonStyle) ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  background: var(--terra);
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--terra-deep);
  transition: transform 90ms ease, box-shadow 90ms ease;
  cursor: pointer;
}
.btn:hover { color: #fff; filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--terra-deep); }

.btn-quiet {
  background: #fff;
  color: var(--terra-deep);
  box-shadow: 0 5px 0 var(--line), inset 0 0 0 2px var(--line);
}
.btn-quiet:hover { color: var(--terra); }
.btn-quiet:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line), inset 0 0 0 2px var(--line); }

.cta-note {
  font-size: 0.9rem;
  color: var(--faint);
  margin-top: 14px;
}

/* ---------- Header ---------- */

.site-header {
  padding: 22px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark .mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--terra);
  color: #fff;
  font-family: var(--font-music);
  font-size: 24px;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--terra-deep);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-nav a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--terra-deep); }
.site-nav .btn { padding: 10px 20px; font-size: 0.95rem; }

@media (max-width: 640px) {
  .site-nav a:not(.btn) { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 24px;
  text-align: center;
}
.hero .lede { margin: 22px auto 0; }
.hero-cta { margin-top: 34px; }

/* ---------- Interactive staff ---------- */

.staff-demo {
  max-width: 780px;
  margin: 30px auto 0;
  padding: 0 8px;
}

.staff-demo svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.staff-note { cursor: pointer; }
.staff-note .hit { fill: transparent; }
/* transform-box only on the outer head: applying it to the inner "hole"
   ellipse re-anchors its rotate() attribute and flings it off the note */
.staff-note .head-outer { transition: transform 120ms ease; transform-origin: center; transform-box: fill-box; }
.staff-note:hover .head-outer,
.staff-note:focus-visible .head-outer { transform: scale(1.12); }

.staff-note .note-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  fill: var(--terra);
  opacity: 0;
  transition: opacity 260ms ease, transform 260ms ease;
  transform: translateY(8px);
}
.staff-note.revealed .note-label {
  opacity: 1;
  transform: translateY(0);
}
.staff-note.revealed .head-outer { fill: var(--terra); }

.staff-hint {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 10px;
  min-height: 1.6em;
}
.staff-hint strong { color: var(--terra-deep); }

/* entry animation */
@media (prefers-reduced-motion: no-preference) {
  .staff-note { opacity: 0; animation: note-in 500ms ease forwards; }
  .staff-note:nth-of-type(1) { animation-delay: 250ms; }
  .staff-note:nth-of-type(2) { animation-delay: 400ms; }
  .staff-note:nth-of-type(3) { animation-delay: 550ms; }
  .staff-note:nth-of-type(4) { animation-delay: 700ms; }
  @keyframes note-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- Staff divider (5 hairlines + a note) ---------- */

.staff-divider {
  max-width: var(--max);
  margin: 72px auto;
  padding: 0 24px;
}
.staff-divider svg { width: 100%; height: 26px; }

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

.section { padding: 8px 0 40px; }

.manifesto {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0;
  text-align: center;
}
.manifesto p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.35;
  max-width: 24em;
  margin: 0 auto;
}
.manifesto em {
  font-style: normal;
  color: var(--gold);
}

.section-head { max-width: 620px; margin-bottom: 40px; }
.section-head .lede { margin-top: 14px; }

/* ---------- Pillar cards ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.card .glyph {
  font-family: var(--font-music);
  font-size: 34px;
  line-height: 1;
  color: var(--terra);
  margin-bottom: 18px;
}
.card h3 { margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ---------- Guitar split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
}

.clef-poster {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 20px 28px;
  text-align: center;
  margin: 0;
}
.clef-poster svg {
  width: min(300px, 100%);
  height: auto;
  margin: 0 auto;
}
.clef-poster figcaption {
  font-size: 0.9rem;
  color: var(--faint);
  margin-top: 16px;
}

/* ---------- Path / loop ---------- */

.path-steps {
  counter-reset: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 32px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}
@media (max-width: 720px) {
  .path-steps { grid-template-columns: 1fr; }
}
.path-steps li {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.path-steps .tier {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--terra);
  background: var(--terra-tint);
  border-radius: 8px;
  padding: 3px 9px;
  white-space: nowrap;
}
.path-steps p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.path-steps strong { color: var(--ink); }

/* ---------- FAQ ---------- */

.faq { max-width: 720px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq summary {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.08rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  color: var(--terra);
  font-size: 1.4rem;
  flex-shrink: 0;
}
.faq details[open] summary::after { content: "\2212"; } /* minus sign */
.faq details p { color: var(--muted); margin: 12px 0 0; max-width: 38em; }

/* ---------- Final CTA ---------- */

.final-cta {
  text-align: center;
  padding: 80px 0 96px;
}
.final-cta h2 { margin-bottom: 12px; }
.final-cta .lede { margin: 0 auto 32px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 0.92rem;
  color: var(--faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.site-footer nav { display: flex; gap: 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--terra-deep); text-decoration: underline; }

/* ---------- Legal / document pages ---------- */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}
.doc h1 { font-size: clamp(2rem, 5vw, 2.7rem); }
.doc .doc-date { color: var(--faint); font-size: 0.92rem; margin: 12px 0 0; }
.doc h2 { font-size: 1.35rem; margin: 44px 0 12px; }
.doc p, .doc li { color: var(--muted); }
.doc ul { padding-left: 22px; }
.doc .doc-intro { font-size: 1.1rem; color: var(--ink); }
