/* NOME promotional site.
   Design tokens verbatim from the app (nome/src/theme/tokens.ts) — do not
   invent values. The site is dark-only, like the app. */

:root {
  --bg: #0a0a0a;
  --card: #141414;
  --card-lift: #2e2e2e;
  --control: #181818;
  --pressed: #4a4a4a;
  --hairline: #2a2a2a;
  --text-primary: #fafafa;
  --text-secondary: #d6d6d6;
  --text-muted: #8a8a8a;
  --text-dim: #6a6a6a;
  --accent: #9b7cf0;
  --accent-light: #b79dff;
  --radius-card: 32px;
  color-scheme: dark;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url('assets/fonts/BarlowCondensed-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('assets/fonts/BarlowCondensed-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: 'Barlow Condensed', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-light);
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 40px;
}

.wordmark {
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.5em;
  text-indent: 0.5em; /* optical centering, per the app spec */
  color: var(--text-secondary);
}

header.site nav {
  display: flex;
  gap: 28px;
}
header.site nav a {
  color: var(--text-dim);
  font-size: 17px;
  letter-spacing: 0.06em;
}
header.site nav a:hover {
  color: var(--text-secondary);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(56px, 10vh, 120px) 0 24px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(52px, 9vw, 96px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.hero .sub {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: clamp(19px, 2.4vw, 24px);
  color: var(--text-muted);
}

/* ---------- The metronome ---------- */

.metronome {
  margin: clamp(40px, 7vh, 72px) auto 0;
  max-width: 620px;
}

.tempo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: clamp(280px, 46vw, 420px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--card);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 90ms ease-out, transform 90ms ease-out, box-shadow 90ms ease-out;
}

/* Beat pulse: rise for 35ms (peaking on the click), decay for 90ms — the
   app's exact envelope, plus a web-only accent glow. 35/125 = 28%. */
@keyframes beat-pulse {
  0% {
    background: var(--card);
    transform: scale(1);
    box-shadow: 0 0 0 rgba(155, 124, 240, 0);
  }
  28% {
    background: var(--card-lift);
    transform: scale(1.02);
    box-shadow: 0 0 64px rgba(155, 124, 240, 0.14);
  }
  100% {
    background: var(--card);
    transform: scale(1);
    box-shadow: 0 0 0 rgba(155, 124, 240, 0);
  }
}
.tempo-card.pulse {
  animation: beat-pulse 125ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  @keyframes beat-pulse {
    0% { background: var(--card); }
    28% { background: var(--card-lift); }
    100% { background: var(--card); }
  }
}

/* Corner status mark: play triangle when stopped, stop square when running.
   A status mark, not a button — the whole card is the control (app spec). */
.run-mark {
  position: absolute;
  top: 24px;
  left: 26px;
  width: 0;
  height: 0;
  border-left: 24px solid var(--text-muted);
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
}
.run-mark.running {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 2px;
  background: var(--text-muted);
  top: 29px;
}

.tempo-hint {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  transition: opacity 400ms;
}
.tempo-hint.hidden {
  opacity: 0;
}

.tempo-number {
  font-weight: 500;
  font-size: clamp(150px, 26vw, 240px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.bpm-label {
  margin-top: 6px;
  font-weight: 500;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* optical centering for the tracking */
  color: var(--text-muted);
}

/* ---------- Steppers ---------- */

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 20px;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  background: var(--control);
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 400;
  font-size: 23px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.stepper.fine {
  width: 68px;
  height: 68px;
  border-radius: 34px;
  font-size: 42px;
  color: var(--text-primary);
}
.stepper span {
  /* Optical lift: bare −/+ glyphs sit low in their em box (app spec). */
  transform: translateY(-0.077em);
}
.stepper.coarse span {
  transform: translateY(-0.057em);
}
.stepper:active {
  background: var(--pressed);
}
.stepper:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.metronome .helper {
  margin-top: 20px;
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.metronome .helper .key {
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 7px;
  color: var(--text-muted);
}

/* ---------- Store badges ---------- */

.badges {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 40px 0 0;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 190px;
  padding: 12px 26px 14px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--control);
  color: var(--text-secondary);
}
.badge .store {
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.03em;
}
.badge .soon {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Features ---------- */

.features {
  padding: clamp(80px, 14vh, 160px) 0 0;
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 12vh, 140px);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.feature:nth-child(even) .feature-copy {
  order: 2;
}

.feature h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}
.feature p {
  margin: 14px 0 0;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text-muted);
  max-width: 380px;
}

/* Minimal device frame — rounded rect and a hairline, no photoreal bezel. */
.shot {
  justify-self: center;
  width: min(300px, 78vw);
  border: 1px solid var(--hairline);
  border-radius: 40px;
  padding: 10px;
  background: var(--card);
}
.shot img {
  display: block;
  width: 100%;
  /* The width/height attributes reserve layout space before load; without
     this, the height attribute survives as a fixed height and distorts. */
  height: auto;
  border-radius: 31px;
}

/* Scroll reveal: subtle rise, disabled for reduced motion. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Closing CTA ---------- */

.closing {
  padding: clamp(90px, 16vh, 180px) 0 0;
  text-align: center;
}
.closing h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  color: var(--text-primary);
}
.closing p {
  margin: 14px auto 0;
  max-width: 480px;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text-muted);
}

/* ---------- Footer ---------- */

footer.site {
  margin-top: clamp(90px, 16vh, 180px);
  border-top: 1px solid var(--hairline);
  padding: 28px 0 48px;
  font-size: 15px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer.site a {
  color: var(--text-dim);
}
footer.site a:hover {
  color: var(--text-secondary);
}
footer.site .legal-links {
  display: flex;
  gap: 20px;
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .feature {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .feature:nth-child(even) .feature-copy {
    order: 0;
  }
  .feature p {
    margin-left: auto;
    margin-right: auto;
  }
  header.site {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .metronome .helper .keys {
    display: none; /* keyboard hints mean nothing on touch */
  }
}
