/* Middle C website. Colours follow the app: navy surfaces, amber accents, cream "paper" for music. */

:root {
  --bg: #121724;
  --bg-raised: #1a2033;
  --bg-card: #212840;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f1ea;
  --text-dim: #a9afc2;
  --text-faint: #7c8399;
  --amber: #f5a623;
  --amber-light: #ffcb63;
  --paper: #fbf6ea;
  --paper-text: #1c2130;
  --paper-dim: #5a5f6e;
  --blue: #3b8fd6;
  --radius: 18px;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber-light); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 750; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--amber); color: var(--bg); padding: 8px 14px; border-radius: 8px; }

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

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18, 23, 36, 0.82);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: var(--text-dim); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.site-nav .btn { color: var(--bg); }
@media (max-width: 760px) { .site-nav > a:not(.btn) { display: none; } }

/* Language menu in the header */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 0.95rem; font-weight: 500; padding: 6px 2px;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); }
.lang-menu summary svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 760px) { .lang-menu summary span { display: none; } }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 200px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}
.lang-menu li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-dim); }
.lang-menu li a:hover { background: var(--bg-raised); color: var(--text); }
.lang-menu li a[aria-current="page"] { color: var(--amber-light); font-weight: 650; }

/* Offer of the page in the visitor's language */
.lang-offer {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px var(--gutter); background: var(--bg-card); border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.lang-offer button {
  background: none; border: 0; color: var(--text-dim); font-size: 1.3rem; line-height: 1;
  cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.lang-offer button:hover { color: var(--text); }

/* Text in Chinese, Japanese and Korean: no italics or letter-spacing, which these scripts
   don't use, break lines between words in Korean and at phrase boundaries where supported. */
:lang(ja) em, :lang(zh) em, :lang(ko) em { font-style: normal; }
:lang(ja), :lang(zh) { line-break: strict; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { word-break: auto-phrase; letter-spacing: 0; }
:lang(ko) { word-break: keep-all; }
:lang(ja) .eyebrow, :lang(zh) .eyebrow, :lang(ko) .eyebrow { letter-spacing: 0.04em; }
:lang(ja) body, :lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif; }
:lang(zh) body, :lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
:lang(ko) body, :lang(ko) h1, :lang(ko) h2, :lang(ko) h3 { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 650; font-size: 1rem; text-decoration: none; line-height: 1.2;
  background: linear-gradient(180deg, var(--amber-light), var(--amber));
  color: var(--bg);
  border: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 20px -6px rgba(245, 166, 35, 0.55);
}
.btn:hover { color: var(--bg); transform: translateY(-1px); box-shadow: 0 10px 26px -8px rgba(245, 166, 35, 0.7); }
.btn.small { padding: 8px 16px; font-size: 0.9rem; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: none; }
.btn.ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.45); }
.btn svg { width: 20px; height: 20px; flex: none; }

.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 20px 10px 16px; border-radius: 14px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.store-badge:hover { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.store-badge svg { width: 26px; height: 26px; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge small { font-size: 0.72rem; color: #c9c9c9; letter-spacing: 0.02em; }
.store-badge strong { font-size: 1.15rem; font-weight: 600; }
.store-badge[aria-disabled="true"] { cursor: default; }

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

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 0;
  background:
    radial-gradient(1000px 520px at 78% -10%, rgba(245, 166, 35, 0.16), transparent 60%),
    radial-gradient(900px 600px at 0% 20%, rgba(59, 143, 214, 0.12), transparent 60%),
    linear-gradient(180deg, #1b2236 0%, var(--bg) 70%);
  overflow: hidden;
}
.hero-copy { max-width: 760px; }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--amber-light); margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--amber-light); }
.hero .lede { margin-top: 22px; font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--text-dim); max-width: 640px; }
.hero .actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .platforms { margin-top: 18px; font-size: 0.92rem; color: var(--text-faint); }

.hero-shots { position: relative; margin-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(40px, 6vw, 72px); }
.mac-shot {
  width: 88%;
  border-radius: 12px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone {
  border-radius: 34px; overflow: hidden;
  border: 8px solid #0b0e16;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12);
  background: #0b0e16;
}
.hero-shots .phone { position: absolute; right: 0; bottom: 0; width: 25%; }
@media (max-width: 640px) {
  .mac-shot { width: 100%; }
  .hero-shots .phone { width: 34%; right: -4px; bottom: 10px; border-width: 5px; border-radius: 22px; }
  .hero-shots { padding-bottom: 80px; }
}

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

main section { padding: clamp(72px, 10vw, 120px) 0; scroll-margin-top: 64px; }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p { margin-top: 16px; color: var(--text-dim); font-size: 1.12rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Inputs strip */
.inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .inputs { grid-template-columns: 1fr; } }
.input {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.input .icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(245, 166, 35, 0.14); color: var(--amber-light); margin-bottom: 18px;
}
.input .icon svg { width: 26px; height: 26px; }
.input p { margin-top: 8px; color: var(--text-dim); font-size: 0.98rem; }

/* Feature rows */
.feature {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 6vw, 80px); align-items: center;
}
.feature + .feature { margin-top: clamp(72px, 10vw, 120px); }
.feature.flip .feature-media { order: -1; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature.flip .feature-media { order: 0; }
}
.feature-copy .tag {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--amber-light); color: var(--paper-text); margin-bottom: 16px;
}
.feature-copy .tag.grey { background: #c9ccd4; }
.feature-copy p { margin-top: 16px; color: var(--text-dim); font-size: 1.08rem; }
.feature-copy ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.feature-copy li { position: relative; padding-left: 28px; color: var(--text); }
.feature-copy li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 9px;
  border-left: 2.5px solid var(--amber-light); border-bottom: 2.5px solid var(--amber-light);
  transform: rotate(-45deg) translate(1px, -3px);
}
.feature-media .mac-shot { width: 100%; }
.feature-media.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 520px; margin: 0 auto; }
.feature-media.duo .phone:nth-child(2) { transform: translateY(40px); }

