/* ── Design tokens ──────────────────────────────────────────────────── */
:root {
  /* Dark surface palette — matches the app */
  --paper:        #121116;
  --paper-raised: #1a191f;
  --paper-card:   #1f1e25;
  --paper-card-2: #26242d;

  /* Text */
  --ink:          #e2ddd8;
  --ink-soft:     rgba(226, 221, 216, 0.58);
  --ink-muted:    rgba(226, 221, 216, 0.34);

  /* Brand colors */
  --tomato:       #e63946;
  --tomato-glow:  rgba(230, 57, 70, 0.22);
  --leaf:         #2a9d8f;
  --leaf-glow:    rgba(42, 157, 143, 0.22);
  --plum:         #7b2cbf;
  --plum-glow:    rgba(123, 44, 191, 0.22);
  --amber:        #f5a623;

  /* Structure */
  --line:         rgba(255, 255, 255, 0.07);
  --focus:        rgba(123, 44, 191, 0.5);
  --shadow-sm:    0 2px 8px  rgba(0, 0, 0, 0.4);
  --shadow-md:    0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg:    0 20px 60px rgba(0, 0, 0, 0.6);

  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  -webkit-tap-highlight-color: rgba(230, 57, 70, 0.2);
}

body,
button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

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

button {
  border: 0;
}

h1, h2, h3, p {
  margin-top: 0;
}

[id] {
  scroll-margin-top: 80px;
}

/* ── Icons ──────────────────────────────────────────────────────────── */
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

.icon--github {
  fill: currentColor;
  stroke: none;
}

/* ── Skip link ──────────────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-150%);
  border-radius: 6px;
  background: var(--plum);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.15s ease;
}

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

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 36px;
  background: rgba(18, 17, 22, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
}

.nav-links a {
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--ink-soft);
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 7vw 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* Ambient glow behind the product shot */
.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 560px;
  height: 560px;
  background: radial-gradient(ellipse at center,
    rgba(230, 57, 70, 0.12) 0%,
    rgba(42, 157, 143, 0.08) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  color: var(--tomato);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 20px;
  font-size: 80px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero__lead {
  max-width: 520px;
  margin: 0 auto 36px;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 52px;
}

/* Product shot */
.hero__shot {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}

.hero__shot::before {
  content: "";
  position: absolute;
  inset: -20px -24px;
  background: radial-gradient(ellipse at center,
    rgba(230, 57, 70, 0.15) 0%,
    rgba(42, 157, 143, 0.1) 50%,
    transparent 75%);
  pointer-events: none;
  border-radius: 50%;
}

.product-shot {
  width: 300px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    var(--shadow-lg);
}

/* Ticker pills */
.hero__ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}

.hero__ticker span {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 700;
  font-size: 15px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.button--primary {
  background: var(--tomato);
  color: white;
  box-shadow: 0 4px 16px var(--tomato-glow);
}

.button--primary:hover {
  background: #d12f3c;
  box-shadow: 0 6px 24px rgba(230, 57, 70, 0.38);
  transform: translateY(-1px);
}

.button--quiet {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
}

.button--quiet:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  transform: translateY(-1px);
}

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

/* ── Section shared ──────────────────────────────────────────────────── */
.section-band {
  padding: 80px 7vw;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
}

.features {
  padding: 80px 7vw;
  border-bottom: 1px solid var(--line);
}

.section-copy {
  max-width: 600px;
  margin-bottom: 48px;
}

.section-kicker {
  display: block;
  margin: 0 0 12px;
  color: var(--tomato);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* ── Mechanic section ────────────────────────────────────────────────── */
.mechanic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.budget-demo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.budget-track {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-card);
  padding: 20px 22px;
  overflow: hidden;
  position: relative;
}

.budget-track__label {
  display: block;
  margin-bottom: 14px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.budget-track__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}

.budget-track__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.budget-track--work .budget-track__fill {
  width: 72%;
  background: var(--tomato);
  box-shadow: 0 0 12px var(--tomato-glow);
  transition: width 0.9s linear;
}

.budget-track--break .budget-track__fill {
  width: 38%;
  background: var(--leaf);
  box-shadow: 0 0 12px var(--leaf-glow);
  transition: width 0.9s linear;
}

/* Active phase glow */
.budget-track.is-active {
  border-color: rgba(255, 255, 255, 0.14);
}

.budget-track--work.is-active {
  box-shadow: 0 0 0 1px rgba(230, 57, 70, 0.25), 0 4px 24px rgba(230, 57, 70, 0.1);
}

