:root {
  --ink: #0f2a2a;
  --ink-soft: #1b3d3d;
  --sand: #f5efe6;
  --mist: #edf6f2;
  --surface: #fffaf4;
  --coral: #e76d5b;
  --sun: #f4b468;
  --teal: #0c4b4a;
  --mint: #c8e7dd;
  --border: rgba(15, 42, 42, 0.12);
  --shadow: 0 30px 80px rgba(15, 42, 42, 0.14);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(140deg, var(--sand) 0%, var(--mist) 45%, var(--surface) 100%);
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 55vw;
  height: 55vw;
  border-radius: 999px;
  z-index: 0;
  opacity: 0.55;
  filter: blur(0);
  animation: drift 22s ease-in-out infinite;
}

body::before {
  top: -20vw;
  left: -10vw;
  background: radial-gradient(circle at 35% 35%, rgba(244, 180, 104, 0.38), transparent 62%);
}

body::after {
  bottom: -25vw;
  right: -15vw;
  background: radial-gradient(circle at 60% 60%, rgba(12, 75, 74, 0.28), transparent 60%);
  animation-delay: -8s;
}

audio {
  width: 100%;
  max-width: 100%;
}

.audio-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2vw, 2.2rem);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.audio-callout-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.6rem, 1.6vw + 1rem, 2.4rem);
  margin: 0;
}

.audio-callout p {
  margin: 0;
  color: var(--ink-soft);
}

.audio-player-shell {
  background: var(--mist);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.75rem 1rem;
}

.audio-callout audio {
  width: 100%;
  height: 3.25rem;
}

.bleep-audio-player {
  --player-bg: var(--ink);
  --player-text: var(--surface);
  --player-muted: var(--mint);
  --player-accent: var(--coral);
  --player-track: var(--ink-soft);
  background: var(--player-bg);
  color: var(--player-text);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.bleep-audio-player:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 4px;
}

.bleep-audio-player audio {
  display: none;
}

.bleep-player-stats {
  background-color: var(--player-track);
  border-radius: 20px;
  padding: 1rem;
  text-align: center;
}

.bleep-player-stats.is-flash {
  animation: bleep-flash 0.2s ease;
}

.bleep-player-loading {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bleep-player-metrics {
  display: grid;
  gap: 0.75rem;
}

.bleep-player-stats[data-state="loading"] .bleep-player-metrics {
  display: none;
}

.bleep-player-stats[data-state="loading"] .bleep-player-loading {
  display: block;
}

.bleep-player-stats[data-state="ready"] .bleep-player-loading {
  display: none;
}

.bleep-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.bleep-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--player-muted);
  margin-bottom: 0.3rem;
}

.bleep-stat-value {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.bleep-stat-speed {
  font-size: 1.125rem;
  color: var(--player-text);
}

.bleep-player-progress {
  display: grid;
  gap: 0.6rem;
}

.bleep-progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: var(--player-track);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}

.bleep-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--player-accent);
  border-radius: 999px;
}

.bleep-player-time {
  text-align: center;
  font-size: 0.875rem;
  color: var(--player-muted);
}

.bleep-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.bleep-control {
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bleep-control:focus-visible,
.bleep-progress-track:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 3px;
}

.bleep-control:hover {
  transform: scale(1.05);
}

.bleep-control-skip {
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--player-accent);
  border: 1px solid var(--player-accent);
}

.bleep-control-play {
  width: 64px;
  height: 64px;
  background: var(--player-accent);
  color: var(--surface);
}

.bleep-control-play .icon-pause {
  display: none;
}

.bleep-control-play[data-state="playing"] .icon-play {
  display: none;
}

.bleep-control-play[data-state="playing"] .icon-pause {
  display: inline;
}

.bleep-control svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  .bleep-audio-player {
    padding: 1rem;
  }

  .bleep-stat-value {
    font-size: 2.75rem;
  }

  .bleep-control-play {
    width: 56px;
    height: 56px;
  }
}

.form-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 2rem 0 1.2rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0.25rem;
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-name {
  font-family: "Fraunces", serif;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.status-pill {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link:focus {
  border-bottom-color: var(--coral);
  color: var(--teal);
}

.hero {
  padding: 1.5rem 0 3.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0 0 0.8rem;
}

.hero-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 2.6vw + 1.5rem, 3.6rem);
  margin: 0 0 1rem;
  line-height: 1.1;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--coral);
  color: var(--surface);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
}

.primary-cta:hover,
.primary-cta:focus {
  background: var(--sun);
  color: var(--ink);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ghost-button:hover,
.ghost-button:focus {
  border-color: var(--teal);
}

.hero-meta {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.hero-media {
  background: var(--surface);
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--border);
  padding: 2rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) 0%, var(--mist) 60%, var(--surface) 100%);
  border: 1px solid var(--border);
}

.hero-marker {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  background: var(--teal);
  color: var(--surface);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-hero {
  padding: 2.5rem 0 1.5rem;
}

.page-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 2.2vw + 1.2rem, 3rem);
  margin: 0 0 0.8rem;
}

.page-lead {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.05rem;
}

.page-section {
  padding: 1rem 0 3.5rem;
}

.test-index-section {
  padding-top: 2.5rem;
}

.quick-access {
  padding: 0 0 3rem;
}

.section-header {
  margin-bottom: 1.6rem;
}

