/* The marketing site's stylesheet. Same tokens as web/core/tokens.css and
   apple/Sources/Design.swift, name for name, because the site and the app have to look
   like one product. Dark only, ONE accent - a second accent colour is the thing not to add.

   Zero dependencies and no build step, same rule as the rest of the repo: this is a file the
   browser loads. Anything here that needs compiling is in the wrong place. */

:root {
  --bg: #0b0c0e;
  --surface: #141619;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f0f0f0;
  --dim: #858585;
  --accent: #b7f24c;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --measure: 68rem;
}

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

html {
  scroll-behavior: smooth;
  /* The one dark surface the browser itself paints: form controls, the overscroll gutter,
     and the scrollbar. Without it a dark page has a white rubber-band edge. */
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(1rem, 0.95rem + 0.25vw, 1.125rem) / 1.6 ui-sans-serif, -apple-system,
    BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.wrap {
  width: min(100% - var(--gutter) * 2, var(--measure));
  margin-inline: auto;
}

/* ── The mark ─────────────────────────────────────────────────────────────── */

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
}
.mark svg {
  width: 1.35em;
  height: 1.35em;
  flex: none;
}
.mark .dot {
  color: var(--accent);
}

/* ── Header ───────────────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
header.stuck {
  border-bottom-color: var(--line);
}
header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4.25rem;
}
nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
}
nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.18s ease;
}
nav a:hover {
  color: var(--text);
}
@media (max-width: 40rem) {
  nav a.hide-sm {
    display: none;
  }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 620;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.16s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-solid {
  background: var(--accent);
  color: #0b0c0e;
}
.btn-solid:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: rgba(255, 255, 255, 0.03);
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* ── Type scale ───────────────────────────────────────────────────────────── */

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--dim);
  margin: 0 0 1.1rem;
}
h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 660;
  margin: 0;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
  font-weight: 640;
  margin: 0 0 1rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.18rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 640;
  margin: 0 0 0.5rem;
}
.lede {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--dim);
  max-width: 40ch;
  text-wrap: pretty;
}
.on {
  color: var(--accent);
}
p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}
.dim {
  color: var(--dim);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2rem, 5vw, 3.5rem);
  position: relative;
}
/* One soft wash of the accent behind the headline. Not a gradient scheme - a light source,
   so the top of the page is not a flat black rectangle. */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% 0 auto;
  height: 60rem;
  background: radial-gradient(
    50% 40% at 50% 30%,
    rgba(183, 242, 76, 0.09) 0%,
    rgba(183, 242, 76, 0) 70%
  );
  pointer-events: none;
  z-index: -1;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.hero-note {
  margin-top: 1.1rem;
  font-size: 0.86rem;
  color: var(--dim);
}

.video-frame {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: clamp(12px, 1.6vw, 20px);
  overflow: hidden;
  background: var(--surface);
  /* A shadow the same hue as the accent, at almost nothing - it reads as depth, not colour. */
  box-shadow: 0 40px 120px -40px rgba(183, 242, 76, 0.16), 0 2px 0 0 rgba(255, 255, 255, 0.03) inset;
}
.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}
.video-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.video-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  display: block;
}
.video-bar span {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--dim);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

section {
  padding: clamp(4rem, 10vw, 8rem) 0;
  /* The header is sticky, so an anchor jump has to clear it or the heading lands underneath. */
  scroll-margin-top: 5rem;
}
.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.split {
  display: grid;
  gap: clamp(1.75rem, 5vw, 4.5rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 56rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
  .split.flip > *:first-child {
    order: 2;
  }
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin-top: 2.5rem;
}
.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  transform: translateY(-2px);
}
.card p {
  color: var(--dim);
  font-size: 0.96rem;
  margin: 0;
}
.card .glyph {
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}

/* ── The demo panels (real UI, not a mockup) ──────────────────────────────── */

.shot {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 80px -50px rgba(0, 0, 0, 0.9);
}
.shot img {
  width: 100%;
  height: auto;
}
.shot figcaption {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.surfaces .shot img {
  max-height: 32rem;
  object-fit: cover;
  object-position: top center;
}
.surfaces {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  margin-top: 2.75rem;
  align-items: start;
}

/* ── The state rail ───────────────────────────────────────────────────────── */

.rail {
  display: flex;
  align-items: flex-start;
  margin-top: 2.5rem;
  counter-reset: stop;
}
.rail .stop {
  flex: 1;
  position: relative;
  padding-top: 2.25rem;
  padding-right: 1rem;
}
.rail .stop::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}
.rail .stop::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
}
.rail .stop:last-child {
  padding-right: 0;
}
.rail .stop b {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.rail .stop span {
  color: var(--dim);
  font-size: 0.95rem;
}
@media (max-width: 44rem) {
  .rail {
    display: grid;
    gap: 1.5rem;
  }
  .rail .stop {
    padding-right: 0;
  }
}

/* ── Quiet band ───────────────────────────────────────────────────────────── */

.band {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: clamp(1.75rem, 5vw, 3.25rem);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.pill {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 650;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.pill.live {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 4rem;
  color: var(--dim);
  font-size: 0.9rem;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
}
footer nav {
  margin-left: auto;
}

/* ── Motion ───────────────────────────────────────────────────────────────── */

/* Every element that animates in starts hidden ONLY when the browser can animate it back.
   Without the :has() guard a browser with no IntersectionObserver would leave the page blank,
   which is a worse failure than no animation. The class is added by the inline script. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].seen {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card:hover {
    transform: none;
  }
}
