:root {
  color-scheme: light;
  --paper: #f2ece2;
  --paper-bright: #fbf8f1;
  --paper-deep: #ddd3c5;
  --ink: #22211e;
  --ink-rgb: 34, 33, 30;
  --ink-soft: #5f5a52;
  --silver: #aaa59b;
  --line: rgba(45, 41, 35, 0.18);
  --line-strong: rgba(37, 34, 29, 0.32);
  --danger: #9d3e34;
  --accent: #aa704c;
  --accent-rgb: 170, 112, 76;
  --photo-color-1: #cc8761;
  --photo-color-1-rgb: 204, 135, 97;
  --photo-color-1-x: 76%;
  --photo-color-1-y: 32%;
  --photo-color-2: #285b6a;
  --photo-color-2-rgb: 40, 91, 106;
  --photo-color-2-x: 22%;
  --photo-color-2-y: 30%;
  --photo-color-3: #142938;
  --photo-color-3-rgb: 20, 41, 56;
  --photo-color-3-x: 14%;
  --photo-color-3-y: 64%;
  --photo-color-4: #351f37;
  --photo-color-4-rgb: 53, 31, 55;
  --photo-color-4-x: 76%;
  --photo-color-4-y: 78%;
  --photo-color-5: #fff4c6;
  --photo-color-5-rgb: 255, 244, 198;
  --photo-color-5-x: 70%;
  --photo-color-5-y: 29%;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Inter, Avenir, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 28px 80px rgba(48, 41, 33, 0.13);
  --shadow-soft: 0 14px 42px rgba(48, 41, 33, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(60rem 42rem at var(--photo-color-1-x) var(--photo-color-1-y), rgba(var(--photo-color-1-rgb), 0.055), transparent 70%),
    radial-gradient(52rem 40rem at var(--photo-color-2-x) var(--photo-color-2-y), rgba(var(--photo-color-2-rgb), 0.04), transparent 72%),
    linear-gradient(135deg, var(--paper-bright), var(--paper) 58%, #e7dfd4);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
}

button,
input,
select {
  font: inherit;
}

button,
label,
summary,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
select,
summary,
input {
  outline-color: var(--accent);
  outline-offset: 3px;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--paper-bright);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(1440px, calc(100% - 64px));
  min-height: 82px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: max-content;
  font: 500 clamp(1.12rem, 2vw, 1.55rem) / 1 var(--serif);
  letter-spacing: 0.24em;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--ink);
}

.header-tagline,
.step-label,
.control-kicker,
.reading-label,
.edition-strip,
.ritual-copy small {
  font: 500 0.67rem / 1.3 var(--mono);
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.header-tagline {
  margin: 0;
  color: var(--ink-soft);
}

.header-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}

