/* Montserrat (SIL Open Font License, see fonts/Montserrat-OFL.txt), served from this site. */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Every colour comes from one base hue (--h) and saturation (--s).
   site.js picks a random dark theme by changing those two values. */
:root {
  --h: 345;
  --s: 55%;

  --l: 9%;
  --bg: hsl(var(--h) var(--s) var(--l));
  --bg-raise: hsl(var(--h) var(--s) calc(var(--l) + 4%));
  --line: hsl(var(--h) calc(var(--s) * 0.6) 24%);
  --ink: hsl(var(--h) 30% 95%);
  --muted: hsl(var(--h) 18% 74%);
  --hue-a: hsl(calc(var(--h) + 45) 90% 72%);
  --hue-b: hsl(var(--h) 85% 70%);
  --hue-c: hsl(calc(var(--h) - 55) 80% 74%);
  --spectrum: linear-gradient(100deg, var(--hue-a), var(--hue-b) 50%, var(--hue-c));

  --display: "Montserrat", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --page: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  /* One vertical gap for the whole page: between sections, divider lines, text blocks,
     videos and cards. Text is trimmed to its letters (see below), so this is the visible gap. */
  --space: calc(var(--gutter) + 1rem);

  /* Montserrat metrics, used to trim text to the top of its lowercase letters and its baseline. */
  --asc: 0.968;
  --desc: 0.251;
  --xh: 0.53;
  --lh: 1.6;

  color-scheme: dark;
}

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

html { background: var(--bg); }

body {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  html, body { transition: background-color 0.6s ease; }
}

a { color: inherit; text-decoration-color: var(--hue-b); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--ink); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  --lh: 1.08;
  --xh: 0.54; /* bold lowercase letters are slightly taller */
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  --after: 2.25rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 20ch; }
h3 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; --after: 2rem; }

p { margin: 0; --after: 2rem; max-width: 62ch; }

/* Trim the invisible line spacing above and below text, so every gap is measured
   from the top of the lowercase letters to the baseline. Text blocks set their spacing
   with --before and --after; the trim is subtracted from those here. */
main :is(p, h1, h2, h3, h4, .steps li, .requirements li, .post li, .teaser li, .features li, .paths dt, .paths dd):not(.price, .template-source) {
  line-height: var(--lh);
  margin-top: calc(var(--before, 0px) - (var(--asc) - var(--xh) + (var(--lh) - var(--asc) - var(--desc)) / 2) * 1em);
  margin-bottom: calc(var(--after, 0px) - (var(--desc) + (var(--lh) - var(--asc) - var(--desc)) / 2) * 1em);
}

.spectrum {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header and footer */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.9rem;
  text-decoration: none;
}
.wordmark img { display: block; border-radius: 22%; }

.bottom {
  --footer-row-gap: 1.5rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space) var(--gutter);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--footer-row-gap) 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.bottom p { margin: 0 0 0.5rem; }
.bottom p:last-child { margin-bottom: 0; }
.privacy-web { max-width: 36rem; }
.footer-end { display: flex; flex-direction: column; align-items: flex-end; }
.footer-brand { display: flex; align-items: center; line-height: 1; }
.footer-brand .wordmark { font-size: 1.25rem; color: var(--ink); }
.privacy-web strong { color: var(--ink); font-weight: 600; }
.footer-details { flex: 1 1 100%; display: grid; gap: var(--gutter); }
.footer-details > div > p:first-child strong { color: var(--ink); }

