/* Portée — a concert hall at night: ink-blue stage, ivory keys, a warm gold light. */

:root {
  --ink: #0e0d1c;
  --ink-2: #16152b;
  --ink-3: #1f1d3a;
  --line: rgba(244, 239, 230, 0.10);
  --line-strong: rgba(244, 239, 230, 0.18);
  --ivory: #f4efe6;
  --ivory-dim: #cfc9bd;
  --muted: #9e99b3;
  --gold: #e3b96a;
  --gold-2: #c8923a;
  --gold-soft: rgba(227, 185, 106, 0.14);
  --danger: #f08a7e;
  --ok: #8fd1a8;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.6 var(--sans);
  color: var(--ivory);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(227, 185, 106, 0.12), transparent 60%),
    radial-gradient(900px 700px at -10% 20%, rgba(111, 94, 214, 0.18), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, #0b0a17 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 16px; z-index: 10; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 10px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(14, 13, 28, 0.88), rgba(14, 13, 28, 0.6));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 18px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 22px/1 var(--serif); letter-spacing: 0.01em; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ivory-dim);
  font-weight: 500; font-size: 15px; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ivory); background: rgba(244, 239, 230, 0.06); }
.nav a[aria-current="page"] { color: var(--ivory); background: rgba(244, 239, 230, 0.09); }
.lang {
  display: flex; margin-left: 8px; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.lang button {
  font: 600 12px/1 var(--sans); letter-spacing: 0.06em;
  color: var(--muted); background: none; border: 0; padding: 7px 10px; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); background: var(--gold); }

