/* =========================================================
   CoSparq — landing page
   One stylesheet. Dark, quiet, product-first.
   ========================================================= */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0a0a0a;
  --screen: #111111;          /* matches the demo videos' background */
  --bar: #0d0d0d;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);

  /* Text */
  --text: #f2f2f0;
  --text-2: #a3a3a0;
  --text-3: #6f6f6c;

  /* Single brand accent, used sparingly */
  --accent: #f96d16;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(96px, 13vw, 176px);
  --nav-h: 64px;
  --radius: 14px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: #0a0a0a; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 24px;
}
.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--primary {
  background: var(--text);
  color: #0a0a0a;
}
.btn--primary:hover { background: #ffffff; }

.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 26px; font-size: 16px; }

.btn__arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo__mark { width: 26px; height: 26px; }
.logo--sm { font-size: 15px; }
.logo--sm .logo__mark { width: 22px; height: 22px; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(10, 10, 10, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-2);
}
.nav__links a { transition: color 0.2s var(--ease); }
.nav__links a:hover { color: var(--text); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: var(--section-y);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 48px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-bottom: clamp(48px, 7vw, 88px);
}
.hero__title {
  font-size: clamp(2.75rem, 7.4vw, 6rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__lede {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-2);
  max-width: 42ch;
  margin-bottom: 28px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Facts row under hero video */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.facts li {
  padding: 24px 24px 0 0;
}
.facts li + li {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.facts__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.facts p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}

/* =========================================================
   FRAME (app window around each demo)
   ========================================================= */
.frame {
  position: relative;
  background: var(--screen);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.frame__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  padding: 0 10px 0 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.frame__dots { display: flex; gap: 6px; }
.frame__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #262626;
}
.frame__title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.frame__expand {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--text-3);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.frame__expand:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.frame__expand svg { width: 14px; height: 14px; }

.frame__screen {
  position: relative;
  aspect-ratio: var(--ratio, 1 / 1);
  background: var(--screen);
}
.frame__screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--screen);
}
/* The task manager recording has a 5px black edge on the left */
.frame__screen video.video--trim-left { object-view-box: inset(0 0 0 0.6%); }

/* =========================================================
   STORY (scroll-lit paragraph)
   ========================================================= */
.story {
  border-top: 1px solid var(--line);
}
.story__sticky {
  padding-block: var(--section-y);
}
.story__text {
  max-width: 24ch;
  font-size: clamp(1.75rem, 4.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.035em;
  text-wrap: pretty;
}
.story__text .chunk {
  transition: opacity 0.35s linear;
}

/* Scroll-driven version (JS on, motion allowed) */
html.js.motion .story { height: 260vh; }
html.js.motion .story__sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--nav-h) + 24px) 48px;
}
html.js.motion .story__text .chunk { opacity: var(--o, 0.16); }

/* =========================================================
   SECTION HEAD
   ========================================================= */
.how {
  border-top: 1px solid var(--line);
  padding-top: var(--section-y);
}
.section-head {
  max-width: 820px;
  margin-bottom: clamp(64px, 9vw, 120px);
}
.section-head__title {
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.section-head__sub {
  margin-top: 20px;
  max-width: 52ch;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: var(--text-2);
}

.step-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}
.step-index a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.step-index a:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }
.step-index span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* =========================================================
   STEPS
   ========================================================= */
.step {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding-block: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--line);
}
.step:last-child { padding-bottom: var(--section-y); }

.step__label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.step__label span { color: var(--accent); }

.step__title {
  font-size: clamp(1.625rem, 2.8vw, 2.375rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin-bottom: 16px;
}
.step__desc {
  color: var(--text-2);
  font-size: 16px;
  max-width: 44ch;
}

.step__points {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.step__points li {
  position: relative;
  padding: 13px 0 13px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
.step__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(13px + 0.75em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--text-3);
}

.step__media .frame__screen {
  aspect-ratio: var(--ratio, 1 / 1);
  max-height: min(76vh, 760px);
}

/* Wide step: copy above, full-width media below */
.step--wide {
  grid-template-columns: minmax(0, 1fr);
}
.step--wide .step__copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px clamp(40px, 6vw, 96px);
  align-items: end;
}
.step--wide .step__title { margin-bottom: 0; max-width: 16ch; }
.step--wide .step__media .frame__screen { max-height: none; }

/* =========================================================
   PRIVACY
   ========================================================= */
.privacy {
  border-top: 1px solid var(--line);
  padding-block: var(--section-y);
}
.privacy__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px clamp(40px, 6vw, 96px);
  align-items: start;
}
.privacy__list { border-top: 1px solid var(--line); }
.privacy__list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.privacy__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding-top: 4px;
}
.privacy__list p {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-2);
}
.privacy__list strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

/* =========================================================
   CTA
   ========================================================= */
.cta {
  border-top: 1px solid var(--line);
  padding-block: var(--section-y);
}
.cta__title {
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
  max-width: 12ch;
  text-wrap: balance;
}
.cta__sub {
  margin: 28px 0 36px;
  max-width: 48ch;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: var(--text-2);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
}
.footer__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 32px;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-2);
}
.footer__links a:hover { color: var(--text); }
.footer__copy {
  font-size: 13px;
  color: var(--text-3);
}

/* =========================================================
   REVEAL ON SCROLL
   ========================================================= */
html.js.motion .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}
html.js.motion .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .hero__grid,
  .step,
  .step--wide .step__copy,
  .privacy__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__grid { gap: 28px; }
  .step { gap: 36px; }
  .step--wide .step__copy { gap: 0; }
  .step--wide .step__title { margin-bottom: 16px; }
  .step__media .frame__screen { max-height: none; }

  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li,
  .facts li + li { padding: 20px 20px 20px 0; border-left: 0; }
  .facts li:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .facts li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .nav__links { display: none; }
  .nav__inner { justify-content: space-between; }

  .hero__actions .btn { flex: 1 1 auto; }

  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts li,
  .facts li:nth-child(even) { padding: 18px 0; border-left: 0; }
  .facts li + li { border-top: 1px solid var(--line); }

  .frame__bar { height: 34px; }
  .frame__dots i { width: 8px; height: 8px; }

  .footer__links { margin-left: 0; width: 100%; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
