:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111114;
  --sub: #5f5f6b;
  --faint: #9b9ba6;
  --line: rgba(17, 17, 20, 0.1);
  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --code-bg: #f1f1f4;
  --device: #0d0d10;
  --device-edge: #2a2a31;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0b0b0e;
  --surface: #131317;
  --text: #f2f2f5;
  --sub: #a3a3ae;
  --faint: #6b6b76;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #a78bfa;
  --accent-ink: #0b0b0e;
  --code-bg: #15151a;
  --device: #050507;
  --device-edge: #26262d;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ------------------------------------------------------------ ambient */

/* Big soft shapes drifting behind the page. Transform-only, so it stays cheap. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient i {
  position: absolute;
  width: var(--size);
  height: var(--size);
  background: var(--c);
  opacity: 0.16;
  filter: blur(80px);
  animation:
    var(--drift) var(--d) ease-in-out infinite alternate,
    morph var(--m) ease-in-out infinite alternate;
  will-change: transform;
}

:root[data-theme='dark'] .ambient i {
  opacity: 0.14;
}

.ambient i:nth-child(1) { --c: #7c3aed; --size: 44vmax; left: -12vmax; top: -14vmax; --drift: drift-a; --d: 13s; --m: 9s; }
.ambient i:nth-child(2) { --c: #2563eb; --size: 36vmax; right: -10vmax; top: 18vh; --drift: drift-b; --d: 11s; --m: 8s; }
.ambient i:nth-child(3) { --c: #ea580c; --size: 30vmax; left: 30vw; bottom: -14vmax; --drift: drift-c; --d: 15s; --m: 10s; }
.ambient i:nth-child(4) { --c: #db2777; --size: 24vmax; left: 8vw; top: 55vh; --drift: drift-d; --d: 12s; --m: 7s; }

@keyframes drift-a {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(22vw, 10vh) rotate(70deg) scale(1.12); }
  66% { transform: translate(8vw, 26vh) rotate(150deg) scale(0.9); }
  100% { transform: translate(30vw, 4vh) rotate(220deg) scale(1.05); }
}

@keyframes drift-b {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(-20vw, 18vh) rotate(-60deg) scale(0.88); }
  66% { transform: translate(-6vw, -12vh) rotate(-140deg) scale(1.15); }
  100% { transform: translate(-28vw, 6vh) rotate(-210deg) scale(0.95); }
}

@keyframes drift-c {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(-24vw, -16vh) rotate(80deg) scale(1.1); }
  66% { transform: translate(18vw, -24vh) rotate(160deg) scale(0.92); }
  100% { transform: translate(-8vw, -34vh) rotate(240deg) scale(1.08); }
}

@keyframes drift-d {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(30vw, -14vh) rotate(-90deg) scale(1.2); }
  66% { transform: translate(52vw, 8vh) rotate(-170deg) scale(0.9); }
  100% { transform: translate(20vw, -30vh) rotate(-250deg) scale(1.1); }
}

@keyframes morph {
  0% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  50% { border-radius: 63% 37% 41% 59% / 58% 62% 38% 42%; }
  100% { border-radius: 36% 64% 52% 48% / 66% 35% 65% 34%; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient i {
    animation: none;
    border-radius: 50%;
  }
}

.top,
main,
.foot {
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------ header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark-pill {
  display: inline-flex;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.mark-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.mark-pill i:first-child {
  background: var(--accent);
}

.top-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 22px);
  font-size: 14px;
}

.top-links a {
  text-decoration: none;
  color: var(--sub);
}

.top-links a:hover {
  color: var(--text);
}

.star-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.star-link svg,
.btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.icon-moon {
  display: none;
}

:root[data-theme='light'] .icon-sun {
  display: none;
}

:root[data-theme='light'] .icon-moon {
  display: block;
}

/* ------------------------------------------------------------ hero */

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 440px) auto;
  justify-content: space-between;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
  padding: clamp(40px, 7vw, 88px) 0 64px;
}

.hero-copy,
.stage {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--sub);
}

h1 {
  margin: 0;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 13ch;
}

.lede {
  margin: 22px 0 28px;
  max-width: 46ch;
  font-size: 18px;
  color: var(--sub);
}

.install {
  display: flex;
  align-items: center;
  max-width: 470px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--code-bg);
  overflow: hidden;
}