.section-header h2 {
  font-family: "Fraunces", serif;
  margin-bottom: 0.4rem;
}

.section-header p {
  color: var(--ink-soft);
  margin: 0;
}

.test-selector {
  padding: 0 0 3.5rem;
}

.test-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  min-height: 100%;
  transition: transform 0.2s ease;
}

.test-card:hover,
.test-card:focus {
  transform: translateY(-4px);
}

.test-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--mist);
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
}

.test-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.test-note {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.trust-band {
  padding: 0 0 3rem;
}

.trust-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.trust-title {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.trust-note {
  color: var(--ink-soft);
}

.explainer {
  padding: 0 0 4rem;
}

.explainer-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.explainer-card h2 {
  font-family: "Fraunces", serif;
  margin-top: 0;
}

.status-card {
  padding: 1.3rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.status-value {
  font-size: 1.35rem;
  font-family: "Fraunces", serif;
  color: var(--teal);
  margin-bottom: 0.4rem;
}

.status-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

.scoreboard {
  background: var(--surface);
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.scoreboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.scoreboard-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.scoreboard-subtitle {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 6px rgba(231, 109, 91, 0.24);
  animation: pulse 2.6s ease-out infinite;
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.score-cell {
  background: var(--mist);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
}

.score-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.score-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.scoreboard-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--sand);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.info-band {
  padding: 0 0 4rem;
}

.info-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  min-height: 100%;
  box-shadow: var(--shadow);
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  min-height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover,
.link-card:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.link-title {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
}

.link-note {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.content-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.6rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 100%;
}

.content-card label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.content-card input {
  background: var(--mist);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  box-shadow: none;
  color: var(--ink);
}

.content-card select {
  background: var(--mist);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
}

.content-card input:focus {
  border-color: var(--teal);
  box-shadow: none;
}

.vo2-form {
  margin-top: 1.2rem;
}

.settings-panel {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: var(--mist);
  border: 1px solid var(--border);
}

.settings-title {
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.settings-note {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.form-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.protocol-card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 1rem;
}

.protocol-title {
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.result-card {
  margin-bottom: 1.5rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.result-value {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  margin: 0.3rem 0;
}

.result-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.result-footnote {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.formula-card {
  background: var(--surface);
}

.formula-line {
  font-family: "Fraunces", serif;
  font-size: 1rem;
  color: var(--teal);
  margin-bottom: 0.9rem;
}

.converter-results {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.converter-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 1rem;
  background: var(--surface);
}

.converter-title {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.converter-value {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.converter-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.content-card select:focus {
  border-color: var(--teal);
  box-shadow: none;
}

.content-card h2 {
  font-family: "Fraunces", serif;
  margin-top: 0;
}

.content-note {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.text-link {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover,
.text-link:focus {
  text-decoration: underline;
}

.info-title {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
  display: grid;
  gap: 0.7rem;
}

.info-list li::before {
  content: "•";
  color: var(--coral);
  margin-right: 0.5rem;
}

.site-footer {
  padding: 2.2rem 0 3rem;
  margin-top: auto;
}

.footer-grid {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.4rem;
}

.footer-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.footer-link {
  display: block;
  margin-top: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}

.footer-link:hover,
.footer-link:focus {
  color: var(--teal);
}

.footer-note {
  color: var(--ink-soft);
  max-width: 560px;
}

.hero-title,
.hero-lead,
.hero-actions,
.hero-media,
.link-card,
.test-card,
.trust-card,
.explainer-card {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s ease forwards;
}

.hero-title {
  animation-delay: 0.05s;
}

.hero-lead {
  animation-delay: 0.12s;
}

.hero-actions {
  animation-delay: 0.18s;
}

.hero-media {
  animation-delay: 0.25s;
}

.link-card {
  animation-delay: 0.35s;
}

.test-card {
  animation-delay: 0.42s;
}

.trust-card {
  animation-delay: 0.5s;
}

.explainer-card {
  animation-delay: 0.58s;
}

@media (max-width: 640px) {
  .site-nav {
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .status-pill {
    width: 100%;
    text-align: center;
  }

  .hero-media {
    min-height: 240px;
  }

}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5efe6;
    --ink-soft: #c8e7dd;
    --sand: #0f2a2a;
    --mist: #1b3d3d;
    --surface: #0c4b4a;
    --teal: #c8e7dd;
    --mint: #0f2a2a;
    --border: rgba(245, 239, 230, 0.12);
    --shadow: 0 30px 80px rgba(15, 42, 42, 0.6);
  }

  body {
    color-scheme: dark;
    background: linear-gradient(140deg, var(--sand) 0%, var(--mist) 45%, var(--surface) 100%);
  }

  body::before {
    background: radial-gradient(circle at 35% 35%, rgba(231, 109, 91, 0.24), transparent 62%);
  }

  body::after {
    background: radial-gradient(circle at 60% 60%, rgba(200, 231, 221, 0.16), transparent 60%);
  }

  .primary-cta {
    color: var(--ink);
  }

  .primary-cta:hover,
  .primary-cta:focus {
    color: var(--sand);
  }

  .hero-marker {
    color: var(--sand);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(10px, -20px, 0) scale(1.03);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

@keyframes bleep-flash {
  0% {
    background-color: var(--player-track);
  }
  50% {
    background-color: var(--player-accent);
  }
  100% {
    background-color: var(--player-track);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
