@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #eef1f4;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #566070;
  --rule: #c9d1da;
  --rec: #c25a3c;
  --play: #3f8570;
  --measure: 68ch;
  --wide: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151a21;
    --surface: #1d242d;
    --ink: #e6eaef;
    --muted: #9aa4b1;
    --rule: #323b47;
    --rec: #e07a5c;
    --play: #5fb398;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Familjen Grotesk", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--play); outline-offset: 3px; border-radius: 4px; }

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

/* Header */
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.wordmark {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}
.site-header nav { display: flex; gap: 22px; font-size: 0.95rem; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }

/* Type scale (perfect fourth) */
h1, h2, h3 { font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -0.015em; }
.display { font-size: clamp(2.6rem, 7vw, 5.6rem); letter-spacing: -0.035em; line-height: 0.98; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.15rem; letter-spacing: 0; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: 1.3rem; color: var(--muted); max-width: 34ch; line-height: 1.4; }

/* Hero */
.app-id {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
  font-weight: 600;
  font-size: 1.1rem;
}
.app-id img { border-radius: 14px; }
.hero { padding: 56px 0 24px; }
.hero .lede { margin-top: 20px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 30px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--play); color: #fff; }
.note { color: var(--muted); font-size: 0.95rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 48px;
  align-items: end;
}
.screen {
  width: 100%;
  height: auto;
  border-radius: 28px;
  background: #1e1a17;
  box-shadow: 0 0 0 1px var(--rule);
}

/* The take: staff + waveform */
.take {
  position: relative;
  margin: 48px 0 0;
  padding: 26px 24px 18px;
  background: var(--surface);
  border-radius: 18px;
}
.take-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.state::before {
  content: "";
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--rec);
}
.state.is-play::before { background: var(--play); border-radius: 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.state.is-done::before { background: var(--muted); }
.time { color: var(--muted); }

.track { position: relative; height: 150px; }
.track svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.staff line { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wave rect { fill: var(--ink); }
.wave.rec rect { fill: var(--rec); }
.wave.played rect { fill: var(--play); }
.wave.rec, .wave.played { clip-path: inset(0 100% 0 0); }
.wave.base { opacity: 0; }
.playhead {
  position: absolute;
  top: -6px; bottom: -6px;
  left: 0;
  width: 2px;
  background: var(--play);
  opacity: 0;
}

/* Sequence: record 3s, pause, play back 3s, settle */
.take.run .wave.rec { animation: reveal 3s linear forwards, fade-out 0.5s ease 3.2s forwards; }
.take.run .wave.base { animation: fade-in 0.5s ease 3.2s forwards; }
.take.run .wave.played { animation: reveal 3s linear 3.8s forwards, fade-out 0.8s ease 7.2s forwards; }
.take.run .playhead { animation: sweep 3s linear 3.8s forwards; }
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sweep {
  0% { left: 0; opacity: 1; }
  96% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
/* Without JS or with reduced motion: show the finished take */
.take:not(.run) .wave.base { opacity: 1; }

/* Sections */
section.block { padding: 72px 0 8px; }
section.block > .wrap > h2 { margin-bottom: 28px; }

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
}
.steps li { border-top: 2px solid var(--ink); padding-top: 16px; }
.steps .n { display: block; font-size: 2.4rem; font-weight: 700; line-height: 1; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.steps li:first-child { border-color: var(--rec); }
.steps li:first-child .n { color: var(--rec); }
.steps li:last-child { border-color: var(--play); }
.steps li:last-child .n { color: var(--play); }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); }

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 48px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.features li { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.features strong { display: block; font-weight: 600; }
.features span { color: var(--muted); }

.teacher { margin-top: 72px; }
.teacher h2 { margin-bottom: 16px; }
.teacher p { font-size: 1.15rem; }

.private {
  margin-top: 56px;
  padding: 44px 40px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 18px;
}
.private h2 { margin-bottom: 14px; }
.private p { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.private a { color: var(--paper); }

/* Brand home */
.product-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 22px;
  align-items: center;
  margin-top: 48px;
  padding: 28px;
  background: var(--surface);
  border-radius: 18px;
  text-decoration: none;
}
.product-link .mark {
  grid-row: span 2;
  width: 64px; height: 64px;
  border-radius: 16px;
}
.product-link h2 { font-size: 1.5rem; }
.product-link p { margin: 0; color: var(--muted); }
.product-link:hover h2 { text-decoration: underline; text-underline-offset: 4px; }

/* Long-form (privacy) */
.prose { max-width: var(--measure); padding: 48px 0 24px; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 10px; }
.prose h2 { font-size: 1.25rem; margin: 36px 0 8px; letter-spacing: 0; }
.prose .updated { color: var(--muted); margin-bottom: 32px; }

/* Footer */
.site-footer { margin-top: 88px; border-top: 1px solid var(--rule); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer p { margin: 0; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .screen { max-width: 260px; }
  body { font-size: 17px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .features { grid-template-columns: 1fr; }
  .private { padding: 32px 24px; }
  .hero { padding-top: 32px; }
  .site-header nav { gap: 16px; }
  .track { height: 110px; }
}
@media (max-width: 420px) {
  .site-header nav .hide-sm { display: none; }
}

@media (prefers-color-scheme: dark) {
  .private { background: var(--surface); color: var(--ink); }
  .private p { color: var(--muted); }
  .private a { color: var(--ink); }
}
@media (max-width: 480px) {
  .site-header .wrap { flex-wrap: wrap; gap: 8px 16px; }
  .site-header nav { gap: 14px; font-size: 0.9rem; }
}