.budget-track--break.is-active {
  box-shadow: 0 0 0 1px rgba(42, 157, 143, 0.25), 0 4px 24px rgba(42, 157, 143, 0.1);
}

.budget-track__time {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.budget-track--work .budget-track__time {
  color: var(--tomato);
}

.budget-track--break .budget-track__time {
  color: var(--leaf);
}

/* Phase switcher — interactive button */
.phase-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--paper-card-2);
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink-soft);
  align-self: flex-start;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.phase-switch:hover {
  background: var(--paper-card);
  border-color: rgba(255, 255, 255, 0.14);
}

.phase-switch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.phase-switch__label {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* The sliding rail */
.phase-switch__rail {
  width: 80px;
  flex: 0 0 80px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  min-width: 48px;
  overflow: hidden;
}

/* JS-driven thumb — uses translateX set by script */
.phase-switch__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: 0 0 10px var(--tomato-glow);
  transform: translateY(-50%) translateX(2px);
  transition:
    transform 0.35s ease-out,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* ── Features ─────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.feature-card {
  background: var(--paper-card);
  padding: 28px 30px;
  transition: background-color 0.15s ease;
}

.feature-card:hover {
  background: var(--paper-card-2);
}

.feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 10px;
}

.feature-card:nth-child(1) .feature-card__icon {
  background: var(--tomato-glow);
  color: var(--tomato);
}

.feature-card:nth-child(2) .feature-card__icon {
  background: var(--leaf-glow);
  color: var(--leaf);
}

.feature-card:nth-child(3) .feature-card__icon {
  background: var(--plum-glow);
  color: var(--plum);
}

.feature-card:nth-child(4) .feature-card__icon {
  background: rgba(245, 166, 35, 0.15);
  color: var(--amber);
}

.feature-card__icon .icon {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Answers ──────────────────────────────────────────────────────────── */
.answers {
  border-bottom: 1px solid var(--line);
}

.answer-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
}

.answer-list div {
  background: var(--paper-card);
  padding: 24px 26px;
}

.answer-list dt {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.answer-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Download ─────────────────────────────────────────────────────────── */
.download {
  border-bottom: 1px solid var(--line);
}

.download-intro,
.download-note {
  color: var(--ink-soft);
  line-height: 1.55;
}

.download-intro {
  max-width: 560px;
  margin-bottom: 28px;
  font-size: 15px;
}

.download-note {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.download-link {
  display: grid;
  gap: 6px;
  min-width: 0;
  background: var(--paper-card);
  padding: 18px 20px;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
  cursor: pointer;
}

.download-link:hover,
.download-link:focus-visible {
  background: var(--paper-card-2);
}

.download-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.download-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.download-link > span:not(.download-link__icon) {
  display: block;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.download-link strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.download-link small {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

.download-link--preferred {
  background: rgba(230, 57, 70, 0.08);
  border-color: rgba(230, 57, 70, 0.2);
}

.download-link--preferred .download-link__icon {
  background: var(--tomato-glow);
  color: var(--tomato);
}

.download-link--preferred strong {
  color: var(--tomato);
}

.download-link--source {
  background: rgba(123, 44, 191, 0.08);
}

.download-link--source .download-link__icon {
  background: var(--plum-glow);
  color: var(--plum);
}

.download-link--source strong {
  color: var(--plum);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 7vw;
  color: var(--ink-muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* ── Animations ───────────────────────────────────────────────────────── */
/* @keyframes shuttle removed — thumb is now JS-driven */

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

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

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Responsive: 980px ────────────────────────────────────────────────── */
@media (max-width: 980px) {
  h1 {
    font-size: 60px;
  }

  h2 {
    font-size: 32px;
  }

  .hero {
    padding-top: 92px;
    padding-bottom: 48px;
  }

  .hero__lead {
    font-size: 17px;
  }

  .product-shot {
    width: min(260px, 70vw);
  }

  .mechanic {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .budget-demo {
    max-width: 480px;
  }

  .feature-grid,
  .answer-list {
    grid-template-columns: 1fr;
  }

  .section-copy {
    max-width: 100%;
  }
}

/* ── Responsive: 680px ────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .site-header {
    padding: 10px 20px;
    min-height: 58px;
  }

  .nav-links a {
    padding: 8px;
    font-size: 13px;
  }

  .nav-links a:nth-child(1) {
    display: none;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 28px;
  }

  .hero {
    padding: 82px 20px 44px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .product-shot {
    width: min(240px, 68vw);
  }

  .section-band,
  .features,
  .download,
  .answers {
    padding: 56px 20px;
  }

  .download-actions {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
