@font-face {
  font-family: Inter;
  src: url('./media/inter-latin-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Cormorant;
  src: url('./media/cormorant-garamond-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffcf7;
  --surface: #fffcf7;
  --ink: #493a32;
  --muted: #6b5d51;
  --line: #e4d6c5;
  --primary: #8f4834;
  --primary-deep: #7f3c2c;
  --serif: Cormorant, Georgia, serif;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(#f8f1e7 0 89px, var(--paper) 89px); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.48; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.shell { width: min(calc(100% - 56px), 1032px); margin-inline: auto; }
.masthead { min-height: 89px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; color: inherit; }
.brand-emblem { position: relative; flex: 0 0 48px; height: 48px; }
.brand-emblem img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.brand-copy strong { display: flex; align-items: center; gap: 8px; color: var(--ink); font: 550 21px/1.5 Inter, Arial, sans-serif; letter-spacing: -.045em; }
.brand-copy small { display: block; color: var(--muted); font: 400 9px/2.1 Inter, Arial, sans-serif; letter-spacing: .11em; }
.brand-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #a16d27; }
.privacy { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; border: 1px solid var(--line); border-radius: 30px; padding: 8px 12px; background: var(--paper); font-size: 11px; font-weight: 600; color: var(--primary-deep); }
.privacy:hover { background: #faf2e6; }
.privacy .icon { width: 14px; height: 14px; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 258px; display: flex; align-items: center; border-radius: 28px; background: linear-gradient(112deg, #faf2e6 12%, #f1e2cb 60%, #e4c8a6); color: #493a32; }
.hero-copy { z-index: 1; width: 63%; padding: 37px 0 42px 43px; }
.hero h1 { margin: 0; font: 600 clamp(53px, 6.6vw, 82px)/0.96 var(--serif); letter-spacing: -0.052em; }
.hero p { max-width: 365px; margin: 19px 0 0; color: #6b5d51; font-size: 15px; line-height: 1.65; }
.sound-art { position: absolute; right: 2.6%; top: 50%; translate: 0 -50%; width: 45%; height: 132%; display: grid; place-items: center; pointer-events: none; background: radial-gradient(ellipse at center, #a75b4123, transparent 61%); }
.sound-art::before, .sound-art::after { content: ''; position: absolute; width: min(61%, 295px); aspect-ratio: 1; border: 1px solid #a75b413e; border-radius: 50%; box-shadow: 0 0 0 19px #a75b4116, 0 0 0 39px #a75b4111, 0 0 0 59px #a75b410d; }
.sound-art::after { width: min(44%, 210px); border-color: #a75b4135; box-shadow: 0 0 0 13px #a75b4118; }
.waveform { z-index: 1; display: flex; align-items: center; justify-content: center; gap: clamp(3px, .55vw, 7px); height: 120px; }
.waveform span { width: 3px; height: var(--amplitude); border-radius: 3px; background: linear-gradient(#815136, #a75b41 42%, #b58665); box-shadow: 0 0 13px #f8f1e7b0; transform-origin: center; }
.waveform span:nth-child(3n) { opacity: .64; }
.waveform.recording span, .waveform.playing span { animation: pulse 1.4s ease-in-out infinite alternate; }
.waveform span:nth-child(3n) { animation-delay: -0.65s; }
.waveform span:nth-child(4n) { animation-delay: -0.9s; }
@keyframes pulse { to { transform: scaleY(.47); } }

.workspace { display: grid; grid-template-columns: 1.16fr 1fr; align-items: start; gap: 23px; margin-top: 23px; }
.card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 12px 35px #493a3210; }
.card-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 21px; }
.section-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; color: var(--primary-deep); background: #f1e2cb; }
.section-icon .icon { width: 19px; height: 19px; }
.listening-icon { color: #815136; background: #faf2e6; }
h2 { margin: 0; font: 700 34px/1 var(--serif); letter-spacing: -0.025em; }
.count { flex: 0 0 auto; margin-left: auto; border: 1px solid #e4d6c5; border-radius: 30px; padding: 5px 9px; background: #faf2e6; color: #7f3c2c; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.primary { display: inline-flex; min-height: 46px; justify-content: center; align-items: center; gap: 9px; padding: 10px 17px; border: 0; border-radius: 12px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--primary-deep); }
.record { width: 100%; min-height: 52px; box-shadow: 0 4px 9px #8f483425; }
.record.active { background: #9d3d32; }
.record.active:hover { background: #7a2a24; }
.hint, .status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
#record-hint { margin: 7px 0 0; text-align: center; font-variant-numeric: tabular-nums; }
.status:not(:empty) { margin: 11px 0 0; }
.empty { margin-top: 18px; padding: 20px 14px; border: 1px dashed #e4c8a6; border-radius: 14px; background: #faf2e6; text-align: center; }
.empty p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty .empty-title { margin-bottom: 4px; color: var(--ink); font-size: 13px; font-weight: 650; }
.recordings { margin: 18px 0 0; padding: 0; list-style: none; }
.recordings li { display: flex; align-items: center; gap: 9px; min-height: 53px; border-top: 1px solid var(--line); }
.recordings li > div { flex: 1; min-width: 0; }
.recordings strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.recordings li span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.icon-button { width: 44px; min-width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--primary-deep); }
.icon-button:hover:not(:disabled) { background: #f1e2cb; }
.icon-button .icon { width: 18px; height: 18px; }
.draft { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #faf2e6; }
.draft label, .soundtracks legend { font-size: 13px; font-weight: 650; }
.draft input { width: 100%; min-height: 44px; border: 1px solid #9a806a; border-radius: 8px; background: white; color: var(--ink); padding: 9px 11px; font-size: 16px; }
.draft-actions { display: flex; justify-content: flex-end; gap: 7px; align-items: center; }
.draft-preview { margin-right: auto; background: #f1e2cb; }
.quiet { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--primary-deep); font-size: 13px; font-weight: 650; }
.quiet:hover { background: #f1e2cb; }
.backup { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 4px; }
.backup summary { align-content: center; min-height: 44px; cursor: pointer; color: var(--primary-deep); font-size: 13px; font-weight: 650; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 5px; }
.backup-actions .quiet { border: 1px solid var(--line); }

.soundtracks { padding: 0; border: 0; margin: 0; min-width: 0; }
.soundtracks legend { margin-bottom: 8px; padding: 0; }
.track-options { display: grid; gap: 6px; }
.track { display: flex; align-items: center; min-height: 47px; padding-right: 3px; border: 1px solid var(--line); border-radius: 11px; }
.track:has(:checked) { border-color: #a75b41; background: #faf2e6; }
.track label { position: relative; flex: 1; align-self: stretch; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 5px 8px 5px 10px; cursor: pointer; }
.track input { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.track-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; }
.track-icon .icon { width: 16px; height: 16px; }
.voice { color: #7f3c2c; background: #f1e2cb; }
.calm { color: #405b4c; background: #e6e9df; }
.lift { color: #815136; background: #faf2e6; }
.sleep { color: #6b5d51; background: #f1e2cb; }
.track-name { display: grid; gap: 2px; min-width: 0; }
.track-name strong { font-size: 13px; font-weight: 650; }
.track-name small { color: var(--muted); font-size: 11px; }
.player { display: flex; align-items: center; gap: 10px; min-height: 65px; margin-top: 13px; padding: 9px; border-radius: 13px; background: #faf2e6; }
.mix-play { background: var(--primary); color: white; border-radius: 50%; }
.mix-play:hover:not(:disabled) { background: var(--primary-deep); }
.player-info { flex: 1; min-width: 0; }
#player-title { margin: 0 0 2px; font-size: 13px; font-weight: 650; }
#player-status, #player-time { font-size: 11px; font-variant-numeric: tabular-nums; }
#progress { display: block; width: 100%; height: 4px; margin: 5px 0; border: 0; border-radius: 6px; overflow: hidden; accent-color: var(--primary); background: #e4c8a6; }
#progress::-webkit-progress-bar { background: #e4c8a6; }
#progress::-webkit-progress-value { background: var(--primary); }
.repeat { width: auto; padding: 4px 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.repeat[aria-pressed='true'] { background: #f1e2cb; color: var(--primary-deep); }
.repeat .icon { width: 16px; height: 16px; }
.download { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 9px; border: 1px solid #e4d6c5; background: transparent; border-radius: 10px; color: var(--primary-deep); font-size: 12px; font-weight: 650; }
.download:hover:not(:disabled) { background: #faf2e6; }
.download .icon { width: 16px; height: 16px; }
.export-hint { margin-top: 6px; text-align: center; font-size: 11px; }
.sound-credits ul { margin-block: 0 6px; padding-left: 18px; }
.sound-credits a { color: var(--primary-deep); text-underline-offset: 2px; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; padding: 18px 0 23px; color: var(--muted); font-size: 11px; }
footer p { margin: 0; line-height: 1.55; }
footer a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--primary-deep); font-weight: 650; text-decoration: none; white-space: nowrap; }
footer .icon { width: 14px; height: 14px; }
dialog { width: min(370px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 20px; color: inherit; background: var(--surface); }
dialog::backdrop { background: #493a3275; }
dialog p { margin-block: 8px 18px; overflow-wrap: anywhere; color: var(--muted); font-size: 14px; }
#offline-panel .hint { font-size: 12px; }
#offline-status { font-weight: 650; color: var(--ink); }

@media (max-width: 800px) {
  h2 { font-size: 29px; }
  .card { padding: 18px; }
  .workspace { gap: 14px; }
  .hero-copy { padding-left: 28px; }
}
@media (max-width: 660px) {
  .shell { width: calc(100% - 28px); }
  body { background: linear-gradient(#f8f1e7 0 65px, var(--paper) 65px); }
  .masthead { min-height: 65px; }
  .hero { min-height: 213px; border-radius: 21px; align-items: flex-start; }
  .hero-copy { width: 100%; padding: 25px 20px 68px; }
  .hero h1 { font-size: clamp(44px, 11vw, 63px); }
  .hero p { max-width: 275px; margin-top: 9px; font-size: 13px; }
  .sound-art { right: -11%; top: 91%; width: 76%; height: 100%; }
  .waveform { transform: scale(.54); gap: 7px; translate: -4% -12%; }
  .workspace { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
  .card { border-radius: 19px; }
  .card-heading { margin-bottom: 14px; }
  footer { align-items: flex-start; flex-direction: column; gap: 0; }
}
@media (max-width: 600px) {
  .brand { gap: 8px; }
  .brand-emblem { flex-basis: 36px; height: 36px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy small { font-size: 7px; line-height: 1.6; letter-spacing: .08em; }
}
@media (max-width: 360px) {
  .privacy { width: 44px; flex: 0 0 44px; justify-content: center; padding-inline: 0; }
  .privacy > span { display: none; }
  .privacy .icon { width: 17px; height: 17px; }
  .masthead { gap: 4px; }
  .hero h1 { font-size: clamp(37px, 11.5vw, 44px); }
  .card { padding: 13px; }
  .card-heading { gap: 7px; }
  h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .waveform span { animation: none !important; }
}