/* ── Hero ─────────────────────────────────────────── */
.view { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero {
  position: relative;
  max-width: var(--max); margin: 0 auto; padding: 72px 24px 40px;
  text-align: center;
}
.staff {
  position: absolute; left: 0; right: 0; top: 70px; height: 150px; z-index: -1;
  background: repeating-linear-gradient(180deg, transparent 0 28px, rgba(244, 239, 230, 0.06) 28px 29px);
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.eyebrow {
  display: inline-block; margin: 0 0 18px;
  font: 600 12px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.eyebrow.warn { color: var(--danger); }
h1 {
  margin: 0 auto 20px; max-width: 16ch;
  font: 500 clamp(40px, 7vw, 76px)/1.02 var(--serif); letter-spacing: -0.02em;
}
h1 em, .section-title em { font-style: italic; color: var(--gold); font-weight: 400; }
.lede { margin: 0 auto 40px; max-width: 60ch; color: var(--ivory-dim); font-size: 18px; }

/* ── Studio card ─────────────────────────────────────────── */
.studio {
  position: relative; margin: 0 auto; max-width: 640px; padding: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(31, 29, 58, 0.85), rgba(22, 21, 43, 0.9));
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.studio::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(227, 185, 106, 0.5), transparent 30%, transparent 70%, rgba(111, 94, 214, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.stage { display: grid; gap: 18px; justify-items: center; }

.dropzone {
  position: relative; width: 100%;
  display: grid; gap: 14px; justify-items: center; align-content: center;
  min-height: 210px; padding: 28px;
  border: 1.5px dashed rgba(227, 185, 106, 0.45); border-radius: var(--radius-sm);
  background: rgba(14, 13, 28, 0.45); cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); }
.dropzone.over { transform: scale(1.01); }
.dropzone:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  color: var(--gold); background: radial-gradient(circle, rgba(227, 185, 106, 0.2), rgba(227, 185, 106, 0.04));
  border: 1px solid rgba(227, 185, 106, 0.35);
}
.dropzone.picked .drop-icon { color: var(--ink); background: var(--gold); }
.drop-empty, .drop-picked { display: grid; gap: 6px; color: var(--ivory-dim); }
.drop-empty strong, .drop-picked strong { color: var(--ivory); font: 500 22px/1.2 var(--serif); }
.drop-picked strong { word-break: break-word; }
.dropzone u { color: var(--gold); text-underline-offset: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 16px/1 var(--sans); padding: 16px 26px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.btn-primary {
  color: #1a1408;
  background: linear-gradient(180deg, #f1cf8a, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 10px 30px -10px rgba(227, 185, 106, 0.7), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(227, 185, 106, 0.85), 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-ghost { color: var(--ivory); background: rgba(244, 239, 230, 0.06); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: rgba(244, 239, 230, 0.1); }

.hint { margin: 0; font-size: 13px; color: var(--muted); }
.inline-error, .error-text { margin: 0; color: var(--danger); max-width: 46ch; }
.error-text { color: var(--ivory-dim); font-size: 17px; }
.notice { margin: 0; color: var(--gold); font-size: 14px; }

/* Working */
.song-title { margin: 0; font: 500 30px/1.15 var(--serif); letter-spacing: -0.01em; }
.song-artist { margin: -10px 0 0; color: var(--muted); }
.work-status { margin: 0; color: var(--gold); font-weight: 500; }
.level-progress { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 380px; display: grid; gap: 8px; }
.level-progress li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-radius: 12px; background: rgba(14, 13, 28, 0.5); border: 1px solid var(--line);
}
.level-progress .state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.level-progress .state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .5; }
.level-progress [data-state="working"] .state { color: var(--gold); }
.level-progress [data-state="working"] .state::before { background: var(--gold); opacity: 1; animation: pulse 1s ease-in-out infinite; }
.level-progress [data-state="done"] .state { color: var(--ok); }
.level-progress [data-state="done"] .state::before { background: var(--ok); opacity: 1; }
.level-progress [data-state="failed"] .state { color: var(--danger); }
.level-progress [data-state="failed"] .state::before { background: var(--danger); opacity: 1; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .4; } }

/* Done */
.facts { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.facts li { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--ivory-dim); background: rgba(244, 239, 230, 0.06); border: 1px solid var(--line); }
.facts b { color: var(--ivory); font-weight: 600; margin-left: 4px; }
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.download {
  display: grid; gap: 8px; justify-items: start; text-align: left; text-decoration: none;
  padding: 18px; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(244, 239, 230, 0.07), rgba(244, 239, 230, 0.03));
  border: 1px solid var(--line-strong); transition: transform .15s, border-color .2s, background .2s;
}
.download:hover { transform: translateY(-2px); border-color: rgba(227, 185, 106, 0.6); background: var(--gold-soft); }
.download h3 { margin: 0; font: 500 20px/1.2 var(--serif); }
.download p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.download .get { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--gold); }
.download.failed { opacity: .5; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Difficulty dots */
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.dots i.off { background: rgba(244, 239, 230, 0.15); }

/* ── Keyboards ─────────────────────────────────────────── */
.keyboard, .mini-keys, .footer-keys { position: relative; display: flex; }
.keyboard { max-width: var(--max); margin: 48px auto 0; height: 110px; padding: 0 24px; }
.mini-keys { width: 100%; max-width: 360px; height: 64px; }
.footer-keys { height: 34px; opacity: .5; margin-bottom: 24px; }
.wk {
  flex: 1; margin: 0 1px; border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #e9e3d6, var(--ivory) 30%, #fffdf8);
  box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25) inset, 0 6px 14px -8px rgba(0, 0, 0, 0.6);
  transition: background .25s, transform .12s;
}
.bk {
  position: absolute; top: 0; width: calc(var(--w) * 0.62); height: 62%;
  transform: translateX(-50%); border-radius: 0 0 4px 4px; z-index: 1;
  background: linear-gradient(180deg, #2a2745, #0c0b17 70%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), 0 -1px 0 rgba(255, 255, 255, 0.08) inset;
  transition: background .25s;
}
.wk.lit { background: linear-gradient(180deg, #f5d99a, var(--gold)); transform: translateY(1px); }
.bk.lit { background: linear-gradient(180deg, #f1cf8a, var(--gold-2)); }
.keyboard::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: -30px; height: 40px;
  background: radial-gradient(ellipse at center, rgba(227, 185, 106, 0.18), transparent 70%);
  pointer-events: none;
}

/* ── Sections ─────────────────────────────────────────── */
.band { max-width: var(--max); margin: 0 auto; padding: 72px 24px 8px; }
.section-title { margin: 0 0 12px; text-align: center; font: 500 clamp(28px, 4vw, 40px)/1.15 var(--serif); letter-spacing: -0.01em; }
.section-lede { margin: 0 auto 36px; max-width: 60ch; text-align: center; color: var(--ivory-dim); }

.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.steps li, .pillars article, .level-card, .feature {
  padding: 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(31, 29, 58, 0.6), rgba(22, 21, 43, 0.4));
  border: 1px solid var(--line);
}
.steps h3, .pillars h3, .level-card h3, .feature h3 { margin: 14px 0 8px; font: 500 22px/1.25 var(--serif); }
.steps p, .pillars p, .level-card p, .feature p { margin: 0; color: var(--ivory-dim); font-size: 15px; }
.step-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font: 600 18px/1 var(--serif); color: var(--ink); background: var(--gold);
}
.level-cards, .pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.level-card { position: relative; overflow: hidden; }
.level-card::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 185, 106, 0.16), transparent 70%);
}
.pillar-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(227, 185, 106, 0.3); }