@media (min-width: 40rem) {
  .footer-details { flex-basis: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Match the footer's top padding, including its existing row gap below the links. */
.footer-guides { flex-basis: 100%; margin-bottom: calc(var(--space) - var(--footer-row-gap)); }
.footer-guides a { text-decoration: none; }
.footer-guides a:hover { color: var(--ink); }
.footer-guides h3 { font-size: inherit; line-height: inherit; letter-spacing: normal; color: var(--ink); }
.footer-guides h3 { margin-bottom: calc(var(--gutter) / 4); }
.footer-guide-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: var(--gutter);
}
.footer-guide-alternatives { grid-column: 1 / -1; }
.footer-guide-group:last-child { grid-area: 1 / 2; }
.footer-guides ul { list-style: none; margin: 0; padding: 0; }
.footer-guides li { break-inside: avoid; margin-bottom: 0; }
.footer-guide-alternatives ul { columns: 2; column-gap: var(--gutter); }
.footer-guides [aria-current="page"] { color: var(--ink); }

@media (min-width: 60rem) {
  .footer-guide-groups {
    grid-template-columns: repeat(5, max-content);
    grid-auto-flow: row;
    justify-content: space-between;
    column-gap: calc(var(--gutter) / 2);
  }
  .footer-guides li { white-space: nowrap; }
  .footer-guide-alternatives { grid-column: auto; }
  .footer-guide-group:last-child { grid-area: auto; }
  .footer-guide-alternatives ul {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    grid-template-rows: repeat(5, auto);
    grid-auto-flow: column;
    column-gap: calc(var(--gutter) / 2);
  }
}

/* Layout */

.hero, .band {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.band { padding-top: var(--space); }
.hero, .band { padding-bottom: var(--space); }
.band :last-child { margin-bottom: 0; --after: 0px; }
/* Text right before a video, card or list lets that element's gap (--space) take over. */
main :has(+ :is(.shot, .teaser)) { --after: 0px; }

.hero {
  padding-top: clamp(1.5rem, 4vw, 3rem);
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -6rem 0 auto auto;
  width: min(60rem, 90vw);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, hsl(calc(var(--h) + 45) 90% 55% / 0.22), transparent 70%),
              radial-gradient(closest-side at 30% 60%, hsl(calc(var(--h) - 55) 80% 55% / 0.18), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero + .band, .band + .band { border-top: 1px solid var(--line); }
.band.band-undivided { border-top-color: transparent; }

.hero h1 { --after: var(--space); }
.lede { font-size: clamp(1.15rem, 1.8vw, 1.35rem); color: var(--ink); max-width: none; }
/* Wide screens: the intro paragraph sits left of the video. */
@media (min-width: 60rem) {
  .hero:has(.shot) { display: grid; grid-template-columns: 1fr 3fr; column-gap: clamp(2rem, 4vw, 4rem); align-items: start; }
  .hero h1 { grid-column: 1 / -1; }
  .hero .shot { margin: 0; }
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: var(--space) clamp(2rem, 6vw, 5rem);
  align-items: start;
}

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }

.button {
  display: inline-block;
  font: 700 1rem/1 var(--display);
  padding: 1rem 1.5rem;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  color: hsl(var(--h) 60% 10%);
  background: var(--spectrum);
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }

.button-quiet {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}
.button-quiet:hover { filter: none; box-shadow: inset 0 0 0 1px var(--muted); }

/* Media placeholders: replace each figure's frame with an image or video. */

.shot { margin: var(--space) 0 0; }
.shot video { display: block; width: 100%; height: auto; border-radius: 14px; }

.shot-frame {
  aspect-ratio: var(--ratio, 16 / 9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  border-radius: 14px;
  border: 1px dashed var(--line);
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, hsl(var(--h) var(--s) 50% / 0.05) 22px 23px),
    var(--bg-raise);
  color: var(--muted);
}
.shot-frame p { max-width: 50ch; --after: 0px; }
.shot-frame .shot-kind { color: var(--ink); font-weight: 600; --after: 1rem; }

.placeholder-text { color: var(--muted); font-style: italic; }

/* Pricing */

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.8rem 1rem 0.8rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 500; color: var(--muted); font-size: 0.9rem; }

.table-scroll { overflow-x: auto; }
.provider { display: inline-flex; align-items: center; gap: 0.5em; }
.provider img { display: block; flex: none; border-radius: 22%; }
.prices th[scope="row"] { font-weight: 400; white-space: nowrap; }
.prices :is(td, thead th:not(:first-child)) { text-align: center; padding: 0.8rem 0.75rem; }
.prices .na { color: var(--muted); }

/* Providers, steps, models */

.steps { margin: 0; padding-left: 1.4rem; }
.steps li { --after: 1.5rem; padding-left: 0.3rem; }
.steps li::marker { color: var(--hue-b); font-weight: 600; }

.providers { width: auto; }
.providers th[scope="row"] { font-weight: 600; padding-right: 3rem; }
.providers td:nth-child(2), .providers thead th:nth-child(2) { text-align: right; padding-right: 2.5rem; }
.providers td:last-child, .providers thead th:last-child { padding-right: 0; }

/* Prompt template demo */

.template {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 14px;
  background: var(--bg-raise);
}
.template-source { font-family: var(--mono); font-size: 0.95rem; color: var(--muted); }
.template-result {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  --lh: 1.3;
  --before: 2rem;
  --after: 2rem;
}

/* Privacy */

.paths { margin: 0; }
.paths dt { color: var(--muted); font-size: 0.95rem; }
.paths dd { margin-left: 0; --before: 1.25rem; }
.paths dd + dd { --before: 0.75rem; }
.paths dd + dt { --before: 2rem; }
.paths dd.paths-note { --before: 1.25rem; color: var(--muted); }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--bg);
  overflow-wrap: anywhere;
}
.note { color: var(--muted); --before: 2rem; }

