@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dmsans.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/fonts/dmmono-medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #13233A;
  --ocean: #3A6B6B;      /* darkened brand Ocean, 5.6:1 on white for text */
  --ocean-brand: #4B8282;
  --sage: #AACDC8;
  --mint: #D8E8E2;
  --ivory: #F5F4F0;
  --white: #FFFFFF;
  --muted: #47566A;
  --line: #D9DEDF;
  --radius: 20px;
  --max: 1120px;
  --focus: 3px solid #13233A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--navy);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
}

a { color: var(--ocean); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -100px;
  background: var(--navy); color: var(--white); padding: 12px 16px; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 16px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ocean);
  margin: 0 0 16px;
}

/* ---------- hero ---------- */
.hero { padding: 56px 0 32px; }
.hero h1 {
  font-size: clamp(2.75rem, 9vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 24px;
  max-width: 13ch;
}
.hero .intro { font-size: clamp(1.2rem, 2.4vw, 1.45rem); max-width: 38ch; margin: 0 0 20px; }
.hero .pro {
  max-width: 52ch;
  margin: 0;
  padding: 14px 18px;
  border-left: 4px solid var(--sage);
  background: var(--white);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
}

/* ---------- volume ---------- */
.volume {
  display: grid;
  gap: 16px;
  align-items: center;
  margin: 32px 0 8px;
  padding: 20px;
  background: var(--mint);
  border-radius: var(--radius);
}
.volume p { margin: 0; }
.volume p strong { display: block; }
.volume label { display: block; font-weight: 600; margin-bottom: 4px; }
.volume input[type="range"] { width: 100%; min-height: 48px; accent-color: var(--navy); }
@media (min-width: 760px) {
  .volume { grid-template-columns: 1fr 300px; padding: 24px 28px; }
}

/* ---------- library ---------- */
.library { padding: 40px 0 24px; }
h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 12px;
}
.library > .wrap > p { max-width: 60ch; color: var(--muted); margin: 0 0 28px; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  scroll-margin: 24px;
}
.card.is-shared { border-color: var(--sage); }
.card.is-playing { border-color: var(--ocean); }
.card h3 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
.card p { margin: 0 0 20px; flex: 1; }

.wave { display: block; width: 100%; height: 48px; margin: 0 0 12px; }
.progress { height: 4px; background: var(--mint); border-radius: 2px; overflow: hidden; margin-bottom: 16px; }
.bar { height: 100%; background: var(--ocean); transform-origin: left; transform: scaleX(0); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button, .button {
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.play { background: var(--navy); color: var(--white); border: 2px solid var(--navy); }
.play:hover { background: #22395A; }
.play[aria-pressed="true"] { background: var(--white); color: var(--navy); }
.play .icon-stop, .play[aria-pressed="true"] .icon-play { display: none; }
.play[aria-pressed="true"] .icon-stop { display: block; }
.play:disabled { opacity: 0.5; cursor: not-allowed; }
.share { background: transparent; color: var(--navy); border: 2px solid var(--line); }
.share:hover { border-color: var(--navy); }
.icon { width: 20px; height: 20px; flex: none; }
.remaining { font-family: 'DM Mono', ui-monospace, monospace; font-size: 0.95rem; color: var(--muted); margin-left: auto; min-width: 3ch; text-align: right; }

.unsupported { background: var(--white); border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; font-weight: 600; }

/* ---------- explain ---------- */
.explain { padding: 56px 0 24px; }
.tips { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: tip; }
@media (min-width: 900px) { .tips { grid-template-columns: repeat(2, 1fr); gap: 20px 40px; } }
.tips li { counter-increment: tip; padding-left: 56px; position: relative; max-width: 60ch; }
.tips li::before {
  content: counter(tip);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sage); color: var(--navy);
  font-weight: 800; display: grid; place-items: center;
}
.tips strong { display: block; font-size: 1.2rem; }
.tips p { margin: 2px 0 0; }

/* ---------- safety + handoff ---------- */
.safety { padding: 24px 0 0; }
.safety p {
  margin: 0;
  padding: 18px 20px;
  background: var(--white);
  border-radius: 12px;
  border-left: 4px solid var(--navy);
  max-width: 70ch;
}
.handoff { padding: 64px 0; }
.handoff .wrap > div { background: var(--navy); color: var(--white); border-radius: 28px; padding: 40px 28px; }
.handoff h2 { color: var(--white); max-width: 20ch; }
.handoff .button { margin-top: 16px; background: var(--white); color: var(--navy); border: 2px solid var(--white); }
.handoff .button:hover { background: var(--mint); }
.handoff .button:focus-visible { outline-color: var(--white); }
@media (min-width: 760px) { .handoff .wrap > div { padding: 56px; } }

/* ---------- footer ---------- */
footer { padding: 8px 0 56px; color: var(--muted); }
footer .wrap > * { max-width: 75ch; }
footer p { margin: 0 0 12px; }
footer .logo { display: inline-block; margin-bottom: 16px; }
footer .logo svg { width: 64px; height: auto; display: block; }
footer ul { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer li a { display: inline-block; padding: 12px 0; }

/* ---------- dialog ---------- */
dialog {
  border: none;
  border-radius: var(--radius);
  padding: 28px;
  max-width: min(480px, calc(100vw - 32px));
  color: var(--navy);
  background: var(--white);
}
dialog::backdrop { background: rgba(19, 35, 58, 0.55); }
dialog h2 { font-size: 1.75rem; }
dialog p { margin: 0 0 20px; }
dialog form { display: flex; flex-wrap: wrap; gap: 10px; }
dialog .secondary { background: transparent; color: var(--navy); border: 2px solid var(--line); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
