/*
 * AutoClipper landing page. Tokens, type and radii follow the web app's design system
 * (web/src/app/globals.css): one dark theme, one font (Inter), gray surface steps and 1px
 * borders instead of shadows, a white pill for the main action, violet used sparingly and
 * amber/blue only for data (chat activity and loudness).
 */

@font-face {
  font-family: "Inter Variable";
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces, darkest to lightest */
  --surface-canvas: #0e0e10;
  --surface-sidebar: #141416;
  --surface-panel: #1a1a1d;
  --surface-control: #232327;
  --surface-elevated: #2c2c31;
  --surface-media: #000000;

  --border-subtle: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.14);

  --ink-primary: #fafafa;
  --ink-secondary: #a1a1aa;
  --ink-tertiary: #8b8b94;

  --primary: #fafafa;
  --primary-hover: #e4e4e7;
  --primary-ink: #0e0e10;

  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-soft: rgb(167 139 250 / 0.14);
  --accent-soft-ink: #ddd6fe;

  /* Data colors */
  --signal: #f5a524;
  --loudness: rgb(96 165 250 / 0.85);

  /* The start page's "Clips" color, for the backdrop glow */
  --option-clips: #f472b6;

  --radius-control: 0.5rem;
  --radius-card: 0.75rem;
  --radius-large: 1.25rem;
  --radius-pill: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: dark;
}

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

