/* ============================================================
   Piano Online — design tokens & core styles
   Style base: Apple (apple/DESIGN.md) — white canvas, near-black
   ink, single action blue, pill buttons, tile rhythm.
   Two skins: standard (default) / warm via html[data-skin].
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-pearl: #fafafc;
  --ink: #1d1d1f;
  --ink-2: #333333;
  --ink-3: #7a7a7a;
  --accent: #0066cc;
  --accent-strong: #0071e3;
  --accent-on-dark: #2997ff;
  --accent-soft: #e8f1fa;
  --on-accent: #ffffff;
  --tile-dark: #272729;
  --tile-dark-2: #2a2a2c;
  --tile-black: #0a0a0b;
  --on-dark: #ffffff;
  --on-dark-muted: #cccccc;
  --on-dark-faint: #86868b;
  --hairline: #e0e0e0;
  --divider: #f0f0f0;
  --nav-bg: #000000;
  --card-bg: #ffffff;
  --shadow-product: 0 5px 30px rgba(0, 0, 0, 0.22);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1068px;
  --maxw-wide: 1280px;
}

html[data-skin="warm"] {
  --bg: #faf8f4;
  --bg-soft: #f2eee7;
  --bg-pearl: #fbf9f6;
  --ink: #29241f;
  --ink-2: #3d362f;
  --ink-3: #8a8078;
  --accent: #a4551e;
  --accent-strong: #b86225;
  --accent-on-dark: #e8945a;
  --accent-soft: #f6e9dd;
  --on-accent: #ffffff;
  --tile-dark: #2b2521;
  --tile-dark-2: #2f2924;
  --tile-black: #12100e;
  --hairline: #e5ddd1;
  --divider: #efe9df;
  --card-bg: #fffdf9;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.374px;
  color: var(--ink);
  background: var(--bg);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { letter-spacing: -0.3px; line-height: 1.1; font-weight: 600; margin: 0 0 16px; }
h1 { font-size: 44px; }
h2 { font-size: 32px; }
h3 { font-size: 22px; letter-spacing: -0.2px; }
p { margin: 0 0 16px; }
::selection { background: var(--accent-soft); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.container-wide { max-width: var(--maxw-wide); margin: 0 auto; padding: 0 22px; }

/* ---------- global nav ---------- */
.gnav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); height: 52px; }
.gnav-in { max-width: var(--maxw-wide); margin: 0 auto; padding: 0 22px; height: 100%; display: flex; align-items: center; gap: 26px; }
.gnav-logo { display: flex; align-items: center; gap: 8px; color: #ffffff; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; text-decoration: none; }
.gnav-logo:hover { text-decoration: none; color: #ffffff; }
.gnav-logo svg { width: 18px; height: 18px; }
.gnav-links { display: flex; align-items: center; gap: 22px; flex: 1; }
.gnav-links a { color: #d6d6d6; font-size: 13px; letter-spacing: -0.1px; text-decoration: none; padding: 4px 0; }
.gnav-links a:hover { color: #ffffff; text-decoration: none; }
.gnav-links a[aria-current="page"] { color: #ffffff; font-weight: 600; }
.gnav-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: #d6d6d6;
}
.icon-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.12); }
.icon-btn svg { width: 17px; height: 17px; }

/* language dropdown */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1); border: 0; color: #ffffff;
  font-size: 13px; letter-spacing: -0.1px;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lang-btn svg { width: 12px; height: 12px; opacity: 0.8; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 172px;
  background: var(--card-bg); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  padding: 6px; display: none; z-index: 120;
}
.lang.open .lang-menu { display: block; }
.lang-menu button, .lang-menu a {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); font-size: 14px; letter-spacing: -0.1px;
  text-decoration: none; text-align: left;
}
.lang-menu button:hover, .lang-menu a:hover { background: var(--bg-soft); text-decoration: none; }
.lang-menu .cur { color: var(--ink-3); }
.lang-menu .tick { color: var(--accent); font-weight: 600; }

