/* Riffpad landing — design tokens lifted from the app itself:
   deep blue-black studio surface, teal note blocks, lime loop accents,
   capsule chips, and a musical grid. */

:root {
  color-scheme: dark;
  --bg: #050b10;
  --panel: #0a141b;
  --panel-2: #0d1922;
  --panel-3: #111f29;
  --stroke: rgba(234, 244, 242, 0.08);
  --stroke-strong: rgba(234, 244, 242, 0.14);
  --ink: #eaf4f2;
  --muted: #8ca1a9;
  --teal: #41e0cf;
  --teal-soft: rgba(65, 224, 207, 0.14);
  --lime: #d9e54f;
  --lime-soft: rgba(217, 229, 79, 0.14);
  --roll: #29340f;
  --roll-line: rgba(217, 229, 79, 0.14);
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-gap: clamp(88px, 11vw, 150px);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

/* faint musical grid, like the roll surface */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(234, 244, 242, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 244, 242, 0.02) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 60%);
  z-index: -1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  transform: translateY(-160%);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--teal);
  color: var(--bg);
  font-weight: 700;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- container rhythm (one width everywhere) ---------- */

.header-inner,
.hero,
.showcase,
.workflow,
.mode-split,
.routing,
.download,
.site-footer {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 0;
  background: rgba(5, 11, 16, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.site-nav {
  display: flex;
  gap: 6px;
  margin-inline: auto;
}

.site-nav a {
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  transition: color 160ms ease, background-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  background: var(--panel-2);
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.button-primary {
  background: var(--teal);
  color: #04211d;
  box-shadow: 0 10px 32px rgba(65, 224, 207, 0.25);
}

.button-primary:hover {
  background: #5ceada;
}

.button-secondary {
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--stroke-strong);
}

.button-secondary:hover {
  background: var(--panel-3);
}

.button-compact {
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.95rem;
}

.button:hover {
  transform: translateY(-1px);
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* ---------- chips (app toolbar capsules) ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--stroke);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(65, 224, 207, 0.8);
}

.chip-small {
  padding: 7px 13px;
  font-size: 0.75rem;
}

.chip-teal {
  color: var(--teal);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  padding-block: clamp(72px, 9vw, 128px) var(--section-gap);
}

h1 {
  font-size: clamp(2.9rem, 5.4vw, 4.9rem);
}

.hero-text {
  max-width: 480px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero-meta {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* the hero stage is a stylised Riffpad editor */

.hero-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(18px, 2.2vw, 28px);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel-2), var(--panel) 70%);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--stroke);
}

.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roll-field {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  min-height: clamp(280px, 30vw, 400px);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.loop-bar {
  position: absolute;
  top: 0;
  left: 44px;
  right: 0;
  height: 8px;
  background: var(--lime);
  opacity: 0.85;
  z-index: 2;
}

.key-strip {
  display: flex;
  flex-direction: column;
  background: #dfe6dd;
}

.key-strip span {
  flex: 1;
  border-bottom: 1px solid rgba(5, 11, 16, 0.18);
}

.key-strip .black {
  position: relative;
  background: transparent;
}

.key-strip .black::before {
  content: "";
  position: absolute;
  inset: 15% 40% 15% 0;
  border-radius: 0 6px 6px 0;
  background: #10181c;
}

.note-grid {
  position: relative;
  background:
    linear-gradient(var(--roll-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--roll-line) 1px, transparent 1px),
    var(--roll);
  background-size: 100% 33px, 52px 100%;
}

.note-block {
  position: absolute;
  height: 24px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 18px rgba(65, 224, 207, 0.35);
}

.n1 { left: 4%;  top: 62%; width: 13%; }
.n2 { left: 20%; top: 44%; width: 8%;  }
.n3 { left: 33%; top: 26%; width: 17%; }
.n4 { left: 55%; top: 18%; width: 10%; }
.n5 { left: 60%; top: 40%; width: 21%; }
.n6 { left: 84%; top: 26%; width: 13%; }

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--playhead-x, 24%);
  width: 3px;
  background: #f4fbef;
  box-shadow: 0 0 20px rgba(217, 229, 79, 0.8);
  z-index: 3;
}

.velocity-lane {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 64px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.velocity-lane span {
  position: relative;
  width: 4px;
  height: var(--h, 60%);
  border-radius: 999px;
  background: var(--teal);
  opacity: 0.85;
}

.velocity-lane span::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
}