.privacy-pill {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.privacy-pill span {
  margin-right: 7px;
  color: #627d65;
}

.text-button {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 3px 0;
  background: none;
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.text-button:hover {
  color: var(--accent);
}

.hero {
  position: relative;
  width: min(1440px, calc(100% - 64px));
  min-height: min(790px, calc(100vh - 82px));
  margin: 0 auto;
  padding: clamp(74px, 9vw, 138px) 0 clamp(84px, 10vw, 152px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 0.72fr);
  align-items: center;
  gap: clamp(60px, 9vw, 150px);
}

.hero::after {
  position: absolute;
  right: -10vw;
  bottom: 7%;
  width: 45vw;
  height: 22vw;
  min-height: 220px;
  z-index: -1;
  border-radius: 50%;
  content: "";
  background: radial-gradient(ellipse, rgba(var(--photo-color-1-rgb), 0.11), transparent 67%);
  filter: blur(28px);
}

.eyebrow,
.step-label,
.control-kicker {
  margin: 0 0 22px;
  color: var(--ink-soft);
}

.hero h1,
.section-heading h2,
.introduction h2,
.export-panel h3,
.world-library-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.hero h1 {
  max-width: 820px;
  font-size: clamp(3.2rem, 6.8vw, 7.4rem);
  line-height: 0.94;
}

.hero-copy {
  max-width: 670px;
  margin: 36px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.04rem, 1.4vw, 1.25rem);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 14px 0 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.hero-specimen {
  position: relative;
  min-height: clamp(390px, 43vw, 620px);
}

.hero-vellum {
  position: absolute;
  inset: 2% 10% 9% 0;
  z-index: 2;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background:
    radial-gradient(75% 65% at var(--photo-color-5-x) var(--photo-color-5-y), rgba(var(--photo-color-5-rgb), 0.84), transparent 60%),
    radial-gradient(100% 82% at var(--photo-color-1-x) var(--photo-color-1-y), rgba(var(--photo-color-1-rgb), 0.72), transparent 67%),
    radial-gradient(90% 80% at var(--photo-color-2-x) var(--photo-color-2-y), rgba(var(--photo-color-2-rgb), 0.74), transparent 69%),
    radial-gradient(80% 60% at var(--photo-color-4-x) var(--photo-color-4-y), rgba(var(--photo-color-4-rgb), 0.58), transparent 72%),
    rgba(248, 243, 233, 0.64);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(0.88);
}

.hero-vellum::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, rgba(255,255,255,.38), transparent 32%, rgba(255,255,255,.08) 66%, rgba(255,255,255,.25));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.specimen-number {
  position: relative;
  z-index: 2;
  font: 0.66rem var(--mono);
  letter-spacing: 0.15em;
}

.specimen-staff {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 24%;
  z-index: 2;
  height: 54px;
  opacity: 0.46;
  background: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(28, 27, 25, 0.6) 9px 10px);
}

.hero-vellum em {
  position: absolute;
  right: 8%;
  bottom: 8%;
  z-index: 2;
  color: rgba(30, 29, 27, 0.86);
  font: italic clamp(1rem, 1.6vw, 1.45rem) / 1.25 var(--serif);
  text-align: right;
}

.specimen-bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
}

.bloom-a {
  width: 45%;
  height: 35%;
  left: 1%;
  top: 9%;
  background: rgba(var(--photo-color-2-rgb), 0.35);
}

.bloom-b {
  width: 48%;
  height: 43%;
  right: 1%;
  bottom: 5%;
  background: rgba(var(--photo-color-1-rgb), 0.34);
}

.hero-disc {
  position: absolute;
  right: -1%;
  top: 22%;
  width: 55%;
  aspect-ratio: 1;
  z-index: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #111 0 3px, #292826 4px 5px, #151514 6px 9px);
  box-shadow: 18px 28px 60px rgba(27, 24, 20, 0.34);
}

.hero-disc::before,
.hero-disc i {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, #222 0 4%, transparent 5%),
    radial-gradient(circle at 36% 28%, rgba(var(--photo-color-5-rgb), 0.88), transparent 48%),
    var(--photo-color-1);
}

.hero-disc::after {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  content: "";
  background: linear-gradient(120deg, rgba(255,255,255,.22), transparent 22% 64%, rgba(255,255,255,.08));
  transform: rotate(-18deg);
}

.protocol-notice {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 30px;
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  border: 1px solid #b85d4e;
  background: #fff1eb;
  box-shadow: var(--shadow-soft);
}

.protocol-notice__mark {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  background: #a34236;
  font-weight: 700;
}

.protocol-notice p {
  margin: 4px 0 0;
  color: #6d3c35;
  font-size: 0.88rem;
}

.studio-shell,
.player-section,
.introduction {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
}

.studio-shell {
  padding: clamp(78px, 9vw, 132px) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 42px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 44px;
}

.section-heading h2 {
  max-width: 820px;
  font-size: clamp(2.3rem, 4.6vw, 4.8rem);
  line-height: 1;
}

.section-note {
  max-width: 380px;
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(490px, 1.18fr);
  gap: clamp(28px, 4vw, 58px);
  align-items: start;
}

.upload-column {
  position: sticky;
  top: 24px;
}

