@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #0a191e;
  --deep: #07151a;
  --surface: #10252b;
  --surface-soft: #142c31;
  --ivory: #f1eee2;
  --muted: #a3b7b5;
  --faint: #7b9492;
  --seafoam: #b8ddd0;
  --seafoam-dark: #1f4445;
  --gold: #c9ad73;
  --line: rgba(192, 220, 210, .16);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ivory);
  background: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button { border: 0; background: none; }
button:disabled { opacity: .48; cursor: not-allowed; }
input, select { min-width: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
ol, ul, dl { margin: 0; padding: 0; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
legend { padding: 0; }
button, input, select, a { touch-action: manipulation; }
::selection { background: var(--seafoam); color: var(--ink); }
[hidden], .view[hidden] { display: none !important; }
.skip-link { position: fixed; top: 10px; left: 10px; padding: 8px 18px; z-index: 100; background: var(--seafoam); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { display: flex; align-items: center; justify-content: space-between; height: 100px; padding: 0 clamp(24px, 5.4vw, 92px); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { padding: 0; display: flex; align-items: center; gap: 18px; text-align: left; }
.brand-wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 25px; letter-spacing: .055em; line-height: 1; white-space: nowrap; }
.brand-dot { color: var(--gold); margin-left: 3px; }
.brand-chinese { font-size: 12px; letter-spacing: .21em; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--line); }
.primary-nav { display: flex; align-items: center; gap: 35px; }
.primary-nav button { font-size: 14px; padding: 10px 0; color: var(--muted); transition: color .2s; white-space: nowrap; }
.primary-nav button:hover, .primary-nav button.active, .primary-nav button[aria-current="page"] { color: var(--ivory); }
.primary-nav .settings-trigger { display: flex; align-items: center; gap: 8px; margin-left: 3px; }
.settings-trigger svg { width: 19px; height: 19px; }
.settings-trigger span { font-size: 13px; }
main { outline: none; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .21em; line-height: 1.6; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 28px; min-height: 54px; padding: 13px 25px; font-size: 15px; letter-spacing: .035em; border: 1px solid transparent; border-radius: 3px; line-height: 1.5; transition: background .18s, color .18s, border-color .18s, transform .18s; }
.button-primary { background: var(--seafoam); color: var(--deep); }
.button-primary:hover { background: #c9e9dc; transform: translateY(-1px); }
.button-primary > span:last-child:not(:first-child) { font-size: 21px; line-height: 1; }
.button-secondary { border-color: rgba(192, 220, 210, .35); color: var(--ivory); }
.button-secondary:hover { border-color: var(--seafoam); background: rgba(184, 221, 208, .05); }
.button-quiet { padding-left: 5px; padding-right: 5px; color: var(--ivory); gap: 10px; }
.button-quiet:hover { color: var(--seafoam); }
.play-symbol { font-size: 23px; font-family: Georgia, serif; line-height: 1; }
.text-button { padding: 9px 0; color: var(--muted); font-size: 14px; text-align: left; display: inline-flex; align-items: center; gap: 15px; }
.text-button:hover { color: var(--seafoam); }
.text-button > span { font-size: 18px; }
.gold-period { color: var(--gold); }
.tiny-line { display: inline-block; width: 25px; height: 1px; vertical-align: middle; background: var(--gold); margin-right: 12px; }

.home-view { min-height: calc(100svh - 165px); position: relative; isolation: isolate; display: flex; flex-direction: column; overflow: hidden; padding: 0 clamp(24px, 7.4vw, 126px); }
.home-atmosphere { position: absolute; z-index: -2; inset: 0 0 0 24%; background: url("background.png") center 45% / cover no-repeat; opacity: .7; }
.home-view::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, var(--ink) 8%, rgba(10, 25, 30, .97) 24%, rgba(10, 25, 30, .59) 51%, rgba(10, 25, 30, .08) 84%), linear-gradient(0deg, var(--ink) 0%, transparent 42%, rgba(10, 25, 30, .13) 100%); }
.hero-content { padding-top: clamp(70px, 10vh, 140px); padding-bottom: 72px; max-width: 710px; position: relative; }
.hero-content .eyebrow { font-size: 12px; letter-spacing: .19em; }
.hero-content h1 { font-family: var(--serif); font-size: clamp(48px, 5.1vw, 78px); letter-spacing: .035em; line-height: 1.4; margin: 26px 0 24px; font-weight: 400; }
.hero-copy { color: #b8c9c3; font-size: 17px; line-height: 1.95; font-weight: 300; letter-spacing: .025em; }
.hero-actions { display: flex; align-items: center; gap: 27px; margin-top: 38px; }
.hero-actions .button-primary { min-width: 173px; }
.studio-link { margin-top: 19px; font-size: 13px; }
.hero-note { font-size: 12px; color: var(--faint); margin-top: 17px; letter-spacing: .06em; }
.hero-note span { margin: 0 7px; }
.hero-art-caption { position: absolute; right: 5.5vw; bottom: 205px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 12px; color: #c2d0c3; letter-spacing: .16em; }
.hero-art-caption span:last-child { font-size: 12px; opacity: .75; }
.gesture-story { margin-top: auto; list-style: none; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; padding: 32px 0 39px; border-top: 1px solid var(--line); }
.gesture-story li { display: flex; gap: 22px; align-items: baseline; }
.gesture-index { font-family: Georgia, serif; color: var(--gold); font-size: 14px; }
.gesture-story strong { font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: .12em; }
.gesture-story p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 65px; padding: 17px clamp(24px, 5.4vw, 92px); border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; letter-spacing: .075em; }
.footer-divider { padding: 0 8px; opacity: .6; }
.site-footer > span:nth-child(2) { font-family: var(--serif); font-size: 12px; letter-spacing: .12em; }
.version > span { margin-left: 8px; font-size: 12px; opacity: .7; }

.page-shell { max-width: 1350px; margin: 0 auto; padding: 64px clamp(24px, 6.5vw, 90px) 80px; min-height: calc(100svh - 165px); }
.page-heading { margin-bottom: 45px; }
.page-heading h1 { font-family: var(--serif); font-size: clamp(34px, 3.3vw, 50px); line-height: 1.45; margin: 13px 0 13px; letter-spacing: .045em; }
.page-heading > p:last-child, .page-heading > div > p:last-child { color: var(--muted); font-size: 15px; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .8fr); gap: clamp(45px, 7vw, 104px); align-items: start; }
.composer-form { max-width: 625px; }
.form-section { margin-bottom: 25px; }
.form-section legend, .field-label { display: block; font-size: 14px; color: var(--ivory); margin-bottom: 12px; letter-spacing: .03em; }
.field-number { font-family: Georgia, serif; color: var(--gold); font-size: 12px; margin-right: 12px; }
.mood-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mood-option { position: relative; display: flex; flex-direction: column; padding: 17px 12px 16px; text-align: center; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; transition: background .2s, border-color .2s; overflow: hidden; }
.mood-option:hover { border-color: rgba(184, 221, 208, .5); }
.mood-option:has(input:checked) { background: rgba(184, 221, 208, .065); border-color: var(--seafoam); }
.mood-option:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 4px; }
.mood-option input, .segmented-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mood-swatch { height: 46px; display: flex; align-items: center; justify-content: center; margin-bottom: 9px; }
.mood-orbit { display: block; width: 38px; height: 38px; border: 1px solid var(--seafoam); border-radius: 50%; position: relative; opacity: .8; }
.mood-orbit::after { content: ""; position: absolute; inset: 7px -8px; border: 1px solid var(--seafoam); border-radius: 50%; transform: rotate(-23deg); opacity: .6; }
.mood-ember .mood-orbit { border-color: var(--gold); width: 28px; height: 40px; border-radius: 80% 30% 60% 30%; transform: rotate(30deg); }
.mood-ember .mood-orbit::after { inset: 8px 6px; border-color: var(--gold); border-radius: inherit; transform: none; }
.mood-night .mood-orbit { width: 36px; height: 36px; border-color: #b2bfca; }
.mood-night .mood-orbit::after { border-color: #b2bfca; inset: 4px 4px 4px 14px; border-width: 0 0 0 1px; transform: rotate(15deg); }
.mood-name { font-family: var(--serif); font-size: 23px; letter-spacing: .1em; }
.mood-description { color: var(--muted); font-size: 12px; margin-top: 3px; }
.form-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
select, input[type="text"] { background: var(--surface); color: var(--ivory); border: 1px solid var(--line); border-radius: 3px; padding: 12px 13px; min-height: 47px; font-size: 14px; width: 100%; }
select { padding-right: 28px; }
input[type="text"]::placeholder { color: var(--faint); }
.segmented-options { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border: 1px solid var(--line); border-radius: 3px; }
.segmented-options label { position: relative; cursor: pointer; }
.segmented-options span { display: block; padding: 8px; text-align: center; color: var(--muted); border-radius: 2px; font-size: 14px; }
.segmented-options input:checked + span { background: var(--seafoam-dark); color: var(--ivory); }
.segmented-options input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }
.field-optional { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 8px; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 8px; }
.composer-actions { display: flex; align-items: center; gap: 25px; padding-top: 5px; }
.local-note { color: var(--faint); font-size: 12px; margin-top: 17px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--seafoam); }
.studio-aside { padding-top: 3px; }
.studio-art { min-height: 270px; aspect-ratio: 1.3; background: url("background.png") 65% 52% / cover; position: relative; opacity: .75; border-radius: 47% 47% 2px 2px; overflow: hidden; }
.studio-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 25, 30, .75), rgba(10, 25, 30, .05)); }
.studio-art-label { position: absolute; bottom: 20px; left: 22px; right: 22px; z-index: 1; font-size: 12px; letter-spacing: .19em; text-align: center; }
.studio-aside-copy { padding: 25px 4px; }
.studio-aside-copy .eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .14em; }
.studio-aside-copy > p:last-child { font-family: var(--serif); font-size: 20px; line-height: 1.9; color: var(--muted); margin-top: 12px; }
.composition-preview { border-top: 1px solid var(--line); padding: 26px 4px 0; }
.composition-preview h2 { font-family: var(--serif); font-size: 31px; line-height: 1.4; margin-top: 12px; overflow-wrap: anywhere; }
.composition-preview > p:not(.eyebrow) { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 12px; }
.preview-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 22px; }
.preview-actions .button { width: 100%; }