.split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature h3 { margin-top: 0; }

.faq { max-width: 760px; margin: 28px auto 0; display: grid; gap: 10px; }
.faq details { border-radius: var(--radius-sm); background: rgba(31, 29, 58, 0.5); border: 1px solid var(--line); padding: 4px 20px; }
.faq summary { cursor: pointer; padding: 14px 0; font: 500 18px/1.3 var(--serif); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font: 400 24px/1 var(--sans); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 16px; color: var(--ivory-dim); }
.cta { text-align: center; margin: 48px 0 0; }

/* ── Footer ─────────────────────────────────────────── */
.footer { max-width: var(--max); margin: 96px auto 0; padding: 0 24px 48px; text-align: center; color: var(--ivory-dim); font-size: 14px; }
.footer p { margin: 4px 0; }
.muted { color: var(--muted); }

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .steps, .level-cards, .pillars, .split { grid-template-columns: 1fr; }
  .downloads { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .keyboard { height: 80px; }
}
@media (max-width: 520px) {
  .topbar-inner { padding: 14px 16px; }
  .brand span { display: none; }
  .nav a { padding: 8px 10px; }
  .studio { padding: 18px; }
  .dropzone { min-height: 180px; padding: 20px; }
  .lede { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ── Rights confirmation ─────────────────────────────────────────── */
.consent {
  display: flex; gap: 12px; align-items: flex-start; max-width: 520px;
  text-align: left; font-size: 14px; color: var(--ivory-dim); cursor: pointer;
}
.consent input {
  flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); cursor: pointer;
}
.consent a { color: var(--gold); text-underline-offset: 3px; }

/* ── Legal documents ─────────────────────────────────────────── */
.doc-body { max-width: 780px; margin: 0 auto; padding: 64px 24px 0; color: var(--ivory-dim); }
.doc-body h1 { margin: 0 0 8px; max-width: none; text-align: left; font-size: clamp(34px, 5vw, 48px); color: var(--ivory); }
.doc-body h2 { margin: 36px 0 10px; font: 500 22px/1.3 var(--serif); color: var(--ivory); }
.doc-body p, .doc-body li { font-size: 16px; }
.doc-body ul { padding-left: 22px; }
.doc-body li { margin: 6px 0; }
.doc-body a { color: var(--gold); text-underline-offset: 3px; }
.doc-date { color: var(--muted); font-size: 14px !important; }
.doc-note { color: var(--gold); font-size: 14px !important; }
.doc-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc-table th { color: var(--ivory); font-weight: 600; }
@media (max-width: 640px) {
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; }
  .doc-table thead { display: none; }
  .doc-table tr { padding: 10px 0; border-bottom: 1px solid var(--line-strong); }
  .doc-table td { border: 0; padding: 4px 0; }
}

.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--ivory); text-decoration: underline; }