html {
  background: var(--surface-canvas);
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--ink-primary);
  text-decoration-color: rgb(255 255 255 / 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms var(--ease-out);
}
a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  text-wrap: balance;
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}
.wrap-wide {
  width: min(100% - 2.5rem, 80rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(14 14 16 / 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-primary);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a:not(.btn) {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  color: var(--ink-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms var(--ease-out);
}
.nav-list a:not(.btn):hover {
  color: var(--ink-primary);
}
.nav-list li:last-child {
  margin-left: 0.5rem;
}

/* Buttons: pills, like every button in the app */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms var(--ease-out),
    color 150ms var(--ease-out);
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--surface-control);
  color: var(--ink-primary);
}
.btn-secondary:hover {
  background: var(--surface-elevated);
}
.btn-small {
  min-height: 2rem;
  padding: 0.35rem 0.95rem;
  font-size: 0.85rem;
}
.btn-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}
/* The start page's backdrop: a soft pink glow from the top, a touch of violet at the side. */
.hero::before {
  content: "";
  position: absolute;
  inset: -3.5rem 0 auto;
  height: min(70rem, 120%);
  z-index: -1;
  background:
    radial-gradient(60% 55% at 50% 0%, rgb(244 114 182 / 0.2), transparent 72%),
    radial-gradient(35% 40% at 16% 6%, rgb(167 139 250 / 0.1), transparent 70%);
  pointer-events: none;
}
.hero-copy {
  text-align: center;
}
.hero h1 {
  max-width: 20ch;
  margin-inline: auto;
  font-size: clamp(2.4rem, 5.6vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

/*
 * The rotating phrase. All phrases share one grid cell, so the cell is always as wide and as
 * tall as the largest one and the page never shifts. The active phrase rises in while the old
 * one rises out; a soft violet marker sweeps in behind the words.
 */
.rotator {
  display: grid;
  justify-items: center;
}
.rotator-word {
  grid-area: 1 / 1;
  transition:
    opacity 450ms var(--ease-out),
    transform 450ms var(--ease-out);
}
.rotator-word:not(.is-active) {
  opacity: 0;
  transform: translateY(0.4em);
  pointer-events: none;
  user-select: none;
}
.rotator-word.is-leaving {
  transform: translateY(-0.4em);
}
.rotator-word > span {
  padding-inline: 0.06em;
  background: linear-gradient(
      transparent 56%,
      rgb(167 139 250 / 0.3) 56%,
      rgb(167 139 250 / 0.3) 90%,
      transparent 90%
    )
    no-repeat 0 0 / 0% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 500ms var(--ease-out) 120ms;
}
.rotator-word.is-active > span,
.rotator-word.is-leaving > span {
  background-size: 100% 100%;
}

.lede {
  max-width: 36rem;
  margin: 1.5rem auto 2.25rem;
  color: var(--ink-secondary);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.55;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.cta-note {
  margin-top: 1.25rem;
  color: var(--ink-tertiary);
  font-size: 0.875rem;
}
.cta-note a {
  color: var(--ink-secondary);
}

.hero-shot {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5rem);
  margin-bottom: 0;
}
/* A soft violet and pink glow behind the product shot. */
.hero-shot::before {
  content: "";
  position: absolute;
  inset: 8% 6% -4%;
  z-index: -1;
  background:
    radial-gradient(50% 60% at 30% 40%, rgb(167 139 250 / 0.22), transparent 70%),
    radial-gradient(45% 55% at 72% 55%, rgb(244 114 182 / 0.16), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* A framed screenshot or video: the app's large radius and a 1px border, no shadow. */
.frame {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-large);
  background: var(--surface-canvas);
}
.frame img,
.frame video {
  width: 100%;
}

/* Sections */
.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.section-head p {
  margin-top: 1rem;
  color: var(--ink-secondary);
  font-size: 1.075rem;
}

/* What you get: three real clips */
.clips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.clips figure {
  margin: 0;
}
.clips img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-large);
  background: var(--surface-media);
}
.clips figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.clips figcaption strong {
  font-weight: 600;
}
.clips figcaption span {
  color: var(--ink-tertiary);
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}
.step-num {
  color: var(--ink-tertiary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.step p {
  margin-top: 0.5rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}
.step-visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--surface-panel);
}
.step-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.step-visual-chart {
  background: var(--surface-canvas);
}
.step-visual-clip {
  background:
    radial-gradient(60% 80% at 50% 100%, rgb(167 139 250 / 0.12), transparent 70%),
    var(--surface-panel);
}
.step-visual-clip img {
  position: absolute;
  top: 7%;
  left: 50%;
  width: auto;
  height: 86%;
  aspect-ratio: 9 / 16;
  translate: -50% 0;
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
}

/* The ranked-moments chart (real data from one stream) */
.moments-chart {
  width: 100%;
  height: 100%;
}
.moments-chart text {
  font-family: var(--font-sans);
  font-size: 10px;
  fill: var(--ink-secondary);
}
.mc-chat {
  fill: rgb(245 165 36 / 0.5);
  stroke: var(--signal);
  stroke-width: 1;
  stroke-linejoin: round;
}
.mc-chat-key {
  fill: var(--signal);
}
.mc-loud {
  fill: none;
  stroke: var(--loudness);
  stroke-width: 1;
  stroke-linejoin: round;
}
.mc-loud-key {
  fill: var(--loudness);
}
.mc-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.mc-rule {
  stroke: rgb(167 139 250 / 0.55);
  stroke-width: 1;
}
.mc-dot {
  fill: var(--accent);
}
.moments-chart .mc-rank {
  fill: var(--primary-ink);
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}
.moments-chart .mc-time {
  fill: var(--ink-tertiary);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

/* Demo */
.demo {
  margin: 0;
}
.demo .frame {
  aspect-ratio: 16 / 10;
  background: var(--surface-media);
}
.demo video {
  height: 100%;
  object-fit: cover;
}

/* Screens */
.screens {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
}
.screen {
  margin: 0;
}
.screen .frame {
  border-radius: var(--radius-card);
}
.screen figcaption {
  max-width: 32rem;
  margin-top: 1rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}
.screen figcaption strong {
  color: var(--ink-primary);
  font-weight: 600;
}

/* Get it */
.get-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  align-items: start;
}
.get-card {
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-large);
  background: var(--surface-panel);
}
.get-card h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}
.get-card > p {
  margin-top: 0.6rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}