.is-playing { overflow: hidden; }
.is-playing .site-header, .is-playing .site-footer { display: none; }
.play-view { height: 100svh; height: 100dvh; display: flex; flex-direction: column; background: var(--deep); overflow: hidden; isolation: isolate; touch-action: none; padding-top: env(safe-area-inset-top); }
.play-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px max(28px, env(safe-area-inset-left)); flex: 0 0 auto; }
.icon-button { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 70px; padding: 5px; color: var(--muted); font-size: 12px; justify-content: center; }
.icon-button:hover { color: var(--ivory); }
.icon-button > span:first-child { font-size: 23px; font-family: var(--serif); }
.playing-heading { text-align: center; min-width: 0; }
.playing-heading h1 { font-family: var(--serif); font-size: 21px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 60vw; letter-spacing: .05em; }
.playing-heading p { color: var(--faint); font-size: 12px; margin-top: 1px; }
.play-progress { height: 2px; flex-shrink: 0; width: 100%; }
#song-progress { display: block; height: 2px; width: 100%; border: 0; border-radius: 0; appearance: none; background: var(--line); color: var(--seafoam); }
#song-progress::-webkit-progress-bar { background: var(--line); }
#song-progress::-webkit-progress-value { background: var(--seafoam); transition: width .1s linear; }
#song-progress::-moz-progress-bar { background: var(--seafoam); }
.play-stage { position: relative; flex: 1; min-height: 150px; width: 100%; }
#stage { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.play-hud { display: flex; align-items: baseline; gap: 30px; position: absolute; z-index: 2; top: 24px; left: clamp(24px, 5vw, 80px); right: clamp(24px, 5vw, 80px); pointer-events: none; }
.play-hud > div { display: flex; align-items: baseline; gap: 10px; }
.hud-label { font-size: 12px; color: var(--muted); }
.play-hud strong { font-family: Georgia, serif; font-weight: 400; font-variant-numeric: tabular-nums; font-size: 27px; line-height: 1; }
.hud-combo strong { color: var(--gold); }
.hud-time { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.judgement { position: absolute; top: 30%; left: 0; right: 0; z-index: 3; text-align: center; font-family: var(--serif); font-size: clamp(20px, 3vw, 32px); letter-spacing: .14em; color: var(--seafoam); pointer-events: none; min-height: 40px; text-shadow: 0 2px 20px var(--deep); }
.stage-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; background: rgba(7, 21, 26, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: center; padding: 20px; }
.overlay-content { max-width: 500px; }
.overlay-content h2 { font-family: var(--serif); font-size: clamp(28px, 3vw, 43px); line-height: 1.5; margin: 16px 0; }
.overlay-content > p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.8; white-space: pre-line; }
.overlay-content .button { margin-top: 27px; }
.play-controls { position: relative; flex-shrink: 0; padding: 10px max(22px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom)); background: var(--deep); }
.play-instruction { font-size: 13px; text-align: center; color: var(--muted); margin-bottom: 14px; min-height: 21px; }
.instrument-pads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 720px; margin: 0 auto; }
.instrument-pad { position: relative; min-height: 90px; border: 1px solid rgba(184, 221, 208, .22); border-radius: 5px; background: rgba(184, 221, 208, .035); padding: 8px 18px 14px; display: flex; align-items: center; justify-content: center; gap: 18px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background .08s, border-color .08s; }
.instrument-pad strong { font-family: var(--serif); font-size: 25px; letter-spacing: .08em; font-weight: 400; }
.pad-key { position: absolute; top: 9px; left: 14px; color: var(--faint); font-size: 12px; letter-spacing: .1em; }
.pad-line { position: absolute; bottom: 12px; left: 40%; right: 40%; height: 2px; background: var(--seafoam); opacity: .45; }
.instrument-pad:hover { background: rgba(184, 221, 208, .07); }
.instrument-pad:active, .instrument-pad.active, .instrument-pad.is-held, .instrument-pad.pressed { background: rgba(184, 221, 208, .17); border-color: var(--seafoam); }
.instrument-pad:active .pad-line, .instrument-pad.active .pad-line, .instrument-pad.is-held .pad-line, .instrument-pad.pressed .pad-line { left: 20%; right: 20%; opacity: 1; }
.audio-status { text-align: center; font-size: 12px; color: var(--faint); margin-top: 9px; min-height: 16px; }

