:root {
  --paper: #f5f8fa;
  --white: #ffffff;
  --ink: #102a43;
  --muted: #526777;
  --cobalt: #1958d1;
  --cobalt-dark: #103e9c;
  --rule: #b7c8d6;
  --soft-rule: #dbe5ec;
  --failure: #b42318;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent calc(50% - 550px), rgba(183, 200, 214, .28) calc(50% - 550px), rgba(183, 200, 214, .28) calc(50% - 549px), transparent calc(50% - 549px)),
    var(--paper);
  font-family: var(--sans);
  min-height: 100vh;
}

.masthead, main, footer { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.masthead {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; letter-spacing: .08em; }
.mark { color: var(--cobalt); font-size: 35px; line-height: 1; }
.engine, .eyebrow, .section-number, footer { font-size: 11px; letter-spacing: .16em; font-weight: 700; }
.engine { color: var(--muted); }

.intro { padding: 92px 0 76px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 80px; align-items: end; }
.eyebrow { color: var(--cobalt); grid-column: 1 / -1; margin: 0 0 25px; }
h1 { font: 700 clamp(48px, 6.2vw, 78px)/1.08 var(--serif); letter-spacing: -.045em; margin: 0; }
.lede { color: var(--muted); font-size: 17px; line-height: 1.9; margin: 0 0 8px; max-width: 470px; }

.workbench { border-top: 1px solid var(--ink); display: grid; grid-template-columns: 90px 1fr; padding: 34px 0 80px; }
.section-number { color: var(--cobalt); padding-top: 8px; }
.work-content { max-width: 760px; }
h2 { font: 700 29px/1.3 var(--serif); margin: 0 0 28px; }
form { display: grid; gap: 18px; }
.drop-zone {
  min-height: 260px;
  border: 1px dashed #86a0b4;
  background: rgba(255,255,255,.62);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--cobalt); background: var(--white); transform: translateY(-2px); }
.drop-zone:focus-within { outline: 3px solid rgba(25, 88, 209, .2); outline-offset: 3px; }
.drop-zone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-icon { border: 1px solid var(--cobalt); color: var(--cobalt); font-size: 11px; font-weight: 800; letter-spacing: .12em; padding: 10px 8px; margin-bottom: 24px; }
.drop-title { font: 700 22px/1.3 var(--serif); }
.drop-note { color: var(--muted); font-size: 13px; margin-top: 9px; }
.file-name { color: var(--cobalt); font-weight: 700; font-size: 13px; margin-top: 18px; max-width: 100%; overflow-wrap: anywhere; }
button, .primary, .secondary { font: 700 14px/1 var(--sans); }
.primary, .secondary {
  min-height: 50px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  text-decoration: none;
  border: 1px solid var(--cobalt);
  cursor: pointer;
}
.primary { color: white; background: var(--cobalt); }
.primary:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); }
.primary:disabled { background: #98a9b8; border-color: #98a9b8; cursor: not-allowed; }
.secondary { color: var(--cobalt); background: transparent; }
.secondary:hover { background: #edf3ff; }

.status-panel { margin-top: 28px; border: 1px solid var(--rule); background: var(--white); padding: 28px; }
.staff-progress { height: 86px; position: relative; overflow: hidden; }
.staff-progress i { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule); }
.staff-progress i:nth-child(1) { top: 20px; }.staff-progress i:nth-child(2) { top: 31px; }.staff-progress i:nth-child(3) { top: 42px; }.staff-progress i:nth-child(4) { top: 53px; }.staff-progress i:nth-child(5) { top: 64px; }
.note-head { position: absolute; color: var(--cobalt); font-size: 22px; top: 30px; left: 1%; transition: left .7s ease; text-shadow: 0 0 0 var(--cobalt); }
.note-head::after { content: ""; position: absolute; width: 1px; height: 34px; background: var(--cobalt); left: 15px; bottom: 8px; transform: rotate(4deg); transform-origin: bottom; }
.status-copy { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--soft-rule); padding-top: 20px; }
.status-label { font: 700 19px/1.3 var(--serif); margin: 0; }
.status-detail { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.status-time { font: 700 13px/1 var(--sans); color: var(--cobalt); }
.downloads { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.text-button { border: 0; color: var(--cobalt); background: none; padding: 18px 0 0; cursor: pointer; text-decoration: underline; }
.error { border-left: 3px solid var(--failure); color: var(--failure); background: #fff3f1; padding: 14px 16px; line-height: 1.55; }

.score-preview { margin: 42px 0 80px; border-top: 1px solid var(--ink); padding-top: 24px; }
.preview-toolbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 16px 0; background: rgba(245, 248, 250, .96); backdrop-filter: blur(8px); }
.preview-kicker { margin: 0 0 8px; color: var(--cobalt); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.preview-toolbar h2 { margin: 0; }
.preview-file { margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.preview-controls { display: flex; align-items: center; border: 1px solid var(--rule); background: var(--white); }
.preview-controls button, .preview-controls output { min-width: 44px; height: 42px; border: 0; border-right: 1px solid var(--soft-rule); background: transparent; color: var(--ink); display: grid; place-items: center; }
.preview-controls button { cursor: pointer; }
.preview-controls button:hover { background: #edf3ff; color: var(--cobalt); }
.preview-controls button:focus-visible { outline: 3px solid rgba(25, 88, 209, .25); outline-offset: -3px; }
.preview-controls button:disabled { color: #98a9b8; cursor: not-allowed; }
.preview-controls output { min-width: 64px; font: 700 12px/1 var(--sans); }
#preview-collapse { min-width: 92px; border-right: 0; }
.preview-message, .preview-error { margin: 18px 0; padding: 16px; border-left: 3px solid var(--cobalt); background: var(--white); color: var(--muted); }
.preview-error { border-color: var(--failure); color: var(--failure); }
.preview-error button { margin-left: 16px; border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.score-canvas { min-height: 240px; overflow-x: auto; background: var(--white); border: 1px solid var(--soft-rule); padding: 28px 20px; box-shadow: 0 20px 60px rgba(16, 42, 67, .08); }
.score-canvas > div, .score-canvas svg { min-width: 720px; }

.notes { border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 100px; }
.notes article { padding: 30px 30px 0 0; border-right: 1px solid var(--soft-rule); min-height: 180px; }
.notes article + article { padding-left: 30px; }
.notes article:last-child { border-right: 0; }
.notes span { color: var(--cobalt); font: 700 11px/1 var(--sans); letter-spacing: .12em; }
.notes h3 { font: 700 18px/1.3 var(--serif); margin: 20px 0 8px; }
.notes p { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0; }
footer { min-height: 74px; border-top: 1px solid var(--ink); display: flex; justify-content: space-between; align-items: center; color: var(--muted); }

[hidden] { display: none !important; }
@media (max-width: 720px) {
  .masthead, main, footer { width: min(100% - 30px, 1100px); }
  .engine { display: none; }
  .intro { padding: 64px 0 54px; grid-template-columns: 1fr; gap: 30px; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .workbench { grid-template-columns: 1fr; padding-top: 22px; }
  .section-number { margin-bottom: 18px; }
  .drop-zone { min-height: 220px; }
  .preview-toolbar { align-items: stretch; flex-direction: column; }
  .preview-controls { width: 100%; }
  .preview-controls button, .preview-controls output { flex: 1; }
  .score-canvas { padding: 18px 8px; }
  .notes { grid-template-columns: 1fr; }
  .notes article, .notes article + article { border-right: 0; border-bottom: 1px solid var(--soft-rule); padding: 26px 0; min-height: auto; }
  footer { gap: 18px; flex-wrap: wrap; padding: 24px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