.stage-transport {
  display: flex;
  gap: 8px;
}

.transport-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.pill-lime {
  background: var(--lime-soft);
  box-shadow: inset 0 0 0 1px rgba(217, 229, 79, 0.4);
  color: var(--lime);
}

.pill-ghost {
  letter-spacing: 0.08em;
}

/* ---------- showcase (real screenshot + feature points) ---------- */

.showcase {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  padding: clamp(32px, 4vw, 56px);
  margin-bottom: var(--section-gap);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(65, 224, 207, 0.08), transparent 55%),
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.showcase-phone {
  margin: 0;
  width: min(66vw, 300px);
  padding: 10px;
  border-radius: 40px;
  background: #10181c;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--stroke-strong);
}

.showcase-phone img {
  width: 100%;
  border-radius: 32px;
}

.showcase-points {
  display: grid;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.showcase-points li {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.showcase-points strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.showcase-points li::before {
  content: "";
  display: block;
  width: 26px;
  height: 8px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(65, 224, 207, 0.5);
}

/* ---------- section leads & type scale ---------- */

h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.3rem);
}

.section-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-lead p,
.mode-copy p,
.routing-copy p,
.download-inner p,
.workflow-row p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.6;
}

/* ---------- workflow ---------- */

.workflow {
  margin-bottom: var(--section-gap);
}

.workflow-rows {
  display: grid;
  gap: 16px;
}

.workflow-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 0.9fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: center;
  padding: clamp(24px, 3vw, 36px) clamp(20px, 3vw, 40px);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
  transition: background-color 200ms ease;
}

.workflow-row:hover {
  background: var(--panel-2);
}

.row-mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.workflow-row h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

/* ---------- modes ---------- */

.mode-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: clamp(32px, 5vw, 72px);
  margin-bottom: var(--section-gap);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 20%, rgba(217, 229, 79, 0.06), transparent 45%),
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.mode-copy p {
  max-width: 420px;
  margin-top: 20px;
}

.mode-phones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 36px);
}

.mode-phones figure {
  width: min(44%, 250px);
  margin: 0;
}

.mode-phones figure:first-child {
  transform: translateY(16px);
}

.mode-phones figure:last-child {
  transform: translateY(-16px);
}

.mode-phones img {
  width: 100%;
  padding: 8px;
  border-radius: 30px;
  background: #10181c;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--stroke-strong);
}

.mode-phones figcaption {
  margin-top: 14px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

/* ---------- routing ---------- */

.routing {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: center;
  margin-bottom: var(--section-gap);
}

.routing-visual {
  justify-self: center;
  width: min(100%, 320px);
  margin: 0;
  padding: 10px;
  border-radius: 40px;
  background: #10181c;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--stroke-strong);
}

.routing-visual img {
  width: 100%;
  border-radius: 32px;
}

.routing-copy p {
  max-width: 560px;
  margin-top: 20px;
}

.capability-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.capability-list li {
  position: relative;
  padding: 16px 20px 16px 50px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
  color: var(--ink);
  font-weight: 600;
}

.capability-list li::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(65, 224, 207, 0.6);
}

/* ---------- download ---------- */

.download {
  margin-bottom: var(--section-gap);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% -20%, rgba(65, 224, 207, 0.12), transparent 60%),
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.download-inner {
  display: grid;
  justify-items: center;
  gap: 20px;
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(48px, 6vw, 80px) var(--gutter);
  text-align: center;
}

.download-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.download-inner h2 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 36px 0 56px;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.site-footer a {
  font-weight: 600;
  transition: color 160ms ease;
}

.site-footer a:hover {
  color: var(--teal);
}

/* ---------- reveal ---------- */

html.can-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}

html.can-reveal .reveal.is-visible,
.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .showcase {
    grid-template-columns: 1fr 1fr;
  }

  .showcase-phone {
    grid-column: 1 / -1;
    justify-self: center;
    order: -1;
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .header-inner {
    justify-content: space-between;
  }

  .hero,
  .mode-split,
  .routing {
    grid-template-columns: 1fr;
  }

  .routing-visual {
    order: 2;
  }

  .section-lead {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workflow-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .showcase {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .download-actions {
    width: 100%;
    flex-direction: column;
  }

  .download-actions .button {
    width: 100%;
  }

  .mode-phones figure:first-child,
  .mode-phones figure:last-child {
    transform: none;
  }

  .mode-phones figure {
    width: 48%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  html.can-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}