.result-view { position: relative; max-width: none; overflow: hidden; display: flex; align-items: center; justify-content: center; isolation: isolate; text-align: center; padding-top: 70px; padding-bottom: 70px; }
.result-atmosphere { position: absolute; inset: 0; z-index: -2; background: url("background.png") center 40% / cover; opacity: .18; }
.result-view::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--ink), rgba(10, 25, 30, .35) 60%, var(--ink)); }
.result-content { width: min(100%, 770px); }
.result-content h1 { font-family: var(--serif); font-size: clamp(31px, 3.8vw, 53px); line-height: 1.5; margin: 24px 0 20px; letter-spacing: .035em; }
.result-message { color: var(--muted); font-size: 16px; max-width: 550px; margin: 0 auto; white-space: pre-line; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 50px auto 23px; max-width: 600px; }
.result-stats > div { padding: 4px 20px; border-right: 1px solid var(--line); }
.result-stats > div:last-child { border-right: 0; }
.result-stats dt { font-size: 12px; color: var(--muted); letter-spacing: .09em; }
.result-stats dd { margin: 9px 0 0; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 54px); font-variant-numeric: tabular-nums; color: var(--seafoam); line-height: 1.3; }
.result-stats > div:first-child dd { color: var(--ivory); }
.result-comparison { color: var(--gold); font-size: 13px; min-height: 22px; }
.result-actions { margin-top: 35px; display: flex; align-items: center; justify-content: center; gap: 15px; }
.result-more { display: flex; justify-content: center; gap: 32px; margin-top: 22px; }