/* Features */

.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 2rem 3rem;
}
.features strong { display: block; font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 0.25rem; }
.features li { color: var(--muted); }
.features strong { color: var(--ink); }

/* Download */

.download { text-align: left; }
.download h2 { font-size: clamp(2.25rem, 5.5vw, 4.25rem); max-width: none; }

.price { display: flex; align-items: center; gap: 2rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.3; margin: calc(var(--space) - 2.25rem - 0.57em) 0 0.75rem; } /* visible gap from the heading to the top of "$39" equals --space */
.price .spectrum { font-size: 3.6em; font-weight: 800; line-height: 1; }
.price-trial { color: var(--muted); --after: var(--space); }

.download .actions { display: grid; grid-template-columns: repeat(auto-fill, 15.5rem); }
.download .actions > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; text-align: center; } /* both buttons share one row height */
.download .actions .button { display: flex; flex-direction: column; justify-content: center; }
.button-sub { font-weight: 400; font-size: 0.85em; margin-top: 0.4em; }
.button-note { color: var(--muted); font-size: 0.9rem; --before: 1rem; }
.download h4 { font-family: var(--display); font-weight: 700; font-size: 1rem; --after: 1rem; }
.download-body { display: grid; gap: var(--space); }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 22rem)); gap: 2rem 4rem; }
.requirements { margin: 0; padding-left: 1.2rem; }
.requirements li { --after: 1.5rem; }
.requirements li::marker { color: var(--hue-b); }

/* Keeping up */

.teaser { max-width: 46rem; margin-top: var(--space); }
.teaser time { color: var(--muted); font-size: 0.95rem; }
.teaser h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); --before: 1rem; --after: 1.25rem; }

.posts { padding-top: 0; }
.post { max-width: 46rem; padding: 3rem 0; }
.post + .post { border-top: 1px solid var(--line); }
.post time { color: var(--muted); font-size: 0.95rem; }
.post h2 { --before: 1rem; }
:is(.post, .teaser) ul { padding-left: 1.2rem; margin: 0 0 1rem; }
:is(.post, .teaser) li { --after: 1.5rem; }
:is(.post, .teaser) li::marker { color: var(--hue-b); }

@media (max-width: 40rem) {
  th, td { padding-right: 0.6rem; font-size: 0.95rem; }
}

/* Experiment: "you" and "your" in the hero headline, in a shifted hue. */
.hue-shift {
  background: linear-gradient(100deg, hsl(calc(var(--h) + 30) 100% 86%), hsl(calc(var(--h) + 10) 100% 88%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede .hue-shift { font-weight: 700; }

/* A darker shade of the same tint, for words highlighted inside a tinted heading. */
.hue-deep {
  background: linear-gradient(100deg, hsl(calc(var(--h) + 30) 95% 70%), hsl(calc(var(--h) + 10) 95% 72%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
