:root {
  --bg: #17100D;
  --bg-2: #22170F;
  --glow: #5B321D;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #FBF4EC;
  --muted: #C9B8A8;
  --gold: #F2A93B;
  --gold-light: #FFC86B;
  /* Interval colours, as in the app */
  --root: #F2A93B;
  --third: #4A90F0;
  --fifth: #3FBF72;
  --radius: 22px;
  --max: 1080px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem; /* 17px at default size, scales with the reader's font setting */
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, var(--glow) 0%, transparent 60%),
    var(--bg);
  background-color: var(--bg);
  min-height: 100vh;
}

a { color: var(--gold-light); }
@media (hover: hover) { a:hover { color: var(--gold); } }

/* Press feedback: instant on pointer-down, eased on release */
a, .badge { -webkit-tap-highlight-color: transparent; transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s ease; }
a:active { opacity: 0.6; transition-duration: 0s; }
.nav .lang:active, a.badge:active { transform: scale(0.96); }

/* Keyboard focus */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
details summary:focus-visible { border-radius: 8px; }

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

/* Header: translucent layer, content scrolls under it */
.site-header {
  position: sticky; top: 0; z-index: 10;
  padding: 12px 0;
  background: rgba(23, 16, 13, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 22.5%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.nav { display: flex; align-items: center; gap: 18px; font-size: 0.9375rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
@media (hover: hover) { .nav a:hover { color: var(--text); } }
.nav .lang { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; color: var(--text); }

/* Hero */
.hero { text-align: center; padding: 56px 20px 72px; }
.hero-icon { width: 148px; height: 148px; border-radius: 22.5%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 18px 40px rgba(242, 169, 59, 0.22); }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); line-height: 1.05; margin: 28px 0 14px; letter-spacing: -0.025em; }
.hero h1 span { color: var(--gold); }
.hero p.lead { font-size: clamp(1.125rem, 2.4vw, 1.375rem); line-height: 1.45; color: var(--muted); max-width: 620px; margin: 0 auto 32px; }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg);
  border-radius: 14px; padding: 12px 22px;
  font-weight: 700; text-decoration: none;
}
@media (hover: hover) { a.badge:hover { color: var(--bg); background: #fff; } }
.badge svg { width: 22px; height: 22px; }
/* Not a link yet, so it shouldn't look pressable: a quiet label, not a button */
.badge.soon { background: none; color: var(--text); padding: 4px 0; border-radius: 0; font-weight: 600; cursor: default; }
.badge.soon svg { width: 18px; height: 18px; opacity: 0.8; }
.hero .note { display: block; margin-top: 8px; color: var(--muted); font-size: 0.875rem; letter-spacing: 0.01em; }

/* Features */
.section-title { text-align: center; font-size: clamp(1.75rem, 4vw, 2.375rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 32px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding-bottom: 80px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card .emoji { font-size: 1.875rem; line-height: 1; }
.card h3 { margin: 14px 0 6px; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); }

/* Prose pages */
.prose { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.875rem); line-height: 1.1; letter-spacing: -0.02em; margin: 16px 0 8px; }
.prose .updated { color: var(--muted); margin: 0 0 32px; }
.prose h2 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; margin: 36px 0 8px; color: var(--gold-light); }
.prose p, .prose li { line-height: 1.6; } /* long-form reading keeps a little more leading */
.prose p, .prose li { color: #E6DACE; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .card { margin: 28px 0; }

details { border-bottom: 1px solid var(--border); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; -webkit-tap-highlight-color: transparent; transition: opacity 0.2s ease; }
details summary:active { opacity: 0.6; transition-duration: 0s; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--gold); font-size: 1.375rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 0.875rem; letter-spacing: 0.01em; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .site-footer a:hover { color: var(--text); } }

@media (max-width: 560px) {
  /* Keep every destination reachable on phones: smaller brand, tighter nav */
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .nav { gap: 12px; font-size: 0.875rem; }
  .nav .lang { padding: 3px 10px; }
  .hero { padding-top: 32px; }
}
@media (max-width: 360px) {
  .brand { font-size: 0; gap: 0; } /* icon only on the narrowest screens */
}

/* ---------- Fretboard art ---------- */

/* Hero: the neck with an open C chord, and the result the app shows */
.hero-board {
  position: relative;
  max-width: 900px;
  margin: 56px auto 0;
}
.neck {
  border-radius: 18px;
  padding: 10px 0;
  overflow: hidden;
}
.board { display: block; width: 100%; height: auto; overflow: visible; }
.board text { font: 700 19px var(--font); text-anchor: middle; }
.board .dot { transform-box: fill-box; transform-origin: center; transition: transform 0.5s cubic-bezier(.3, 1.5, .5, 1), opacity 0.3s ease; }
.board .dot[data-d="1"] { transition-delay: 0.08s; }
.board .dot[data-d="2"] { transition-delay: 0.16s; }
.board .dot[data-d="3"] { transition-delay: 0.24s; }
.board .dot[data-d="4"] { transition-delay: 0.32s; }
.board .dot[data-d="5"] { transition-delay: 0.40s; }
.js .hero-board:not(.in) .dot { transform: scale(0.2); opacity: 0; }

.result {
  position: absolute;
  right: 3%; bottom: -46px;
  display: grid; justify-items: start; gap: 2px;
  min-width: 190px;
  text-align: left;
  padding: 16px 22px 18px;
  border-radius: 20px;
  background: rgba(34, 23, 15, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  transition: transform 0.7s cubic-bezier(.2, .8, .2, 1) 0.5s, opacity 0.5s ease 0.5s;
}
.js .hero-board:not(.in) .result { transform: translateY(16px); opacity: 0; }
.result .kicker { color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; }
.result strong { font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.02em; color: var(--gold); }
.result .notes { font-weight: 700; margin-top: 4px; }
.result .formula { color: var(--muted); font-size: 0.875rem; }

.legend { list-style: none; display: flex; justify-content: center; gap: 22px; margin: 72px 0 0; padding: 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; }
.legend .root { background: var(--root); }
.legend .third { background: var(--third); }
.legend .fifth { background: var(--fifth); }

/* Statement between hero and tiles */
.peek { text-align: center; padding: 40px 0 72px; }
.peek h2 { font-size: clamp(1.875rem, 5vw, 3.25rem); line-height: 1.08; margin: 0 0 12px; letter-spacing: -0.025em; }
.peek h2 span { color: var(--gold); }
.peek .lead { color: var(--muted); font-size: clamp(1.0625rem, 2.2vw, 1.25rem); line-height: 1.45; max-width: 560px; margin: 0 auto; }

/* Showcase tiles */
.showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 96px;
}
.tile {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: 32px;
  display: flex; flex-direction: column;
  min-height: 440px;
  isolation: isolate;
}
.tile h3 { margin: 0 0 6px; font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.15; letter-spacing: -0.015em; }
.tile p { margin: 0; color: rgba(251, 244, 236, 0.78); max-width: 38ch; }

.chips { list-style: none; margin: auto 0 0; padding: 32px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em;
  padding: 10px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), background 0.2s ease;
}
.chips li:first-child { background: var(--gold); color: var(--bg); border-color: transparent; }
@media (hover: hover) { .tile:hover .chips li:nth-child(even) { transform: translateY(-4px); } }