.get-card > p strong {
  color: var(--ink-primary);
  font-weight: 600;
}
.get-download .btn {
  margin-top: 1.5rem;
}
.get-download .fine {
  margin-top: 0.9rem;
  color: var(--ink-tertiary);
  font-size: 0.85rem;
}
.get-card .term {
  margin-top: 1.25rem;
}
.term-label {
  margin-top: 1rem !important;
  color: var(--ink-tertiary) !important;
  font-size: 0.85rem !important;
}
.term-label + .term {
  margin-top: 0.45rem;
}
.term {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--surface-canvas);
}
.term pre {
  margin: 0;
  padding: 0.85rem 5rem 0.85rem 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.7;
}
.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.3rem 0.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-control);
  color: var(--ink-secondary);
  font: 500 0.75rem var(--font-sans);
  cursor: pointer;
  transition:
    background-color 150ms var(--ease-out),
    color 150ms var(--ease-out);
}
.copy:hover {
  background: var(--surface-elevated);
  color: var(--ink-primary);
}
.copy[data-done] {
  background: var(--primary);
  color: var(--primary-ink);
}

/* Footer */
.site-footer {
  padding: 3rem 0 3.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--ink-tertiary);
  font-size: 0.875rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.footer-brand {
  max-width: 30rem;
}
.footer-brand p {
  margin-top: 0.75rem;
}
.footer-brand a:not(.brand) {
  color: var(--ink-secondary);
}
.footer-stack {
  margin-top: 0.35rem !important;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  color: var(--ink-secondary);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--ink-primary);
}

/*
 * Scroll motion. The inline script in <head> adds .motion to <html> only when JavaScript runs,
 * IntersectionObserver exists and the visitor hasn't asked for reduced motion; main.js marks
 * the blocks below the fold with .reveal and adds .is-in as each one scrolls into view. So
 * without JavaScript nothing is ever hidden. The transition lives on .is-in only, which makes
 * hiding instant and showing eased.
 */
.motion .reveal:not(.is-in) {
  opacity: 0;
  transform: translate3d(0, var(--reveal-rise, 16px), 0);
}
.motion .reveal.is-in {
  transition:
    opacity 480ms var(--ease-out) var(--reveal-delay, 0ms),
    transform 480ms var(--ease-out) var(--reveal-delay, 0ms);
}

/* The hero shot settles from slightly smaller and tilted back to flat over the first scroll. */
.motion .hero-shot .frame {
  --p: var(--hero-in, 0);
  transform-origin: 50% 0;
  transform: perspective(2000px) rotateX(calc((1 - var(--p)) * 5deg))
    scale(calc(0.94 + var(--p) * 0.06));
  will-change: transform;
}
.motion .hero-shot.is-settled .frame {
  transform: none;
  will-change: auto;
}

/* Responsive */
@media (max-width: 1000px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 2.75rem;
  }
}

@media (max-width: 820px) {
  .get-grid,
  .screens {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-hide {
    display: none;
  }
  .nav-list li:last-child {
    margin-left: 0;
  }
  /* The three clips scroll sideways instead of stacking into one very tall column. */
  .clips {
    display: flex;
    gap: 0.875rem;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1.25rem;
    scrollbar-width: none;
  }
  .clips::-webkit-scrollbar {
    display: none;
  }
  .clips li {
    flex: 0 0 68%;
    scroll-snap-align: start;
    /* Fade only: a rise would briefly overflow the sideways scroller. */
    --reveal-rise: 0px;
  }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    padding-top: 3.25rem;
  }
  .hero-shot .frame {
    border-radius: var(--radius-card);
  }
}

@media (max-width: 420px) {
  .wrap,
  .wrap-wide {
    width: min(100% - 2rem, 72rem);
  }
  .clips {
    margin-inline: -1rem;
    padding-inline: 1rem;
    scroll-padding-inline: 1rem;
  }
  .cta-row .btn {
    flex: 1 1 100%;
  }
  /* Small enough that the longest rotating phrase (about 9.1em) stays on one line. */
  .hero h1 {
    font-size: min(2.4rem, calc((100vw - 2rem) / 9.4));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* A backstop for the scripts: with reduced motion everything is shown, flat and still. */
  .motion .reveal:not(.is-in),
  .motion .hero-shot .frame {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .motion .reveal:not(.is-in),
  .motion .hero-shot .frame {
    opacity: 1;
    transform: none;
  }
}
