/* Every colour is a mix between its light and dark value by --dark (0..1), which script.js drives from the
   scroll position inside .dark-scene. The page starts light even when the OS is in dark mode. */
:root {
  --dark: 0;
  --m: calc(var(--dark) * 100%);
  --accent: #615cf2;
  --accent-deep: #2b1f7a;
  --red: #f25757;
  --accent-ink: color-mix(in srgb, #4a44d9, #a5a1ff var(--m));
  --bg: color-mix(in srgb, #ffffff, #000000 var(--m));
  --bg-2: color-mix(in srgb, #ffffff, #161617 var(--m));
  --text: color-mix(in srgb, #1d1d1f, #f5f5f7 var(--m));
  --muted: color-mix(in srgb, #6e6e73, #a1a1a6 var(--m));
  --line: color-mix(in srgb, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12) var(--m));
  --card: color-mix(in srgb, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.05) var(--m));
  /* Like apple.com: a white page with grey tiles and near-black text; glass tiles on the dark one. */
  --tile: color-mix(in srgb, #f5f5f7, rgba(255, 255, 255, 0.05) var(--m));
  --tile-line: color-mix(in srgb, rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.12) var(--m));
  --shot-bg: color-mix(in srgb, #ffffff, #1e1e1e var(--m));
  --shadow:
    0 0 0 1px rgb(255 255 255 / calc(0.08 * var(--dark))),
    0 1px 2px rgb(20 18 60 / calc(0.06 * (1 - var(--dark)))),
    0 30px 70px -24px color-mix(in srgb, rgba(43, 31, 122, 0.3), rgba(0, 0, 0, 0.8) var(--m));
  --glow-a: color-mix(in srgb, rgba(97, 92, 242, 0.18), rgba(97, 92, 242, 0.45) var(--m));
  --glow-b: rgba(242, 87, 87, 0.07);
  --serif: "Instrument Serif", "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 22px;
  --section-gap: clamp(110px, 15vw, 200px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
code {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.05em 0.4em;
  margin: 0 0.08em;
  text-align: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-2);
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--bg-2); border-radius: 8px; }
.skip:focus { left: 8px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { width: min(1120px, 100% - 32px); margin-inline: auto; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav nav a:hover { color: var(--text); }
.nav nav a.nav-cta { color: var(--text); padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.lang { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); }
.nav .lang a { font-size: 13px; padding: 4px 4px; }
.nav .lang a[aria-current] { color: var(--text); font-weight: 600; }

/* Type: big, tight, bold */
h1, h2, h3 { margin: 0; letter-spacing: -0.035em; line-height: 1.05; font-weight: 700; }
h1 { font-size: clamp(48px, 8.6vw, 112px); letter-spacing: -0.048em; line-height: 1.0; }
h2 { font-size: clamp(38px, 5.6vw, 72px); }
h3 { font-size: 19px; letter-spacing: -0.015em; line-height: 1.3; font-weight: 650; }
h1 em, h2 em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
h2 em { color: var(--muted); }
.eyebrow {
  margin: 0 0 16px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink);
}
.grad {
  background: linear-gradient(100deg, #615cf2 5%, #a45cf2 45%, #f25757 95%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Spell-check squiggle signature */
.nowrap { white-space: nowrap; }
.squiggle { position: relative; display: inline-block; font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.squiggle svg { position: absolute; left: 2%; right: 2%; bottom: -0.1em; width: 96%; height: 0.16em; overflow: visible; }
.squiggle path {
  fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 200; stroke-dashoffset: 0;
}
html.js .squiggle path { stroke-dashoffset: 200; transition: stroke-dashoffset 1.1s cubic-bezier(.65, 0, .35, 1) .5s; }
html.js .squiggle.drawn path { stroke-dashoffset: 0; }

/* Hero */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 0; text-align: center; isolation: isolate; }
.hero-glow {
  position: absolute; inset: -120px 0 auto; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 50% 30%, var(--glow-a), transparent 70%),
    radial-gradient(25% 30% at 70% 45%, var(--glow-b), transparent 70%);
  filter: blur(20px);
}
.hero-icon {
  width: 104px; margin: 0 auto 20px;
  filter: drop-shadow(0 18px 30px rgba(43, 31, 122, 0.35));
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px) rotate(-1deg); } }
.hero .eyebrow { margin-bottom: 14px; }
.lede { max-width: 660px; margin: 26px auto 0; font-size: clamp(19px, 2.1vw, 24px); color: var(--muted); line-height: 1.45; letter-spacing: -0.01em; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.gh { fill: currentColor; stroke: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #736ef7, var(--accent) 45%, #4b40c9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 24px -6px rgba(97, 92, 242, 0.7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 30px -6px rgba(97, 92, 242, 0.85); }
.btn-ghost { color: var(--text); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.btn-ghost:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--card) 60%, var(--line)); }
.meta { margin: 20px 0 0; font-size: 14px; color: var(--muted); }

/* Scroll scenes: script.js writes --p (0..1) on every [data-scene]. Without JS --p falls back to 1 (final state). */
.scene-pin { position: sticky; top: 0; height: 100vh; height: 100svh; }
.hero-scene { height: 175vh; }
.hero-pin { display: flex; justify-content: center; align-items: flex-start; padding-top: 84px; perspective: 1800px; }
.hero-shot {
  width: min(100% - 32px, 1440px, (100vh - 120px) * 1.637);
  width: min(100% - 32px, 1440px, (100svh - 120px) * 1.637);
  transform-origin: 50% 0;
}
html.js .hero-shot { transform: rotateX(calc((1 - var(--p, 1)) * 16deg)) scale(calc(0.74 + 0.26 * var(--p, 1))); will-change: transform; }

/* Screenshot frame. A dark twin (added by script.js) sits on top and shows with --dark once it has loaded. */
.shot { margin: 0; position: relative; }
.shot img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--shot-bg);
}
.shot .dark-twin { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.shot .dark-twin.ready { opacity: var(--dark); }

/* Sections */
.section { padding: var(--section-gap) 0 0; }
.section-head { max-width: 900px; margin: 0 auto 64px; text-align: center; }

/* Showcase: centred copy, then a pinned screenshot that grows from a small frame to full width */
.showcase-head { text-align: center; max-width: 880px; }
.showcase-head > p:not(.eyebrow) { max-width: 680px; margin: 24px auto 0; color: var(--muted); font-size: clamp(18px, 1.9vw, 21px); }
.showcase-scene { height: 170vh; margin-top: 24px; }
.showcase-pin { display: grid; place-items: center; padding-top: 56px; }
.showcase-shot {
  width: min(100% - 32px, 1320px, (100vh - 110px) * 1.539);
  width: min(100% - 32px, 1320px, (100svh - 110px) * 1.539);
}
html.js .showcase-shot { transform: scale(calc(0.6 + 0.4 * var(--p, 1))); will-change: transform; }
.ticks-cols { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 32px; margin-top: 40px; }
.feature-copy > p.more:not(.eyebrow) { margin-top: 22px; }
.feature-copy > p:not(.eyebrow) + p:not(.eyebrow) { margin-top: 14px; }
.feature-copy .more a { color: var(--accent-ink); font-weight: 500; text-decoration: none; }
.feature-copy .more a:hover { text-decoration: underline; }
.ticks-4 { grid-template-columns: repeat(4, 1fr); max-width: 1080px; margin-inline: auto; }

.feature-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.feature-flip .feature-grid { grid-template-columns: 7fr 5fr; }
.feature-flip .feature-copy { order: 2; }
.feature-copy h2 { margin-bottom: 22px; font-size: clamp(34px, 4vw, 54px); }
.feature-copy > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 18px; }
.shot-tall { max-width: 560px; justify-self: center; }
.shot-small { max-width: 620px; justify-self: center; }
html.js .feature-shot[data-scene] {
  transform: translateY(calc((1 - var(--p, 1)) * 80px)) scale(calc(0.88 + 0.12 * var(--p, 1)));
  transform-origin: 50% 100%;
}

.ticks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; font-size: 16px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.32em; width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* "Want it dark?": pinned for 300vh of scroll. The device settles, the page darkens and its screen
   crossfades to the dark capture, then the answer rises in. Headlines are gradients so they stay legible
   on every background in between. */
.dark-scene { height: 400vh; margin-top: var(--section-gap); }
.dark-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(16px, 3.5vh, 44px);
  padding: 72px 16px 24px; text-align: center;
  --s: clamp(0, var(--p, 1) * 2, 1);
  --a: clamp(0, (var(--p, 1) - 0.62) * 5, 1);
}
.dark-q, .dark-a {
  margin: 0; font-weight: 700; line-height: 1.02;
  background: linear-gradient(100deg, #6f6af5 10%, #a45cf2 55%, #d9569c 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dark-q { font-size: clamp(44px, min(11vw, 13vh), 150px); letter-spacing: -0.05em; padding-bottom: 0.06em; }
.dark-a {
  font-size: clamp(36px, min(8vw, 10vh), 110px); letter-spacing: -0.045em; padding-bottom: 0.08em;
  background-image: linear-gradient(100deg, #f25757 5%, #f2795a 50%, #f2a65a 95%);
}
.dark-device {
  margin: 0;
  width: min(100%, 1100px, (70vh - 130px) * 1.6);
  width: min(100%, 1100px, (70svh - 130px) * 1.6);
  padding: clamp(5px, 0.9vw, 12px);
  border-radius: clamp(14px, 2vw, 26px);
  background: linear-gradient(180deg, #3a3a3e, #1d1d1f);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 40px 90px -30px rgba(0, 0, 0, 0.55);
}
.dark-shot img { border-radius: clamp(9px, 1.2vw, 16px); border: 0; box-shadow: none; }
html.js .dark-device { transform: translateY(calc((1 - var(--s)) * 10vh)) scale(calc(0.8 + 0.2 * var(--s))); will-change: transform; }
html.js .dark-a { opacity: var(--a); transform: translateY(calc((1 - var(--a)) * 0.6em)); }

/* Final */
.final { padding-bottom: var(--section-gap); }
.final-inner {
  text-align: center; padding: clamp(56px, 8vw, 104px) 24px; border-radius: 36px;
  background:
    radial-gradient(60% 80% at 50% 0%, var(--glow-a), transparent 70%),
    var(--card);
  border: 1px solid var(--line);
}
.final-inner img { margin: 0 auto 24px; width: 104px; filter: drop-shadow(0 14px 24px rgba(43, 31, 122, 0.35)); }
.final-inner p { max-width: 520px; margin: 20px auto 0; color: var(--muted); font-size: 18px; }

.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.footer p { margin: 0; display: flex; align-items: center; gap: 8px; }
.footer a { color: var(--muted); }

/* Scroll reveal: only hidden once JS is confirmed running */
html.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
html.js .reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .ticks-4 { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .feature-flip .feature-grid { grid-template-columns: 1fr; }
  .feature-flip .feature-copy { order: 0; }
}
@media (max-width: 700px) {
  /* Phones: screenshots are too small to be worth pinning, they just scale in as they arrive. */
  .hero-scene, .showcase-scene { height: auto; }
  .hero-scene .scene-pin, .showcase-scene .scene-pin { position: static; height: auto; }
  .hero-pin { padding-top: 44px; }
  .showcase-pin { padding-top: 0; }
  .hero-shot, .showcase-shot { width: calc(100% - 32px); }
  .dark-scene { height: 300vh; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav nav > a:not(.nav-cta) { display: none; }
  .nav nav { gap: 14px; }
  .hero-icon { width: 96px; }
  .ticks-4 { grid-template-columns: 1fr; }
  .shot img { border-radius: 10px; }
  .btn { width: 100%; justify-content: center; }
  .cta { max-width: 340px; margin-inline: auto; margin-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .hero-shot, html.js .showcase-shot, html.js .feature-shot[data-scene], html.js .dark-device, html.js .dark-a { transform: none; }
  html.js .dark-a { opacity: 1; }
  html.js .squiggle path { stroke-dashoffset: 0; }
  .hero-scene, .showcase-scene { height: auto; }
  .hero-scene .scene-pin, .showcase-scene .scene-pin { position: static; height: auto; }
  .dark-scene { height: 200vh; }
}