.drop-zone {
  position: relative;
  min-height: 525px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(80% 70% at var(--photo-color-1-x) var(--photo-color-1-y), rgba(var(--photo-color-1-rgb), 0.17), transparent 72%),
    radial-gradient(70% 70% at var(--photo-color-2-x) var(--photo-color-2-y), rgba(var(--photo-color-2-rgb), 0.14), transparent 72%),
    rgba(251, 248, 241, 0.72);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.drop-zone > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.drop-empty {
  padding: 38px;
  display: grid;
  place-items: center;
  text-align: center;
}

.drop-empty strong {
  margin-top: 24px;
  font: 400 clamp(1.45rem, 2.3vw, 2rem) var(--serif);
}

.drop-empty small {
  margin-top: 10px;
  color: var(--ink-soft);
  font: 0.68rem var(--mono);
  letter-spacing: 0.12em;
}

.upload-orbit {
  position: relative;
  width: 112px;
  height: 112px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.upload-orbit::before,
.upload-orbit::after,
.upload-orbit span {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  border-radius: 50%;
  content: "";
}

.upload-orbit::after {
  inset: 34%;
  background: rgba(var(--accent-rgb), 0.12);
}

.upload-orbit span:first-child {
  inset: 47%;
  border: 0;
  background: var(--ink);
}

.drop-preview {
  position: absolute;
  inset: 0;
}

.drop-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.drop-preview::after {
  position: absolute;
  inset: 55% 0 0;
  content: "";
  background: linear-gradient(transparent, rgba(24, 22, 19, 0.72));
}

.replace-image {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 2;
  color: #fff;
  font: 0.72rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.upload-actions {
  padding: 16px 2px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.upload-actions p {
  margin: 0;
}

.image-reading {
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.6);
}

.reading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.reading-row p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.palette {
  display: flex;
  gap: 6px;
}

.palette span {
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(25, 23, 20, 0.17);
}

.controls-card {
  padding: clamp(30px, 4vw, 54px);
  border: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.74);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.worlds-section,
.control-group,
.advanced-settings {
  border: 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 0 0 30px;
}

.control-group,
.advanced-settings {
  padding-top: 28px;
}

.worlds-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.worlds-intro h3,
.score-header h3,
.world-card h3,
.introduction h3 {
  margin: 0;
  font: 400 1.55rem / 1.1 var(--serif);
}

.world-recommendations {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.world-card {
  min-height: 148px;
  padding: 18px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: linear-gradient(145deg, var(--world-wash, rgba(var(--accent-rgb), .09)), rgba(255,255,255,.34));
  cursor: pointer;
  transition: border-color 170ms ease, transform 170ms ease, background 170ms ease;
}

.world-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.world-card.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.24);
}

.world-card.world-feature {
  grid-row: span 2;
  min-height: 308px;
  justify-content: end;
  animation: world-card-promote 240ms ease-out both;
}

@keyframes world-card-promote {
  from {
    opacity: 0.72;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.world-card__meta,
.world-card__keywords,
.world-card__sound {
  margin: 0;
  color: var(--ink-soft);
}

.world-card__meta {
  margin-bottom: auto;
  font: 0.64rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-card__keywords {
  margin-top: 10px;
  font-size: 0.7rem;
}

.world-card__sound {
  margin-top: 7px;
  font: italic 0.83rem / 1.4 var(--serif);
}

.style-selection-status,
.prototype-note,
.form-message,
.export-status {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.control-group legend {
  width: 100%;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  font: 400 1.08rem var(--serif);
}

.control-group legend span {
  color: var(--ink-soft);
  font: 0.62rem var(--mono);
  letter-spacing: 0.16em;
}

.select-wrap,
.advanced-grid label {
  display: grid;
}

select {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
}

.segmented,
.texture-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.segmented label,
.texture-options label {
  position: relative;
  cursor: pointer;
}

.segmented input,
.texture-options input {
  position: absolute;
  opacity: 0;
}

.segmented span,
.texture-card {
  min-height: 46px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-align: center;
  background: rgba(255, 253, 248, 0.34);
}

.segmented input:checked + span,
.texture-options input:checked + .texture-card {
  border-color: var(--ink);
  background: rgba(var(--accent-rgb), 0.09);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.texture-card {
  min-height: 108px;
  gap: 4px;
}

.texture-card strong {
  font: 400 1rem var(--serif);
}

.texture-card small {
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.texture-glyph {
  width: 36px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.texture-glyph.glass {
  background: linear-gradient(120deg, rgba(255,255,255,.8), rgba(var(--photo-color-2-rgb),.22));
}

.texture-glyph.velvet {
  background: radial-gradient(circle, rgba(var(--accent-rgb),.38), rgba(31,29,27,.9));
}

.texture-glyph.tape {
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(31,29,27,.75) 0 2px, transparent 2px 5px);
}

.advanced-settings summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  font-family: var(--serif);
  list-style: none;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary::after {
  content: "+";
  font-family: var(--sans);
}

.advanced-settings[open] summary::after {
  content: "−";
}

.advanced-settings summary span {
  color: var(--ink-soft);
  font: 0.66rem var(--mono);
}

.advanced-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 20px;
}

.advanced-grid label > span {
  color: var(--ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.density-control {
  grid-column: 1 / -1;
}

.density-control input {
  margin: 14px 0 5px;
  accent-color: var(--accent);
}

.density-control output {
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.form-message {
  min-height: 1.2em;
  color: var(--danger);
}

.primary-button {
  width: 100%;
  min-height: 76px;
  margin-top: 24px;
  padding: 18px 24px;
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--paper-bright);
  background: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.12rem;
  transition: background 180ms ease, transform 180ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #393631;
  transform: translateY(-2px);
}

.primary-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.button-disc {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.64);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px var(--ink), inset 0 0 0 9px rgba(255,255,255,.44);
}

.player-section {
  padding: clamp(88px, 10vw, 150px) 0;
}

.player-heading {
  align-items: end;
}

.track-facts {
  max-width: 620px;
  color: var(--ink-soft);
  font: 0.66rem / 1.65 var(--mono);
  text-align: right;
}

.player-frame {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(248, 244, 235, 0.72);
  box-shadow: var(--shadow);
}

.edition-strip {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
}

.living-player-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(390px, 0.87fr);
}

.record-panel,
.score-panel {
  min-width: 0;
}

.record-panel {
  border-right: 1px solid var(--line);
}

.visual-stage {
  position: relative;
  min-height: 570px;
  aspect-ratio: 1.16;
  overflow: hidden;
  background: #e7dfd3;
}

#visualCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-play {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  color: #fff;
  background: rgba(25,23,20,.72);
  box-shadow: 0 10px 28px rgba(22,19,16,.24);
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.stage-play span,
.play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.stage-play span {
  margin: auto;
  transform: translateX(2px);
}

.stage-play.is-playing span,
.transport-main.is-playing .play-icon {
  width: 10px;
  height: 14px;
  margin: auto;
  border: 0;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.score-panel {
  padding: 30px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 252, 245, 0.62);
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.score-header p {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font: 0.61rem var(--mono);
  letter-spacing: 0.12em;
}

.score-header > span {
  color: var(--ink-soft);
  font: 0.62rem var(--mono);
}

.score-shell {
  min-width: 0;
  margin: auto 0;
  padding: 24px 0;
}

.living-score,
.living-score__scroller {
  min-width: 0;
  width: 100%;
}

.living-score__scroller {
  cursor: grab;
  scrollbar-color: rgba(var(--accent-rgb), .4) transparent;
  scrollbar-width: thin;
}

.living-score__scroller.is-dragging {
  cursor: grabbing;
}

.living-score__sheet {
  display: block;
  overflow: visible;
}

.living-score__staff-line,
.living-score__bar-line,
.living-score__ledger-line,
.living-score__stem,
.living-score__flag {
  stroke: #77736b;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.living-score__bar-line--final {
  stroke-width: 2;
}

.living-score__note-head,
.living-score__aux-mark {
  fill: #77736b;
  stroke: #77736b;
}

.living-score__note-head--open {
  fill: var(--paper-bright);
}

.living-score__measure-number,
.living-score__time-signature,
.living-score__accidental {
  fill: #77736b;
  font-family: var(--serif);
}

.living-score__measure-hit-area {
  fill: transparent;
}

.living-score__event {
  transition: opacity 140ms ease, filter 140ms ease;
}

.living-score__event.is-upcoming {
  opacity: 0.25;
}

.living-score__event.is-past {
  opacity: 0.4;
}

.living-score__event.is-active {
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--event-color, #b87550));
}

.living-score__event.is-active .living-score__note-head,
.living-score__event.is-active .living-score__aux-mark {
  fill: #171614;
  stroke: #171614;
}

.living-score__event.is-active .living-score__stem,
.living-score__event.is-active .living-score__ledger-line,
.living-score__event.is-active .living-score__flag {
  stroke: #171614;
}

.living-score__measure.is-current .living-score__measure-hit-area {
  fill: rgba(var(--accent-rgb), 0.045);
}

.score-legend {
  margin: 0;
  color: var(--ink-soft);
  font: italic 0.8rem / 1.5 var(--serif);
}

.score-legend i {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .11);
}

.transport {
  padding: 22px 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
}

.transport-main {
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
}

.timeline-wrap {
  min-width: 0;
}

#timeline {
  width: 100%;
  height: 2px;
  margin: 0;
  appearance: none;
  background: linear-gradient(to right, var(--ink) var(--timeline-progress, 0%), var(--line-strong) var(--timeline-progress, 0%));
}

#timeline::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}

#timeline::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}

.time-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  color: var(--ink-soft);
  font: 0.64rem var(--mono);
}

.time-row p {
  margin: 0;
  text-align: center;
}

.time-row span:last-child {
  text-align: right;
}

.export-panel {
  margin-top: 36px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.85fr 1.4fr;
  gap: 36px;
  background: rgba(250,247,240,.64);
}

.export-panel h3 {
  font-size: clamp(1.9rem, 3vw, 3.1rem);
  line-height: 1;
}

.export-panel > div > p:not(.step-label) {
  color: var(--ink-soft);
  font-family: var(--serif);
}

.export-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.export-button {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  text-align: left;
  background: rgba(255,253,248,.42);
  cursor: pointer;
}

.export-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .07);
}

.export-button:disabled {
  opacity: 0.4;
}

.export-button span {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font: 0.61rem var(--mono);
  letter-spacing: 0.1em;
}

.export-button strong {
  font: 400 1rem var(--serif);
}

.export-status,
.start-over {
  grid-column: 1 / -1;
}

.start-over {
  width: max-content;
}

.introduction {
  padding: clamp(100px, 12vw, 180px) 0;
  border-top: 1px solid var(--line);
}

.introduction-head h2 {
  max-width: 1120px;
  font-size: clamp(2.8rem, 5.2vw, 5.8rem);
  line-height: 0.98;
}

.introduction-opening {
  max-width: 1080px;
  margin-top: clamp(42px, 6vw, 76px);
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.introduction-opening p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.introduction-opening p:first-child {
  color: var(--ink);
  font-size: clamp(1.24rem, 2vw, 1.72rem);
  line-height: 1.45;
}

.introduction-opening p:last-child {
  padding-left: 24px;
  border-left: 1px solid var(--ink);
  font-style: italic;
  line-height: 1.65;
}

.introduction-source-grid {
  margin-top: clamp(74px, 9vw, 124px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.introduction-panel {
  min-width: 0;
  padding: clamp(30px, 4vw, 54px);
  border-right: 1px solid var(--line);
}

.introduction-panel:last-child {
  border-right: 0;
}

.introduction-index {
  margin: 0;
  color: var(--ink-soft);
  font: 0.62rem var(--mono);
  letter-spacing: 0.13em;
}

.introduction-panel h3,
.control-guide h3,
.introduction-closing-grid h3 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.03;
}

.introduction-panel h3 {
  max-width: 520px;
  margin-top: 40px;
}

.mapping-list {
  margin: 48px 0 0;
}

.mapping-list > div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 24px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
}

.mapping-list dt,
.control-ledger dt {
  color: var(--ink);
  font: 0.65rem var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mapping-list dd,
.control-ledger dd {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  line-height: 1.62;
}

.introduction-panel--choice {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 22%, rgba(var(--photo-color-2-rgb), .12), transparent 34%),
    linear-gradient(145deg, rgba(var(--photo-color-1-rgb), .07), transparent 52%);
}

.introduction-panel--choice > p:not(.introduction-index),
.introduction-panel-lead {
  max-width: 570px;
  color: var(--ink-soft);
  font-family: var(--serif);
  line-height: 1.68;
}

.introduction-panel-lead {
  margin-top: 48px;
  color: var(--ink) !important;
  font-size: 1.16rem;
}

.introduction-note {
  max-width: 500px;
  margin-top: clamp(54px, 9vw, 112px);
  padding: 26px 28px 28px;
  border: 1px solid rgba(var(--ink-rgb), .28);
  background: rgba(255, 255, 255, .28);
  backdrop-filter: blur(18px) saturate(.86);
}

.introduction-note span {
  color: var(--ink-soft);
  font: 0.59rem var(--mono);
  letter-spacing: 0.13em;
}

.introduction-note p {
  margin: 28px 0 0;
  font: italic clamp(1.1rem, 1.8vw, 1.4rem) / 1.5 var(--serif);
}

.control-guide {
  padding: clamp(92px, 11vw, 152px) 0;
}

.control-guide-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 64px;
  align-items: end;
}

.control-guide-head h3 {
  margin-top: 26px;
}

.control-guide-head > p {
  max-width: 430px;
  margin: 0 0 5px auto;
  color: var(--ink-soft);
  font-family: var(--serif);
  line-height: 1.65;
}

.control-ledger {
  margin: 58px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.control-ledger > div {
  min-height: 162px;
  padding: 28px clamp(22px, 3vw, 42px);
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.control-ledger > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.control-ledger > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.control-ledger strong {
  color: var(--ink);
  font-weight: 500;
}

.introduction-closing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.introduction-closing-grid article {
  min-height: 440px;
  padding: clamp(34px, 4vw, 58px);
  border-right: 1px solid var(--line);
}

.introduction-closing-grid article:last-child {
  border-right: 0;
}

.introduction-closing-grid h3 {
  max-width: 520px;
  margin-top: 54px;
}

.introduction-closing-grid article > p:not(.introduction-index) {
  max-width: 560px;
  color: var(--ink-soft);
  font-family: var(--serif);
  line-height: 1.68;
}

.introduction-coda {
  margin: clamp(82px, 11vw, 150px) auto 0;
  text-align: center;
  font: italic clamp(2rem, 4.4vw, 4.8rem) / 1.08 var(--serif);
}

.site-footer {
  width: min(1440px, calc(100% - 64px));
  min-height: 96px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-soft);
  font: 0.64rem var(--mono);
  letter-spacing: 0.1em;
}

.site-footer p {
  font: italic 1rem var(--serif);
  letter-spacing: 0;
}

.world-library {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
}

.world-library-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(25,23,20,.68);
  backdrop-filter: blur(12px);
}

.world-library-panel {
  position: relative;
  width: min(1180px, calc(100% - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: clamp(28px, 4vw, 52px);
  background: var(--paper-bright);
  box-shadow: 0 34px 100px rgba(0,0,0,.32);
}

.world-library-head {
  position: relative;
  padding-right: 60px;
  display: flex;
  justify-content: space-between;
  gap: 36px;
}

.world-library-head h2 {
  font-size: clamp(2.2rem, 4vw, 4.2rem);
}

.world-library-head p:last-child {
  max-width: 500px;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.world-library-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
}

.world-library-grid {
  margin-top: 48px;
  display: grid;
  gap: 44px;
}

.world-group-title {
  margin: 0 0 16px;
  display: flex;
  justify-content: space-between;
  font: 400 1.6rem var(--serif);
}

.world-group-title small {
  color: var(--ink-soft);
  font: 0.62rem var(--mono);
  letter-spacing: 0.1em;
}

.world-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ritual {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  background: var(--paper);
}

.ritual canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ritual-stage {
  position: absolute;
  left: 50%;
  bottom: 11%;
  width: min(520px, calc(100% - 48px));
  padding: 26px 30px;
  border: 1px solid rgba(255,255,255,.45);
  text-align: center;
  background: rgba(250,246,238,.58);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.ritual-copy p {
  margin: 0 0 16px;
  font: 400 1.4rem var(--serif);
}

.ritual-line {
  height: 2px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--line);
}

.ritual-progress {
  width: 0;
  height: 100%;
  display: block;
  background: var(--accent);
  transition: width 360ms ease;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .header-tagline {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(350px, .75fr);
    gap: 40px;
  }

  .composer-grid {
    grid-template-columns: minmax(310px, .78fr) minmax(430px, 1.22fr);
  }

  .living-player-grid {
    grid-template-columns: 1fr;
  }

  .record-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .visual-stage {
    aspect-ratio: 16 / 10;
    min-height: 520px;
  }

  .world-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header,
  .hero,
  .studio-shell,
  .player-section,
  .introduction,
  .site-footer {
    width: min(100% - 36px, 720px);
  }

  .site-header {
    min-height: 70px;
  }

  .privacy-pill {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 76px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 13vw, 6rem);
  }

  .hero-specimen {
    min-height: 500px;
  }

  .composer-grid {
    grid-template-columns: 1fr;
  }

  .upload-column {
    position: static;
  }

  .section-heading,
  .world-library-head {
    display: block;
  }

  .section-note {
    margin-top: 22px;
  }

  .track-facts {
    margin-top: 18px;
    text-align: left;
  }

  .export-panel {
    grid-template-columns: 1fr;
  }

  .export-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .introduction-opening,
  .introduction-source-grid,
  .control-guide-head,
  .control-ledger,
  .introduction-closing-grid {
    grid-template-columns: 1fr;
  }

  .introduction-opening p:last-child {
    padding: 22px 0 0;
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .introduction-panel,
  .introduction-closing-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .introduction-panel:last-child,
  .introduction-closing-grid article:last-child {
    border-bottom: 0;
  }

  .control-guide-head > p {
    margin: 28px 0 0;
  }

  .control-ledger > div,
  .control-ledger > div:nth-child(odd),
  .control-ledger > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-ledger > div:last-child {
    border-bottom: 0;
  }

  .world-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .site-header,
  .hero,
  .studio-shell,
  .player-section,
  .introduction,
  .site-footer {
    width: calc(100% - 28px);
  }

  .wordmark {
    letter-spacing: 0.15em;
  }

  .header-meta .text-button {
    font-size: 0.69rem;
  }

  .hero {
    padding-top: 58px;
  }

  .hero-copy br {
    display: none;
  }

  .hero-specimen {
    min-height: 390px;
  }

  .hero-vellum {
    inset: 0 8% 8% 0;
  }

  .controls-card,
  .score-panel {
    padding: 24px 18px;
  }

  .drop-zone {
    min-height: 390px;
  }

  .world-recommendations {
    grid-template-columns: 1fr;
  }

  .world-card.world-feature {
    min-height: 190px;
    grid-row: auto;
  }

  .segmented,
  .texture-options,
  .advanced-grid,
  .export-actions,
  .world-group-grid {
    grid-template-columns: 1fr;
  }

  .duration-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .introduction-head h2 br {
    display: none;
  }

  .introduction-panel,
  .introduction-closing-grid article {
    padding: 30px 20px;
  }

  .mapping-list > div,
  .control-ledger > div {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 0;
  }

  .introduction-note {
    padding: 22px;
  }

  .introduction-coda br {
    display: none;
  }

  .density-control {
    grid-column: auto;
  }

  .edition-strip span:nth-child(2) {
    display: none;
  }

  .visual-stage {
    min-height: 380px;
    aspect-ratio: .86;
  }

  .transport {
    padding: 18px;
    gap: 16px;
  }

  .time-row {
    grid-template-columns: 48px 1fr 48px;
  }

  .time-row p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .export-button {
    min-height: 94px;
  }

  .site-footer {
    padding: 30px 0;
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .hero-vellum,
  .controls-card,
  .introduction-note,
  .world-library-backdrop,
  .ritual-stage {
    backdrop-filter: none;
  }

  .hero-vellum,
  .controls-card,
  .score-panel,
  .ritual-stage {
    background-color: var(--paper-bright);
  }
}