.install code {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  font-size: 13.5px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.install code::-webkit-scrollbar {
  display: none;
}

.copy {
  align-self: stretch;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 600 13px var(--sans);
  cursor: pointer;
}

.copy:hover {
  background: var(--line);
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}

.btn:hover {
  border-color: var(--faint);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  border-color: var(--accent);
  filter: brightness(1.06);
}

.meta {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--faint);
}

/* ------------------------------------------------------------ device */

/* Phone and its settings sit side by side; they stack on narrower screens. */
.stage {
  display: flex;
  align-items: center;
  gap: 36px;
}

.phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* The phone is drawn at 390×844 and scaled to fit by site.js. */
.device-wrap {
  --scale: 0.82;
  width: calc(414px * var(--scale));
  height: calc(868px * var(--scale));
}

.device {
  width: 414px;
  height: 868px;
  padding: 12px;
  border-radius: 64px;
  background: var(--device);
  box-shadow:
    0 0 0 1px var(--device-edge),
    0 0 0 6px color-mix(in srgb, var(--device-edge) 55%, transparent),
    0 40px 80px -30px rgba(0, 0, 0, 0.5);
  transform: scale(var(--scale));
  transform-origin: top left;
  position: relative;
}

.device iframe {
  display: block;
  width: 390px;
  height: 844px;
  border: 0;
  border-radius: 52px;
  background: var(--bg);
}

.island {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 120px;
  height: 34px;
  margin-left: -60px;
  border-radius: 20px;
  background: #000;
  z-index: 2;
  pointer-events: none;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.controls {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 210px;
}

.controls fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.controls legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.controls label {
  position: relative;
  cursor: pointer;
}

.controls input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.controls span {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--sub);
  background: var(--surface);
}

.controls input:checked + span {
  color: var(--accent-ink);
  background: var(--text);
  border-color: var(--text);
}

.controls .swatches {
  gap: 8px;
}

.controls .swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid var(--line);
}

.controls .swatch-default {
  background: var(--surface);
  background-image: linear-gradient(135deg, transparent 46%, var(--faint) 46%, var(--faint) 54%, transparent 54%);
}

.controls input:checked + .swatch {
  background: var(--c);
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--text);
}

.controls input:checked + .swatch-default {
  background: var(--surface);
  background-image: linear-gradient(135deg, transparent 46%, var(--faint) 46%, var(--faint) 54%, transparent 54%);
}

.controls .swatch-custom .swatch {
  background-image: conic-gradient(from 0deg, #f43f5e, #f59e0b, #22c55e, #0ea5e9, #8b5cf6, #f43f5e);
}

.controls .swatch-custom input:checked + .swatch {
  background-image: none;
}

.controls .swatch-custom input[type='color'] {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  opacity: 0;
  pointer-events: none;
}

.controls input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ sections */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.features article {
  padding: 32px 28px 36px 0;
  border-bottom: 1px solid var(--line);
}

.features article:not(:nth-child(3n + 1)) {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.features h2,
.usage h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.features p,
.usage p {
  margin: 0;
  color: var(--sub);
}

.usage {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: start;
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.code {
  margin: 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--code-bg);
  font: 13.5px/1.7 var(--mono);
  overflow-x: auto;
}

.code .c {
  color: var(--faint);
}

.code .k {
  color: var(--accent);
}

.code .s {
  color: #0e9f6e;
}

:root[data-theme='dark'] .code .s {
  color: #6ee7b7;
}

.code .t {
  color: var(--text);
  font-weight: 600;
}

.star {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 56px 0;
}

.star p {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 34ch;
}

/* ------------------------------------------------------------ footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--sub);
}

.foot p {
  margin: 0;
}

.foot a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.foot a:hover {
  border-color: var(--text);
}

.foot-links {
  display: flex;
  gap: 18px;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 1200px) {
  .stage {
    flex-direction: column;
    gap: 14px;
  }

  .controls {
    max-width: 420px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .stage {
    order: 2;
  }

  .features {
    grid-template-columns: 1fr 1fr;
  }

  .features article,
  .features article:not(:nth-child(3n + 1)) {
    padding: 28px 20px 30px 0;
    border-left: 0;
  }

  .features article:nth-child(2n) {
    padding-left: 20px;
    border-left: 1px solid var(--line);
  }

  .usage {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .top-links a:not(.star-link) {
    display: none;
  }

  /* Let the install command wrap instead of hiding its end. */
  .install code {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .code {
    padding: 18px;
    font-size: 12px;
  }

  .star p {
    font-size: 18px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .features article,
  .features article:nth-child(2n) {
    padding: 24px 0;
    border-left: 0;
  }
}