.library-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.library-heading .button { margin-bottom: 6px; }
.library-summary { color: var(--faint); font-size: 12px; margin-top: -20px; margin-bottom: 26px; }
.library-section { margin: 37px 0 50px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.section-heading h2 { font-family: var(--serif); font-size: 25px; letter-spacing: .06em; }
.section-heading > span { font-size: 12px; letter-spacing: .16em; color: var(--faint); }
.saved-tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.track-card { padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; min-width: 0; }
.track-card h3, .track-card h2 { font-family: var(--serif); font-size: 23px; line-height: 1.5; overflow-wrap: anywhere; }
.track-card p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.track-card .track-meta { font-size: 12px; color: var(--faint); }
.track-actions { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.track-card button { font-size: 13px; }
.track-card .button { min-height: 42px; padding: 9px 18px; }
.track-card .text-button { margin-left: auto; }
.empty-state { padding: 34px 0 20px; color: var(--muted); grid-column: 1 / -1; }
.empty-state h3 { font-family: var(--serif); font-size: 22px; color: var(--ivory); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 500px; }
.empty-state .button, .empty-state .text-button { margin-top: 20px; }
.run-item, .run-row { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 17px 2px; border-bottom: 1px solid var(--line); }
.run-item h3, .run-row h3 { font-size: 15px; }
.run-item p, .run-row p { font-size: 12px; color: var(--faint); margin-top: 4px; }
.run-stats { display: flex; align-items: center; gap: 22px; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--seafoam); }
.run-stats small { font-size: 12px; color: var(--muted); }
.library-tools { padding-top: 26px; margin-top: 50px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.library-tools p { color: var(--faint); font-size: 12px; }
.library-tools > div { display: flex; gap: 25px; }
.library-tools .text-button { font-size: 12px; }

.settings-dialog { color: var(--ivory); background: var(--ink); border: 1px solid rgba(184, 221, 208, .25); border-radius: 5px; width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; overscroll-behavior: contain; }
.settings-dialog::backdrop { background: rgba(2, 10, 14, .75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 31px 32px 25px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-family: var(--serif); font-size: 32px; margin-top: 10px; }
.dialog-heading .eyebrow { font-size: 12px; }
.close-button { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--muted); font-weight: 200; font-size: 27px; line-height: 1; margin: -10px -11px 0 0; }
.close-button:hover { color: var(--ivory); }
.settings-body { padding: 5px 32px 27px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.setting-row label, .setting-row strong { font-size: 14px; font-weight: 400; }
.setting-row small { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 5px; }
.setting-row input[type="range"] { accent-color: var(--seafoam); width: 52%; min-height: 28px; cursor: pointer; }
.setting-row input[type="checkbox"] { accent-color: var(--seafoam); width: 19px; height: 19px; flex-shrink: 0; cursor: pointer; }
.checkbox-setting { cursor: pointer; }
.latency-setting select { width: 128px; flex-shrink: 0; font-size: 13px; min-height: 43px; }
.tilt-setting { align-items: flex-start; }
.tilt-setting p { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 5px; }
.button-small { min-height: 41px; padding: 9px 13px; font-size: 12px; flex-shrink: 0; }
.privacy-note { color: var(--faint); font-size: 12px; line-height: 1.9; margin-top: 22px; }
.clear-data { margin-top: 8px; font-size: 12px; color: var(--faint); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 36px); padding: 13px 23px; color: var(--ivory); background: #1c363a; border: 1px solid rgba(184, 221, 208, .32); border-radius: 3px; text-align: center; font-size: 13px; line-height: 1.6; }

@media (min-width: 1600px) {
  .hero-content { padding-top: 110px; padding-bottom: 95px; }
  .hero-content h1 { font-size: 83px; }
  .gesture-story { padding-bottom: 43px; padding-top: 36px; }
}

@media (max-width: 1000px) {
  .site-header { height: 86px; padding-left: 32px; padding-right: 32px; }
  .primary-nav { gap: 25px; }
  .home-view { padding-left: 48px; padding-right: 48px; min-height: calc(100svh - 151px); }
  .hero-content { padding-top: 78px; padding-bottom: 65px; }
  .hero-content h1 { font-size: 58px; }
  .home-atmosphere { left: 10%; opacity: .54; }
  .hero-art-caption { right: 40px; bottom: 180px; }
  .gesture-story { gap: 20px; }
  .gesture-story li { gap: 14px; }
  .gesture-story p { font-size: 12px; }
  .page-shell { padding: 50px 42px 65px; min-height: calc(100svh - 151px); }
  .studio-layout { gap: 38px; grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr); }
  .studio-art { min-height: 245px; }
  .mood-options { gap: 8px; }
  .mood-option { padding-left: 6px; padding-right: 6px; }
  .composer-actions { flex-wrap: wrap; gap: 6px 20px; }
  .composer-actions .button-primary { flex: 1; }
  .composer-actions .button-quiet { font-size: 13px; }
  .form-two-col { gap: 14px; }
}

@media (max-width: 700px) {
  .site-header { height: 76px; padding: 0 22px; gap: 15px; }
  .brand-wordmark { font-size: 23px; }
  .brand-chinese { display: none; }
  .primary-nav { gap: 20px; }
  .primary-nav button { font-size: 12px; }
  .primary-nav .settings-trigger { margin-left: 0; }
  .settings-trigger span { display: none; }
  .settings-trigger svg { width: 20px; height: 20px; }
  .home-view { min-height: calc(100svh - 76px); padding: 0 29px; }
  .home-atmosphere { inset: 0 -30% 0 -6%; background-position: 65% 40%; opacity: .55; }
  .home-view::before { background: linear-gradient(90deg, rgba(10, 25, 30, .93), rgba(10, 25, 30, .49) 70%, rgba(10, 25, 30, .2)), linear-gradient(0deg, var(--ink) 7%, rgba(10, 25, 30, .1) 65%, rgba(10, 25, 30, .14)); }
  .hero-content { padding-top: 70px; padding-bottom: 48px; }
  .hero-content .eyebrow { font-size: 12px; letter-spacing: .16em; }
  .tiny-line { width: 19px; margin-right: 7px; }
  .hero-content h1 { font-size: clamp(39px, 8.6vw, 59px); line-height: 1.5; letter-spacing: .015em; margin: 23px 0 22px; }
  .hero-copy { font-size: 14px; line-height: 1.95; }
  .hero-actions { gap: 21px; margin-top: 31px; flex-wrap: wrap; }
  .hero-actions .button-primary { min-width: 158px; min-height: 51px; padding-left: 22px; padding-right: 22px; }
  .hero-actions .button-quiet { font-size: 13px; gap: 6px; }
  .studio-link { margin-top: 13px; font-size: 12px; }
  .hero-note { margin-top: 14px; font-size: 12px; }
  .hero-art-caption { display: none; }
  .gesture-story { padding: 23px 0 30px; gap: 14px; }
  .gesture-story li { display: block; }
  .gesture-index { font-size: 12px; margin-bottom: 7px; display: block; }
  .gesture-story strong { font-size: 22px; }
  .gesture-story p { font-size: 12px; line-height: 1.8; max-width: 106px; margin-top: 8px; }
  .site-footer { padding: 19px 24px; font-size: 12px; min-height: 62px; gap: 12px; }
  .site-footer > span:nth-child(2) { display: none; }
  .footer-divider { padding: 0 4px; }
  .version > span { margin-left: 4px; }
  .page-shell { padding: 41px 26px 55px; min-height: calc(100svh - 138px); }
  .page-heading { margin-bottom: 32px; }
  .page-heading .eyebrow { font-size: 12px; }
  .page-heading h1 { font-size: 33px; margin-top: 15px; }
  .page-heading > p:last-child, .page-heading > div > p:last-child { font-size: 13px; }
  .studio-layout { display: flex; flex-direction: column; gap: 35px; }
  .composer-form, .studio-aside { width: 100%; max-width: none; }
  .form-section { margin-bottom: 24px; }
  .mood-options { gap: 10px; }
  .mood-option { padding: 18px 7px 14px; }
  .mood-name { font-size: 22px; }
  .mood-description { font-size: 12px; }
  .form-two-col { gap: 13px; }
  .form-section legend, .field-label { font-size: 13px; }
  select, input[type="text"] { font-size: 16px; padding-left: 11px; }
  #tempo, #input-mode { font-size: 13px; }
  .field-number { font-size: 12px; margin-right: 7px; }
  .composer-actions { gap: 12px; }
  .composer-actions .button-primary { flex: 0 1 auto; padding-left: 20px; padding-right: 20px; }
  .composer-actions .button-quiet { flex: 1; }
  .studio-art, .studio-aside-copy { display: none; }
  .studio-aside { padding-top: 0; }
  .studio-aside:has(.composition-preview[hidden]) { display: none; }
  .composition-preview { padding-top: 26px; }
  .preview-actions { flex-direction: row; flex-wrap: wrap; }
  .preview-actions .button { width: auto; }
  .play-header { padding: 10px 15px 11px; gap: 10px; }
  .playing-heading h1 { font-size: 18px; }
  .playing-heading p { font-size: 12px; }
  .icon-button { min-width: 58px; font-size: 12px; gap: 5px; }
  .play-hud { top: 22px; left: 23px; right: 23px; gap: 22px; }
  .play-hud > div { display: block; }
  .hud-label { display: block; font-size: 12px; margin-bottom: 7px; }
  .play-hud strong { font-size: 25px; }
  .hud-time { font-size: 12px; }
  .judgement { top: 28%; font-size: 23px; }
  .play-controls { padding: 8px 20px max(10px, env(safe-area-inset-bottom)); }
  .play-instruction { font-size: 12px; margin-bottom: 12px; }
  .instrument-pads { gap: 13px; }
  .instrument-pad { min-height: 99px; }
  .instrument-pad strong { font-size: 25px; }
  .pad-key { display: none; }
  .audio-status { font-size: 12px; margin-top: 8px; }
  .overlay-content h2 { font-size: 28px; }
  .overlay-content > p:not(.eyebrow) { font-size: 13px; }
  .overlay-content .button { margin-top: 21px; min-height: 49px; }
  .result-view { padding-top: 70px; padding-bottom: 75px; }
  .result-content h1 { font-size: 32px; margin-top: 22px; }
  .result-message { font-size: 14px; }
  .result-stats { margin-top: 37px; margin-bottom: 22px; }
  .result-stats > div { padding: 0 12px; }
  .result-stats dt { font-size: 12px; }
  .result-stats dd { font-size: 37px; }
  .result-comparison { font-size: 12px; }
  .result-actions { margin-top: 28px; gap: 11px; }
  .result-actions .button { font-size: 13px; padding: 13px 17px; gap: 22px; }
  .result-more { gap: 27px; margin-top: 18px; }
  .result-more .text-button { font-size: 12px; gap: 9px; }
  .library-heading { align-items: flex-start; flex-direction: column; gap: 22px; }
  .library-heading .button { font-size: 13px; min-height: 45px; padding: 10px 18px; }
  .library-summary { margin-top: -13px; }
  .library-section { margin: 32px 0 38px; }
  .section-heading h2 { font-size: 23px; }
  .section-heading > span { font-size: 12px; letter-spacing: .11em; }
  .saved-tracks { grid-template-columns: 1fr; }
  .track-card { padding: 21px; }
  .run-item, .run-row { gap: 15px; }
  .run-stats { gap: 13px; font-size: 12px; }
  .run-item h3, .run-row h3 { font-size: 13px; }
  .run-item p, .run-row p { font-size: 12px; }
  .library-tools { margin-top: 35px; align-items: flex-start; flex-direction: column; gap: 15px; }
  .library-tools > div { gap: 28px; }
  .dialog-heading { padding: 25px 23px 22px; }
  .dialog-heading h2 { font-size: 29px; }
  .settings-body { padding: 2px 23px 24px; }
  .setting-row { gap: 17px; padding: 19px 0; }
  .setting-row small, .tilt-setting p { font-size: 12px; }
  .setting-row label, .setting-row strong { font-size: 13px; }
  .latency-setting select { width: 115px; font-size: 13px; }
  .settings-dialog { max-height: calc(100dvh - 28px); }
}

@media (max-width: 370px) {
  .site-header { padding-left: 17px; padding-right: 17px; }
  .primary-nav { gap: 13px; }
  .brand-wordmark { font-size: 21px; }
  .home-view { padding-left: 24px; padding-right: 24px; }
  .hero-content h1 { font-size: 38px; }
  .hero-actions { gap: 10px; }
  .hero-actions .button-primary { min-width: 144px; padding-left: 18px; padding-right: 18px; }
  .hero-actions .button-quiet { font-size: 12px; }
  .result-stats dd { font-size: 32px; }
  .result-actions { flex-direction: column; }
  .result-actions .button { width: 100%; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .play-header { padding-top: 5px; padding-bottom: 5px; }
  .playing-heading h1 { font-size: 17px; }
  .playing-heading p { display: none; }
  .play-header .icon-button { min-height: 33px; }
  .play-hud { top: 12px; left: 25px; right: 25px; gap: 25px; }
  .play-hud > div { display: flex; align-items: baseline; gap: 8px; }
  .hud-label { font-size: 12px; margin-bottom: 0; }
  .play-hud strong { font-size: 21px; }
  .judgement { top: 17%; font-size: 21px; }
  .play-controls { padding: 4px max(22px, env(safe-area-inset-left)) max(5px, env(safe-area-inset-bottom)); }
  .play-instruction { margin-bottom: 4px; min-height: 18px; font-size: 12px; }
  .instrument-pads { max-width: 850px; gap: 20px; }
  .instrument-pad { min-height: 51px; padding: 2px 12px 8px; }
  .instrument-pad strong { font-size: 21px; }
  .pad-line { bottom: 6px; }
  .pad-key { display: block; top: 5px; font-size: 12px; }
  .audio-status { display: none; }
  .overlay-content .eyebrow { display: none; }
  .overlay-content h2 { font-size: 25px; margin: 0 0 7px; }
  .overlay-content > p:not(.eyebrow) { font-size: 12px; line-height: 1.6; }
  .overlay-content .button { min-height: 39px; padding: 8px 17px; margin-top: 13px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .button-primary:hover { transform: none; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
