/* notyapp — dark stage, gold falling notes, blue flats, red sharps */
:root {
  --bg: #0b0b10;
  --bg-2: #101018;
  --surface: #15151e;
  --surface-2: #1c1c27;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f2ec;
  --muted: #9b98a8;
  --dim: #8c899a;
  --gold: #f6c84c;
  --gold-2: #ffdf86;
  --gold-ink: #1a1405;
  --flat: #4d7cff;
  --sharp: #ff4d4d;
  --ok: #3ccf91;
  --err: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --body: "Golos Text", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap;
  transition: transform 0.25s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.3s var(--ease-out), opacity 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: progress; transform: none; }
.btn-gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 0 rgba(246, 200, 76, 0); }
.btn-gold:hover { background: var(--gold-2); box-shadow: 0 10px 40px -10px rgba(246, 200, 76, 0.65); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }
.btn-sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { --h: 56px; padding: 0 28px; font-size: 16px; }
.btn .arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(11, 11, 16, 0.72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 19px/1 var(--display); letter-spacing: -0.02em; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo b { color: var(--gold); font-weight: 700; }
.nav-links { display: flex; gap: 26px; margin-right: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
@media (max-width: 820px) { .nav-links { display: none; } .nav-in { gap: 12px; } }
@media (max-width: 420px) { #navGuest .btn-ghost, #toApp { display: none; } .logo { font-size: 17px; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 120px 0 0; overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(77, 124, 255, 0.10), transparent 70%),
    linear-gradient(180deg, rgba(11, 11, 16, 0.92) 0%, rgba(11, 11, 16, 0.55) 45%, rgba(11, 11, 16, 0) 70%);
}
.hero-in { text-align: center; padding-bottom: 34vh; }
.hero p.lead, .hero-note { text-shadow: 0 1px 14px rgba(11, 11, 16, 0.95), 0 0 2px rgba(11, 11, 16, 0.9); }
@media (max-width: 700px) {
  .hero { padding-top: 96px; }
  .hero-in { padding-bottom: 150px; }
  .hero::after { background: linear-gradient(180deg, rgba(11, 11, 16, 0.9) 0%, rgba(11, 11, 16, 0.72) 70%, rgba(11, 11, 16, 0) 86%); }
}
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); font-size: 13.5px; color: var(--muted);
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: 6px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 145, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(60, 207, 145, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 145, 0); } }
.hero h1 {
  font: 700 clamp(38px, 7.2vw, 88px)/1.02 var(--display); letter-spacing: -0.035em; margin: 22px auto 0; max-width: 14ch;
  text-wrap: balance;
}
.hero h1 .gold { color: var(--gold); }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .line > span { display: inline-block; transform: translateY(105%); animation: rise 1s var(--ease-out) forwards; animation-delay: calc(var(--i) * 110ms + 150ms); }
@keyframes rise { to { transform: translateY(0); } }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2vw, 19px); max-width: 560px; margin: 22px auto 0; text-wrap: pretty; }
.fade-up { opacity: 0; transform: translateY(18px); animation: fadeUp 0.9s var(--ease-out) forwards; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

.paste {
  margin: 34px auto 0; max-width: 620px; display: flex; gap: 8px; padding: 8px; border-radius: 999px;
  background: rgba(21, 21, 30, 0.82); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  transition: border-color 0.25s, box-shadow 0.35s var(--ease-out);
}
.paste:focus-within { border-color: rgba(246, 200, 76, 0.55); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(246, 200, 76, 0.08); }
.paste input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 0 16px; font-size: 16px; }
.paste input::placeholder { color: var(--dim); }
.hero-note { margin-top: 14px; font-size: 13.5px; color: var(--dim); }
@media (max-width: 560px) {
  .paste { flex-direction: column; border-radius: 22px; }
  .paste input { height: 48px; }
  .paste .btn { width: 100%; }
}

.scroll-cue { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; width: 22px; height: 34px; border: 1.5px solid var(--line-2); border-radius: 12px; z-index: 2; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; border-radius: 2px; background: var(--muted); translate: -50% 0; animation: cue 1.8s var(--ease-in-out) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }

/* ---------------------------------------------------------------- sections */
section.block { padding: clamp(80px, 12vw, 140px) 0; position: relative; }
.kicker { display: inline-block; font: 600 12.5px/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
h2.title { font: 700 clamp(30px, 4.6vw, 54px)/1.06 var(--display); letter-spacing: -0.03em; margin: 0; max-width: 18ch; text-wrap: balance; }
.sub { color: var(--muted); font-size: 17.5px; max-width: 560px; margin: 18px 0 0; text-wrap: pretty; }
.center { text-align: center; }
.center h2.title, .center .sub { margin-inline: auto; }

[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; overflow: hidden; position: relative; }
.step .num { font: 700 13px/1 var(--display); color: var(--dim); }
.step h3 { font: 600 21px/1.25 var(--display); letter-spacing: -0.02em; margin: 14px 0 8px; }
.step p { color: var(--muted); margin: 0; font-size: 15.5px; text-wrap: pretty; }
.illus { height: 150px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 20px; position: relative; overflow: hidden; }

/* step 1: link typing */
.ill-link { display: grid; place-items: center; }
.ill-link .field { width: 82%; height: 44px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; align-items: center; padding: 0 16px; gap: 10px; font-size: 13px; color: var(--muted); overflow: hidden; }
.ill-link .yt { width: 22px; height: 16px; border-radius: 5px; background: #ff3b30; flex: none; position: relative; }
.ill-link .yt::after { content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 8px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ill-link .typed { white-space: nowrap; overflow: hidden; width: 0; box-shadow: inset -2px 0 0 var(--gold); }
.in .ill-link .typed { animation: typing 2.6s steps(26) 0.4s infinite alternate; }
@keyframes typing { 0% { width: 0; } 60%, 100% { width: 26ch; } }

/* step 2: keyboard scan */
.ill-keys { display: flex; align-items: flex-end; padding: 0 12px 12px; }
.ill-keys .kb { position: relative; width: 100%; height: 56px; display: flex; gap: 2px; }
.ill-keys .kb span { flex: 1; background: #ecebe6; border-radius: 0 0 4px 4px; transition: background-color 0.2s; }
.ill-keys .kb span.on { background: var(--gold); }
.ill-keys .bar { position: absolute; width: 11%; border-radius: 6px; background: var(--gold); box-shadow: 0 0 18px rgba(246, 200, 76, 0.7); top: -40px; height: 26px; opacity: 0; }
.in .ill-keys .bar { animation: fall 2.4s linear infinite; animation-delay: var(--d); }
@keyframes fall { 0% { transform: translateY(-60px); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(70px); opacity: 1; } 85%, 100% { transform: translateY(80px); opacity: 0; } }
.ill-keys .hand { position: absolute; bottom: 8px; width: 34%; height: 18px; border-radius: 10px; font: 600 11px/18px var(--body); text-align: center; color: #fff; }
.ill-keys .hand.l { left: 8%; background: #2f57d6; }
.ill-keys .hand.r { right: 8%; background: #b8302e; }

/* step 3: sheet drawing */
.ill-sheet { background: #fbfaf6; display: grid; place-items: center; }
.ill-sheet svg { width: 88%; height: auto; }
.ill-sheet .staff line { stroke: #2a2a2a; stroke-width: 1; }
.ill-sheet .nh { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.in .ill-sheet .nh { animation: pop 0.5s var(--spring) forwards; animation-delay: calc(var(--k) * 120ms + 300ms); }
@keyframes pop { to { transform: scale(1); } }

/* features bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 56px; }
.card {
  --mx: 50%; --my: 50%;
  grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; overflow: hidden;
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px circle at var(--mx) var(--my), rgba(246, 200, 76, 0.09), transparent 45%); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card:hover::before { opacity: 1; }
.card.wide { grid-column: span 3; }
.card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; align-content: start; }
.card h3 { font: 600 19px/1.3 var(--display); letter-spacing: -0.015em; margin: 0; }
.card p { grid-column: 1 / -1; color: var(--muted); margin: 12px 0 0; font-size: 15px; text-wrap: pretty; }
.icon { font-size: 22px; line-height: 1; color: var(--gold); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin: 0 3px; }
.dot.flat { background: var(--flat); } .dot.sharp { background: var(--sharp); }
@media (max-width: 900px) { .card, .card.wide { grid-column: span 3; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .card, .card.wide { grid-column: auto; } }

/* compare slider */
.compare { position: relative; margin-top: 52px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: #fff; touch-action: pan-y; user-select: none; box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.8); }
.compare img { width: 100%; height: auto; pointer-events: none; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); transition: clip-path 0.08s linear; }
.compare .after img { height: 100%; object-fit: cover; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: var(--gold); translate: -1px 0; }
.compare .handle button { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--gold); color: var(--gold-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); display: grid; place-items: center; font-size: 18px; cursor: ew-resize; transition: transform 0.25s var(--ease-out); }
.compare .handle button:active { transform: scale(0.92); }
.compare .tag { position: absolute; top: 14px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(11, 11, 16, 0.82); color: #fff; }
.compare .tag.l { left: 14px; } .compare .tag.r { right: 14px; }
.legend { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 14.5px; }

/* free band */
.free { border-radius: 28px; padding: clamp(36px, 6vw, 72px); background: radial-gradient(120% 140% at 0% 0%, rgba(246, 200, 76, 0.18), transparent 50%), radial-gradient(100% 120% at 100% 100%, rgba(77, 124, 255, 0.16), transparent 50%), var(--surface); border: 1px solid var(--line-2); display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.free ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.free li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); }
.free li::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; background: rgba(60, 207, 145, 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' fill='none' stroke='%233ccf91' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; margin-top: 2px; }
@media (max-width: 820px) { .free { grid-template-columns: 1fr; } }

/* faq */
.faq { max-width: 780px; margin: 48px auto 0; display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq-item button { width: 100%; text-align: left; background: none; border: 0; padding: 20px 22px; display: flex; justify-content: space-between; gap: 16px; font-weight: 600; font-size: 16.5px; }
.faq-item .plus { width: 22px; height: 22px; flex: none; position: relative; }
.faq-item .plus::before, .faq-item .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: var(--muted); translate: -50% -50%; border-radius: 2px; transition: transform 0.35s var(--ease-out); }
.faq-item .plus::after { transform: rotate(90deg); }
.faq-item.open .plus::after { transform: rotate(0); }
.faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease-out); }
.faq-item.open .faq-body { grid-template-rows: 1fr; }
.faq-body > div { overflow: hidden; }
.faq-body p { margin: 0; padding: 0 22px 20px; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 34px 0 48px; color: var(--dim); font-size: 14px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(5, 5, 8, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.3s; }
.modal-card { position: relative; width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 28px; opacity: 0; transform: translateY(16px) scale(0.97); transition: opacity 0.35s var(--ease-out), transform 0.45s var(--ease-out); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.8); }
.modal.show .modal-bg { opacity: 1; }
.modal.show .modal-card { opacity: 1; transform: none; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 20px; line-height: 1; transition: background-color 0.2s, transform 0.3s var(--ease-out); }
.modal-x:hover { background: rgba(255, 255, 255, 0.1); transform: rotate(90deg); }
.modal h3 { font: 700 24px/1.2 var(--display); letter-spacing: -0.02em; margin: 6px 0 6px; }
.modal .hint { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.seg2 { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.seg2 button { position: relative; z-index: 1; border: 0; background: none; height: 38px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: color 0.25s; }
.seg2 button[aria-selected="true"] { color: var(--gold-ink); }
.seg2 .pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--gold); border-radius: 999px; transition: transform 0.45s var(--ease-out); }
.seg2[data-mode="register"] .pill { transform: translateX(100%); }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13.5px; color: var(--muted); }
.field input { height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); outline: 0; font-size: 16px; transition: border-color 0.2s, box-shadow 0.25s; }
.field input:focus { border-color: rgba(246, 200, 76, 0.6); box-shadow: 0 0 0 4px rgba(246, 200, 76, 0.1); }
.form-err { color: var(--err); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.shake { animation: shake 0.42s var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.modal .btn { width: 100%; }

/* ---------------------------------------------------------------- app */
.app { min-height: 100svh; padding-top: 68px; background: radial-gradient(80% 40% at 50% 0%, rgba(246, 200, 76, 0.06), transparent 70%), var(--bg); }
.app-head { padding: 40px 0 8px; }
.app-head h1 { font: 700 clamp(28px, 4vw, 40px)/1.1 var(--display); letter-spacing: -0.03em; margin: 0; }
.app-head p { color: var(--muted); margin: 8px 0 0; }
.tabs { position: relative; display: inline-flex; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; margin: 26px 0 22px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 0 18px; height: 40px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: color 0.25s; display: inline-flex; gap: 8px; align-items: center; }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs .ind { position: absolute; top: 5px; bottom: 5px; left: 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out); }
.count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(246, 200, 76, 0.16); color: var(--gold); font-size: 12px; display: inline-grid; place-items: center; }
.count.bump { animation: bump 0.5s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.25); } }

.panel { animation: panelIn 0.5s var(--ease-out); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.input-lg { flex: 1 1 320px; min-width: 0; height: 56px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); outline: 0; font-size: 16px; transition: border-color 0.2s, box-shadow 0.25s; }
.input-lg:focus { border-color: rgba(246, 200, 76, 0.6); box-shadow: 0 0 0 4px rgba(246, 200, 76, 0.1); }
.opts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 16px; color: var(--muted); font-size: 14px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.chips input:checked + span { background: rgba(246, 200, 76, 0.14); border-color: rgba(246, 200, 76, 0.5); color: var(--text); }
.chips input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.drop { display: grid; place-items: center; text-align: center; gap: 8px; min-height: 220px; border-radius: var(--radius); border: 1.5px dashed var(--line-2); background: var(--bg-2); padding: 28px 18px; cursor: pointer; transition: border-color 0.25s, background-color 0.25s, transform 0.3s var(--ease-out); }
.drop:hover { border-color: rgba(246, 200, 76, 0.45); }
.drop.over { border-color: var(--gold); background: rgba(246, 200, 76, 0.06); transform: scale(1.01); }
.drop input { display: none; }
.drop .big { font: 600 18px/1.3 var(--display); }
.drop .small { color: var(--muted); font-size: 14px; }
.drop .file { color: var(--gold); font-weight: 600; }
.drop-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(246, 200, 76, 0.12); color: var(--gold); font-size: 24px; transition: transform 0.4s var(--ease-out); }
.drop:hover .drop-ico, .drop.over .drop-ico { transform: translateY(-4px) rotate(-6deg); }

/* progress */
.progress { margin-top: 18px; }
.progress .top { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.progress .msg { color: var(--text); }
.progress .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 0.6s var(--ease-out); position: relative; }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress.done .bar i::after, .progress.err .bar i::after { display: none; }
.progress.err .msg { color: var(--err); }
.stagelist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stagelist span { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); transition: color 0.3s, border-color 0.3s, background-color 0.3s; }
.stagelist span.now { color: var(--gold); border-color: rgba(246, 200, 76, 0.45); background: rgba(246, 200, 76, 0.08); }
.stagelist span.ok { color: var(--ok); border-color: rgba(60, 207, 145, 0.35); }

/* library */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform 0.4s var(--ease-out), border-color 0.25s; animation: itemIn 0.6s var(--ease-out) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.item:hover { transform: translateY(-4px); border-color: var(--line-2); }
.item.leaving { animation: itemOut 0.4s var(--ease-in-out) forwards; }
@keyframes itemOut { to { opacity: 0; transform: scale(0.94); } }
.item .thumb { aspect-ratio: 16 / 9; background: var(--surface-2) center / cover; position: relative; display: grid; place-items: center; color: var(--dim); font-size: 34px; }
.item .thumb .kind { position: absolute; left: 10px; top: 10px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(11, 11, 16, 0.78); color: var(--text); }
.item .body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.item .t { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .s { color: var(--dim); font-size: 13px; }
.item .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.del { border: 0; background: none; color: var(--dim); font-size: 13px; padding: 6px 10px; border-radius: 999px; transition: color 0.2s, background-color 0.2s; }
.del:hover { color: var(--err); }
.del.confirm { background: var(--err); color: #fff; }
.skel { border-radius: var(--radius); height: 250px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: skel 1.3s linear infinite; }
@keyframes skel { to { background-position: -150% 0; } }
.empty { text-align: center; padding: 70px 16px; color: var(--muted); }
.empty .big { font: 600 20px/1.3 var(--display); color: var(--text); margin: 14px 0 6px; }

/* result */
.result { margin-top: 36px; animation: panelIn 0.6s var(--ease-out); }
.res-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.res-head h2 { font: 700 clamp(22px, 3vw, 30px)/1.15 var(--display); letter-spacing: -0.02em; margin: 0; max-width: 28ch; }
.res-head .meta { color: var(--muted); font-size: 14px; margin-top: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.legend-sm { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin: 16px 0; }
.media { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 22px; }
.media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; }
.player { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.player small { color: var(--muted); }
midi-player { width: 100%; }
midi-player::part(control-panel) { background: var(--surface-2); border-radius: 12px; color: var(--text); }
midi-player::part(play-button) { background: var(--gold); color: var(--gold-ink); border-radius: 50%; }
@media (max-width: 820px) { .media { grid-template-columns: 1fr; } }
.pages { display: grid; gap: 22px; }
.pages img { width: 100%; background: #fff; border-radius: 10px; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9); opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.pages img.in { opacity: 1; transform: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 120; background: var(--surface-2); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 999px; font-size: 14.5px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9); opacity: 0; transform: translateY(16px); transition: opacity 0.3s, transform 0.4s var(--ease-out); pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: none; }

.user { display: inline-flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--flat), var(--sharp)); font-weight: 700; font-size: 14px; color: #fff; }
.user .name { color: var(--muted); font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .user .name { display: none; } }

/* view switching */
.view { animation: viewIn 0.55s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  [data-reveal], .fade-up, .hero h1 .line > span, .pages img { opacity: 1 !important; transform: none !important; }
}
@media print {
  body { background: #fff; }
  .nav, .app-head, .tabs, .panel, .res-head .actions, .legend-sm, .media, .fp, .orig, .sheet-h, .toast { display: none !important; }
  .app { padding: 0; background: #fff; }
  .pages img { box-shadow: none; opacity: 1; transform: none; page-break-after: always; }
}

/* ---------------------------------------------------------------- falling-notes player */
.fp { margin: 18px 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; outline: none; }
.fp-stage { position: relative; aspect-ratio: 16 / 9; background: #0b0b10; }
.fp-stage:fullscreen { aspect-ratio: auto; }
.fp-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.fp-status { position: absolute; left: 50%; top: 42%; translate: -50% -50%; padding: 8px 14px; border-radius: 999px; background: rgba(11, 11, 16, 0.8); font-size: 14px; color: var(--muted); pointer-events: none; }
.fp-status:empty { display: none; }
.fp-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.fp-play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--gold); display: grid; place-items: center; transition: transform 0.2s var(--ease-out), background-color 0.2s; }
.fp-play:hover { background: var(--gold-2); }
.fp-play:active { transform: scale(0.94); }
.fp-play span { width: 13px; height: 16px; margin-left: 4px; background: var(--gold-ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.fp-play.on span { width: 12px; height: 14px; margin: 0; clip-path: none; background: linear-gradient(90deg, var(--gold-ink) 0 4px, transparent 4px 8px, var(--gold-ink) 8px 12px); }
.fp-play.loading span { width: 18px; height: 18px; border: 2.5px solid rgba(26, 20, 5, 0.25); border-top-color: var(--gold-ink); border-radius: 50%; margin: 0; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fp-bar input[type=range] { flex: 1; min-width: 60px; accent-color: var(--gold); height: 4px; }
.fp-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.fp-btn, .fp-group button { border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--text); border-radius: 999px; height: 34px; padding: 0 12px; font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: background-color 0.2s, border-color 0.2s; white-space: nowrap; }
.fp-btn:hover, .fp-group button:hover { background: rgba(255, 255, 255, 0.07); }
.fp-group button[aria-pressed="true"], .fp-loop[aria-pressed="true"] { background: rgba(246, 200, 76, 0.14); border-color: rgba(246, 200, 76, 0.5); }
.fp-group button[aria-pressed="false"][data-hand] { opacity: 0.55; }
.fp-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 0 14px 14px; }
.fp-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fp-group > span { color: var(--dim); font-size: 13px; margin-right: 2px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.orig { margin: 0 0 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; }
.orig summary { cursor: pointer; padding: 14px 0; color: var(--muted); font-weight: 600; }
.orig iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; margin-bottom: 16px; background: #000; }
.sheet-h { font: 600 20px/1.2 var(--display); margin: 0 0 16px; }
@media (max-width: 560px) {
  .fp-bar { flex-wrap: wrap; }
  .fp-bar input[type=range] { order: 5; flex-basis: 100%; }
  .fp-btn[data-act=full] { margin-left: auto; }
}