/* mobile nav */
.gnav-burger { display: none; }
.mnav {
  display: none; position: absolute; top: 52px; left: 0; right: 0;
  background: var(--nav-bg); padding: 10px 22px 22px; z-index: 99;
}
.mnav.open { display: block; }
.mnav a { display: block; padding: 12px 0; color: #d6d6d6; font-size: 17px; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.mnav a[aria-current="page"] { color: #ffffff; font-weight: 600; }

@media (max-width: 900px) {
  .gnav-links { display: none; }
  .gnav-burger { display: inline-flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-pill); border: 0;
  background: var(--accent); color: var(--on-accent);
  font-size: 16px; letter-spacing: -0.2px; text-decoration: none;
  transition: transform 0.12s ease;
}
.btn:hover { background: var(--accent-strong); text-decoration: none; }
.btn:active { transform: scale(0.95); }
.btn-ghost {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn-dark { background: var(--ink); color: #ffffff; border-radius: var(--radius-sm); padding: 8px 15px; font-size: 14px; }
.btn-dark:hover { background: #000; }

/* ---------- sections / tiles ---------- */
.tile { padding: 72px 0; }
.tile-soft { background: var(--bg-soft); }
.tile-dark { background: var(--tile-dark); color: var(--on-dark); }
.tile-dark h1, .tile-dark h2, .tile-dark h3 { color: var(--on-dark); }
.tile-dark p { color: var(--on-dark-muted); }
.tile-dark a { color: var(--accent-on-dark); }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 12px;
}
.lead { font-size: 21px; line-height: 1.4; color: var(--ink-2); letter-spacing: -0.2px; }
.tile-dark .lead { color: var(--on-dark-muted); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card-bg); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.card h3 { margin: 0; font-size: 19px; }
.card p { margin: 0; font-size: 15px; color: var(--ink-3); line-height: 1.5; }
.card .go { margin-top: auto; padding-top: 12px; font-size: 15px; font-weight: 600; }
.card:hover { border-color: var(--ink-3); text-decoration: none; }
a.card { color: inherit; }
a.card:hover { text-decoration: none; }
.card-ico {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.card-ico svg { width: 22px; height: 22px; stroke: var(--accent); }

/* ---------- article ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 56px 22px 72px; }
.article h1 { font-size: 40px; margin-bottom: 10px; }
.article .byline { font-size: 14px; color: var(--ink-3); margin-bottom: 32px; }
.article h2 { font-size: 28px; margin-top: 44px; }
.article h3 { font-size: 20px; margin-top: 32px; }
.article p, .article li { font-size: 17px; line-height: 1.6; }
.article ul, .article ol { padding-left: 24px; margin: 0 0 16px; }
.article li { margin-bottom: 8px; }
.article blockquote {
  margin: 24px 0; padding: 16px 22px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 17px; color: var(--ink-2);
}
.article strong { font-weight: 600; }
.article table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; }
.article th, .article td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.article th { font-weight: 600; color: var(--ink-2); }
.article img { border-radius: var(--radius-md); margin: 24px auto; }
.kbd {
  display: inline-block; min-width: 26px; padding: 2px 7px; margin: 0 2px;
  border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 6px;
  background: var(--bg-soft); font-size: 13px; font-weight: 600; text-align: center;
  font-family: var(--font); color: var(--ink);
}

/* ---------- breadcrumb ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 18px 0 0; font-size: 13px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.5; }

/* ---------- piano stage ---------- */
.piano-shell { background: var(--tile-black); border-radius: var(--radius-lg); padding: 18px 18px 22px; box-shadow: var(--shadow-product); }
.piano-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.piano-toolbar .grp { display: flex; align-items: center; gap: 6px; }
.piano-toolbar .spacer { flex: 1; }
.pbtn {
  height: 34px; padding: 0 14px; border-radius: var(--radius-pill); border: 0;
  background: var(--tile-dark-2); color: var(--on-dark); font-size: 13px; letter-spacing: -0.1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.pbtn:hover { background: #3a3a3d; }
.pbtn:active { transform: scale(0.95); }
.pbtn.on { background: var(--accent); color: var(--on-accent); }
.pbtn.sel { outline: 2px solid var(--accent-on-dark); outline-offset: 1px; }
.piano-wrap { position: relative; user-select: none; -webkit-user-select: none; touch-action: none; }
.piano-keys { display: flex; height: 190px; border-radius: 6px; overflow: hidden; }
.pk {
  position: relative;
}
.pk-w {
  flex: 1 1 0; background: linear-gradient(#ffffff, #f0f0f2);
  border: 1px solid #d9d9de; border-top: 0; margin-right: -1px;
  border-radius: 0 0 5px 5px;
}
.pk-w.down { background: linear-gradient(#eef4fb, #dbe7f5); }
.pk-b {
  position: absolute; top: 0; width: 1.65%; min-width: 13px; height: 60%;
  background: linear-gradient(#3a3a3e, #101012); z-index: 2;
  border-radius: 0 0 4px 4px; border: 1px solid #000;
  box-shadow: inset 0 -6px 8px rgba(255, 255, 255, 0.06);
}
.pk-b.down { background: linear-gradient(#1c3a5e, #0e2238); }
.pk-label {
  position: absolute; bottom: 7px; left: 0; right: 0; text-align: center;
  font-size: 10.5px; color: #9a9aa0; pointer-events: none; letter-spacing: 0;
}
.pk-b .pk-label { color: #7a7a80; bottom: 5px; }
.pk-note { font-size: 12px; color: #6e6e74; }
.piano-status {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-top: 12px; font-size: 12.5px; color: var(--on-dark-faint); letter-spacing: 0;
}
.piano-status .dot { color: var(--accent-on-dark); }
@media (max-width: 640px) { .piano-keys { height: 120px; } .pk-label { font-size: 9px; } }

/* ---------- tool pages (chords / scales) ---------- */
.tool-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--bg-soft); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 28px;
}
.tool-bar label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tool-bar select, .tool-bar input {
  height: 44px; min-width: 150px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--card-bg); color: var(--ink);
  font-size: 15px; font-family: inherit;
}
.tool-bar select:focus, .tool-bar input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.tool-result h2 { margin-bottom: 4px; }
.tool-result .sub { color: var(--ink-3); font-size: 15px; margin-bottom: 18px; }
.note-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.note-chip {
  padding: 7px 14px; border-radius: var(--radius-pill); background: var(--accent-soft);
  color: var(--accent); font-weight: 600; font-size: 14px;
}
.mini-piano { background: var(--tile-black); border-radius: var(--radius-md); padding: 12px; }
.mini-piano .piano-keys { height: 120px; }

/* ---------- lists / misc ---------- */
.tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--bg-soft); border: 1px solid var(--hairline);
  font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.list-meta { font-size: 14px; color: var(--ink-3); }

/* contact form */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.form input, .form textarea {
  padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--hairline);
  background: var(--card-bg); color: var(--ink); font-size: 16px; font-family: inherit; letter-spacing: -0.2px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form .btn { align-self: flex-start; }
.form-note { font-size: 13px; color: var(--ink-3); }

/* ---------- footer ---------- */
.footer { background: var(--bg-soft); padding: 52px 0 36px; margin-top: 72px; }
.footer-in { max-width: var(--maxw-wide); margin: 0 auto; padding: 0 22px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 834px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: 14px; margin-bottom: 12px; color: var(--ink-2); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--ink-3); font-size: 14px; }
.footer a:hover { color: var(--accent); }
.footer .about { font-size: 14px; color: var(--ink-3); line-height: 1.6; max-width: 320px; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 12px; color: var(--ink-3);
}

/* faq */
.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  padding: 16px 4px; font-size: 17px; font-weight: 600; cursor: pointer; list-style: none;
  position: relative; letter-spacing: -0.2px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; color: var(--accent); font-weight: 400; font-size: 20px; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 4px 18px; color: var(--ink-2); font-size: 16px; }

/* hero home */
.hero-keys-hint { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