.caged { margin: auto 0 0; padding-top: 28px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.caged figure { margin: 0; text-align: center; transition: transform 0.4s cubic-bezier(.2, .8, .2, 1); }
.caged figcaption { color: var(--muted); font-size: 0.75rem; font-weight: 600; margin-top: 4px; }
.chord { display: block; width: 100%; height: auto; }
.chord .cname { font: 800 14px var(--font); text-anchor: middle; }
.chord .fr { font: 600 10px var(--font); fill: var(--muted); }
@media (hover: hover) { .tile:hover .caged figure:nth-child(odd) { transform: translateY(-6px); } }

.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 40px; min-height: 0; padding: 40px 48px; }
.tile.wide .copy { flex: 1; }
.tile.wide .art { flex: 0 1 340px; }
.circle { display: block; width: 100%; height: auto; }
.circle text { text-anchor: middle; font-family: var(--font); }
.circle .maj { font-size: 18px; font-weight: 700; fill: var(--text); }
.circle .maj.on { fill: var(--bg); }
.circle .min { font-size: 12px; font-weight: 600; fill: var(--muted); }
.circle .min.hi { fill: var(--gold-light); }
.circle .key { font-size: 26px; font-weight: 800; fill: var(--gold); }

.prog { list-style: none; display: flex; gap: 10px; margin: 28px 0 0; padding: 0; }
.prog li { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 12px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); }
.prog b { font-size: 1.25rem; }
.prog span { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.prog .on { border-color: var(--gold); }
.prog .on b { color: var(--gold); }

.tile.gold   { background: radial-gradient(120% 90% at 0% 0%, #f2a93b44, transparent 60%), linear-gradient(160deg, #3d2616, #1c120c); }
.tile.violet { background: radial-gradient(120% 90% at 100% 0%, #4a90f033, transparent 60%), linear-gradient(160deg, #2a2230, #15100f); }
.tile.rose   { background: radial-gradient(120% 90% at 0% 0%, #e64d4d33, transparent 60%), linear-gradient(160deg, #3a1d18, #1a110d); }

/* Scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .8, .2, 1); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .showcase { grid-template-columns: 1fr; }
  .tile { min-height: 0; padding: 28px 24px; }
  .tile.wide { flex-direction: column; padding: 28px 24px; gap: 24px; }
  .tile.wide .art { flex: none; width: min(320px, 100%); }
  .result { position: relative; right: auto; bottom: auto; width: fit-content; margin: 8px auto 0; justify-items: center; text-align: center; }
  .legend { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .board .dot, .result, .chips li, .caged figure { transition: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .hero-board:not(.in) .dot, .js .hero-board:not(.in) .result { opacity: 1; transform: none; }
  .tile:hover .chips li, .tile:hover .caged figure { transform: none; }
  a, .badge, details summary { transition: none; }
  .nav .lang:active, a.badge:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--border); }
  .result { background: var(--bg-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --border: rgba(255, 255, 255, 0.45); --muted: #E6DACE; --surface: #2E1F15; }
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--border); }
  .tile p { color: var(--text); }
}