.judgement { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.judgement span {
  font-size: 0.85rem; font-weight: 650; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-card);
}
.judgement .on { color: #7fd67a; }
.judgement .early { color: #6ab6ff; }
.judgement .late { color: var(--amber-light); }
.judgement .miss { color: #ff8a80; }

/* Paper section: the course */
.paper {
  background: var(--paper); color: var(--paper-text);
  position: relative;
}
.paper .section-head p { color: var(--paper-dim); }
.paper .eyebrow { color: #b8740a; }
.staff-rule {
  height: 49px; margin-bottom: 48px;
  background: repeating-linear-gradient(180deg, transparent 0 11px, rgba(28, 33, 48, 0.28) 11px 12px);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: unit; list-style: none; padding: 0; margin: 0; }
@media (max-width: 960px) { .units { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .units { grid-template-columns: 1fr; } }
.unit {
  background: #fff; border-radius: 16px; padding: 22px 22px 24px;
  box-shadow: 0 1px 0 rgba(28, 33, 48, 0.06), 0 10px 30px -18px rgba(28, 33, 48, 0.35);
}
.unit .num { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #b8740a; }
.unit h3 { margin-top: 6px; color: var(--paper-text); }
.unit p { margin-top: 8px; color: var(--paper-dim); font-size: 0.95rem; line-height: 1.5; }
.unit .count { margin-top: 14px; font-size: 0.82rem; font-weight: 600; color: var(--paper-text); opacity: 0.6; }

/* Songs */
.song-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .song-groups { grid-template-columns: 1fr; } }
.song-group { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.song-group h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--amber-light); font-weight: 800; }
.song-group ul { list-style: none; margin: 16px 0 0; padding: 0; }
.song-group li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.song-group li:first-child { border-top: 0; }
.song-group li span { font-weight: 600; }
.song-group li small { color: var(--text-faint); font-size: 0.85rem; text-align: right; }
.speeds { margin-top: 28px; text-align: center; color: var(--text-dim); font-size: 1rem; }
.speeds b { color: var(--text); }

/* Devices */
.devices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .devices { grid-template-columns: 1fr; } }
.device { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.device-img { background: linear-gradient(180deg, #232b45, #161b2b); padding: 28px 28px 0; height: 260px; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
.device-img img { width: 100%; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px -20px rgba(0, 0, 0, 0.8); }
.device-img.portrait img { width: 56%; border-radius: 20px 20px 0 0; }
.device-body { padding: 24px 26px 28px; }
.device-body p { margin-top: 8px; color: var(--text-dim); font-size: 0.97rem; }
.device-body .req { margin-top: 14px; font-size: 0.85rem; color: var(--text-faint); }

/* Privacy band */
.privacy-band { background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: 1fr; } }
.privacy-points { display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; }
.privacy-points li { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-card); border-radius: 14px; padding: 16px 18px; }
.privacy-points svg { width: 22px; height: 22px; color: var(--amber-light); flex: none; margin-top: 2px; }
.privacy-points b { display: block; }
.privacy-points span { color: var(--text-dim); font-size: 0.95rem; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative;
  font-weight: 650; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 22px; color: var(--text-dim); }
.faq details p + p { margin-top: -10px; }

/* Closing CTA */
.cta {
  text-align: center;
  background:
    radial-gradient(700px 360px at 50% 120%, rgba(245, 166, 35, 0.22), transparent 70%),
    var(--bg);
}
.cta img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 28px; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.8); }
.cta p { margin: 16px auto 0; max-width: 560px; color: var(--text-dim); font-size: 1.12rem; }
.cta .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.cta .tip { margin-top: 36px; font-size: 0.98rem; color: var(--text-faint); }
.cta .bmc { margin-top: 14px; }

/* Buy Me a Coffee button, in Buy Me a Coffee's own colours */
.bmc {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 20px 9px 16px; border-radius: 12px;
  background: #ffdd00; color: #0d0c22;
  font-weight: 650; font-size: 1rem; line-height: 1.2; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bmc:hover { color: #0d0c22; transform: translateY(-1px); box-shadow: 0 10px 26px -10px rgba(255, 221, 0, 0.6); }
.bmc img { width: 20px; height: 28px; margin: 0; border-radius: 0; box-shadow: none; }

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

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 0.92rem; color: var(--text-faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .lang-list { flex-basis: 100%; gap: 8px 18px; font-size: 0.86rem; }
.site-footer .lang-list a[aria-current="page"] { color: var(--amber-light); }

/* ---------- Text pages (privacy, support) ---------- */

.page { padding: clamp(56px, 8vw, 96px) 0; }
.page .wrap { max-width: 760px; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.page .updated { margin-top: 12px; color: var(--text-faint); font-size: 0.92rem; }
.page .intro { margin-top: 24px; font-size: 1.15rem; color: var(--text-dim); }
.page h2 { font-size: 1.45rem; margin-top: 48px; }
.page p, .page ul { margin-top: 14px; color: var(--text-dim); }
.page ul { padding-left: 22px; }
.page li + li { margin-top: 8px; }
.page strong { color: var(--text); }
.callout { margin-top: 32px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.callout p:first-child { margin-top: 0; }
/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed; z-index: 60;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 560px; margin-left: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
  padding: 18px 20px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.6);
  font-size: 0.92rem; line-height: 1.5;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { flex: 1 1 260px; }
.cookie-actions { display: flex; gap: 10px; margin-left: auto; }
.cookie-actions .btn { cursor: pointer; font-family: inherit; }
