/* Nimblor public site. See docs/design_system.md. */

:root {
  --mist: #dce2e0;
  --paper: #f2f5f4;
  --tide: #0f2f38;
  --tide-2: #174450;
  --teal: #226276;
  --ink: #14242a;
  --slate: #4c5e64;
  --rule: rgba(20, 36, 42, 0.14);
  --violet: #b07fed;
  --cyan: #96e7ef;
  --on-tide: #e6efee;
  --on-tide-2: #a9bec0;

  --gutter: clamp(20px, 4.4vw, 72px);
  --max: 1440px;
  --nav-h: 76px;

  --sans: "Mona Sans", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--cyan);
  color: var(--tide);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--tide);
  color: var(--paper);
  border-radius: 4px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-stopped {
  overflow: clip;
}

/* ---------- Display type ---------- */

.display {
  font-weight: 430;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(2.4rem, 5.4vw, 5.2rem);
}

.lede {
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  line-height: 1.5;
  max-width: 34ch;
  color: var(--slate);
}

.prose p + p {
  margin-top: 1em;
}

.prose {
  max-width: 62ch;
}

/* ---------- Links and buttons ---------- */

.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color 0.2s, text-decoration-thickness 0.2s;
}

.link:hover {
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

.button {
  --bg: var(--teal);
  --fg: #f4f8f8;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-weight: 560;
  font-size: 1rem;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s var(--ease);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--tide);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.button:hover::before {
  transform: scaleX(1);
}

.button--light {
  --bg: var(--paper);
  --fg: var(--tide);
}

.button--light::before {
  background: var(--cyan);
}

.button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.button__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn--loading .button__spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  transition: background-color 0.35s, box-shadow 0.35s, transform 0.45s var(--ease);
}

.nav--solid {
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: 0 1px 0 var(--rule);
}

.nav--hidden {
  transform: translateY(-100%);
}

.nav:focus-within {
  transform: none;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.nav__logo img {
  width: 132px;
  height: auto;
  max-width: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 0.95rem;
}

.nav__links a {
  text-decoration: none;
  font-weight: 480;
}

.nav__links a:not(.button):hover,
.nav__links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.nav__links .button {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.95rem;
}

.nav__toggle {
  display: none;
}

@media (max-width: 820px) {
  :root {
    --nav-h: 64px;
  }

  .nav__logo img {
    width: 112px;
  }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-weight: 520;
    cursor: pointer;
  }

  .nav__toggle-bars {
    position: relative;
    width: 20px;
    height: 10px;
  }

  .nav__toggle-bars::before,
  .nav__toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.3s var(--ease), top 0.3s var(--ease);
  }

  .nav__toggle-bars::before {
    top: 0;
  }

  .nav__toggle-bars::after {
    top: 8.5px;
  }

  .nav--open .nav__toggle-bars::before {
    top: 4.25px;
    transform: rotate(45deg);
  }

  .nav--open .nav__toggle-bars::after {
    top: 4.25px;
    transform: rotate(-45deg);
  }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 28px;
    background: var(--paper);
    box-shadow: 0 1px 0 var(--rule);
    font-size: 1.5rem;
    font-variation-settings: "wdth" 110;
    letter-spacing: -0.02em;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.35s var(--ease), visibility 0s 0.35s;
  }

  .nav--open {
    background: var(--paper);
  }

  .nav--open .nav__links {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.25s, transform 0.35s var(--ease);
  }

  .nav__links a:not(.button) {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
  }

  .nav__links .button {
    margin-top: 20px;
    min-height: 52px;
    justify-content: center;
    font-size: 1rem;
    letter-spacing: 0;
    font-variation-settings: "wdth" 100;
  }
}

/* ---------- Film (homepage hero) ---------- */

.film {
  --a: 0;
  --b: 0;
  --c: 0;
  --d: 0;
  --f: 0;
  --z: 0;
  --zs: 0.2;
  --mark: 2.2;
  --r: 0;
  --rest: 0.55;
  --fs: clamp(3rem, min((min(100vw, var(--max)) - 2 * var(--gutter)) / 5.4, 24vh), 16rem);
  position: relative;
  height: 460vh;
  background: var(--mist);
}

.film__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.film__poster,
.film__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Approximates where site.js places the mark (behind the headline's seam) until the canvas
   takes over; the fractions are the mark's bounding box within the rendered frame. */
.film__poster {
  z-index: 0;
  inset: auto;
  left: 50%;
  top: 43vh;
  top: 43svh;
  width: auto;
  height: calc(var(--fs) * var(--mark) / 0.71);
  transform: translate(-51.2%, -50.2%);
  opacity: var(--rest);
  transition: opacity 0.4s;
}

/* At rest the mark is a softer layer behind the headline; it comes to full strength over the
   first 8% of the scroll, as it starts to grow. */
.film__canvas {
  opacity: calc(var(--rest) + (1 - var(--rest)) * var(--r));
}

@media (max-aspect-ratio: 9/10) {
  .film {
    --mark: 3.2;
  }

  .film__poster {
    top: 40vh;
    top: 40svh;
    height: calc(var(--fs) * var(--mark) / 0.288);
    transform: translate(-51.5%, -50.1%);
  }
}

.film.is-live .film__poster {
  opacity: 0;
}

.hero {
  position: absolute;
  inset: 0;
  padding: calc(var(--nav-h) + 3vh) var(--gutter) 5vh;
  display: grid;
  grid-template-rows: 1fr auto;
  pointer-events: none;
  max-width: var(--max);
  margin-inline: auto;
}

.hero a,
.hero button {
  pointer-events: auto;
}

.hero__title {
  position: relative;
  z-index: 2;
  align-self: center;
  font-size: var(--fs);
  font-weight: calc(380 + 140 * var(--a));
  letter-spacing: -0.045em;
  line-height: 0.9;
  color: var(--ink);
}

.hero__word {
  display: block;
  font-variation-settings: "wdth" calc(125 - 50 * var(--a));
  transform: translate3d(calc(-5vw * var(--b)), calc(-3vh * var(--b)), 0);
  opacity: calc(1 - var(--b) * 2.6);
}

.hero__baseline {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: baseline;
}

.hero__word + .hero__word {
  text-align: right;
  transform: translate3d(calc(5vw * var(--b)), calc(3vh * var(--b)), 0);
}

.hero__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  opacity: calc(1 - var(--f));
  transform: translateY(calc(3vh * var(--f)));
}

.hero__intro .lede {
  color: var(--ink);
  max-width: 36ch;
  margin-bottom: 22px;
}

.hero__beta {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  max-width: 290px;
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink);
}

.hero__beta img {
  border-radius: 10px;
}

.hero__beta strong {
  display: block;
  font-weight: 620;
}

.hero__beta:hover span {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Behind the film canvas, so the line is revealed in the gap between the halves. */
.film__thesis {
  position: absolute;
  inset: 0;
  z-index: 0;
  font-variation-settings: "wdth" calc(125 - 13 * var(--d));
  letter-spacing: calc(-0.035em + 0.05em * (1 - var(--d)));
  display: grid;
  place-items: center;
  padding-inline: var(--gutter);
  text-align: center;
  font-size: clamp(2.6rem, 7.4vw, 8rem);
  color: var(--ink);
  opacity: var(--z);
  transform: scale(var(--zs));
  pointer-events: none;
}

.film__thesis > span {
  display: block;
}

/* Fixed lines: the width animation stretches each line in place and can never rewrap it. */
.film__line {
  display: block;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .film {
    height: 400vh;
  }

  .hero {
    padding-bottom: 4vh;
  }

  .hero__foot {
    flex-direction: column;
    align-items: start;
  }

  .hero__intro .lede {
    font-size: 1rem;
    margin-bottom: 16px;
  }

  .hero__foot {
    gap: 18px;
  }

  .hero__beta {
    grid-template-columns: 32px 1fr;
    gap: 10px;
    max-width: none;
    font-size: 0.82rem;
  }

  .hero__beta img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }


  /* Sized so the widest (opening) state of "The gap is the" still fits a 320px screen. */
  .film__thesis {
    font-size: 10.2vw;
  }
}

@media (min-width: 821px) and (max-height: 800px) {
  .hero {
    padding-top: calc(var(--nav-h) + 1vh);
    padding-bottom: 4vh;
  }

  .hero__intro .lede {
    font-size: 1.05rem;
    margin-bottom: 14px;
  }
}

/* Landscape phones: leave room for the intro below the headline. */
@media (max-height: 500px) and (min-aspect-ratio: 9/10) {
  .film {
    --fs: clamp(2.4rem, 15vh, 16rem);
  }

  .hero__title {
    justify-self: center;
    width: fit-content;
  }
}

@media (max-height: 500px) and (max-width: 820px) and (min-aspect-ratio: 9/10) {
  .film {
    --fs: 2.4rem;
  }
}

@media (max-width: 820px) and (max-height: 760px) {
  .hero__intro .link {
    display: none;
  }

  .hero__beta span {
    font-size: 0.78rem;
  }
}

/* ---------- Approach ---------- */

.approach {
  background: var(--mist);
  padding: 0 0 clamp(72px, 8vw, 128px);
}

.approach__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.approach__lead {
  grid-column: 1 / span 11;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  font-weight: 420;
  font-variation-settings: "wdth" 108;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.approach__more {
  grid-column: 7 / span 6;
  margin-top: clamp(28px, 4vw, 56px);
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--slate);
}

.approach__more p + p {
  margin-top: 1.1em;
}

@media (max-width: 820px) {
  .approach__lead,
  .approach__more {
    grid-column: 1 / -1;
  }
}

/* ---------- Services on the homepage ---------- */

.work {
  padding: clamp(96px, 12vw, 180px) 0;
}

.work__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: clamp(48px, 7vw, 110px);
}

.work__head h2 {
  grid-column: 1 / span 7;
}

.work__head .work__note {
  grid-column: 9 / span 4;
  color: var(--slate);
}

.work__note p + p {
  margin-top: 0.8em;
}

.work__body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.specimen {
  grid-column: 1 / span 5;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  aspect-ratio: 1;
}

.specimen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.6s var(--ease), transform 1.2s var(--ease);
}

.specimen img.is-active {
  opacity: 1;
  transform: none;
}

.offers {
  grid-column: 7 / span 6;
  list-style: none;
  padding: 0;
}

.offer {
  padding: 40px 0 44px;
  border-top: 1px solid var(--rule);
  color: var(--slate);
  transition: color 0.4s;
}

.offer:last-child {
  border-bottom: 1px solid var(--rule);
}

.offer.is-active {
  color: var(--ink);
}

.offer h3 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 450;
  font-variation-settings: "wdth" 110;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 14px;
  color: var(--ink);
}

.offer p {
  max-width: 44ch;
  margin-bottom: 18px;
}

.offer__img {
  display: none;
}

.work__actions {
  margin-top: 56px;
}

@media (max-width: 900px) {
  .work__head h2,
  .work__head .work__note,
  .offers {
    grid-column: 1 / -1;
  }

  .specimen {
    display: none;
  }

  .offer {
    color: var(--ink);
    display: grid;
    grid-template-columns: 1fr 96px;
    gap: 0 18px;
  }

  .offer > * {
    grid-column: 1;
  }

  .offer__img {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 104px;
    height: 104px;
    margin-top: -8px;
  }
}

/* ---------- Software (dark chapter) ---------- */

.software {
  overflow: clip;
  background: var(--tide);
  color: var(--on-tide);
  padding: clamp(96px, 12vw, 180px) 0 clamp(72px, 8vw, 120px);
}

.software ::selection {
  background: var(--cyan);
  color: var(--tide);
}

.software :focus-visible {
  outline-color: var(--cyan);
}

.software__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: end;
  margin-bottom: clamp(56px, 8vw, 120px);
}

.software__head h2 {
  grid-column: 1 / span 7;
}

.software__head p {
  grid-column: 1 / span 5;
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--on-tide-2);
}

.product {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: center;
}

.product + .product {
  margin-top: clamp(96px, 12vw, 180px);
}

.product {
  align-items: start;
}

.product__art {
  grid-column: 1 / span 6;
  margin: -6% 0 0 calc(var(--gutter) * -0.5);
}

.product__art {
  position: relative;
}

.product__art img {
  width: 100%;
  height: auto;
}

.product__art canvas {
  position: absolute;
  /* The fly-in frames extend past the art: 0.3 of its width to the left and 0.4 of its height
     above and below, so the pages start off-screen. Edges fade so nothing is cut at a line. */
  left: -30%;
  top: -40%;
  width: 130%;
  height: 180%;
  max-width: none;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent), linear-gradient(to right, transparent, #000 12%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent), linear-gradient(to right, transparent, #000 12%);
  mask-composite: intersect;
}

.product__art.is-live img {
  visibility: hidden;
}

.product__text {
  grid-column: 8 / span 5;
}

.product__name {
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  font-weight: 460;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.04em;
  line-height: 1;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 34px;
  font-size: 0.95rem;
  color: var(--on-tide-2);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}

.status--dev::before {
  background: transparent;
  border: 1.5px solid var(--on-tide-2);
}

.product__tagline {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 460;
  font-variation-settings: "wdth" 106;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 18px;
}

.product__text .prose {
  color: var(--on-tide-2);
}

.product__text .actions {
  margin-top: 34px;
}

.product__fine {
  margin-top: 22px;
  font-size: 0.875rem;
  color: var(--on-tide-2);
  max-width: 46ch;
}

.product--ousley {
  align-items: start;
}

.product--ousley .product__text {
  grid-column: 1 / span 5;
}

.product--ousley .signup {
  grid-column: 7 / span 6;
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}

.signup {
  padding-top: 28px;
  border-top: 1px solid rgba(230, 239, 238, 0.22);
}

.signup h4 {
  font-size: 1.5rem;
  font-weight: 480;
  font-variation-settings: "wdth" 108;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.signup > p {
  margin: 10px 0 26px;
  color: var(--on-tide-2);
}

.partners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
  margin-top: clamp(96px, 12vw, 160px);
  padding-top: 32px;
  border-top: 1px solid rgba(230, 239, 238, 0.16);
  font-size: 0.9rem;
  color: var(--on-tide-2);
}

.partners__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 44px;
}

.partners img {
  height: 44px;
  width: auto;
}

.partners img.is-wide {
  height: 20px;
}

@media (max-width: 900px) {
  .software__head h2,
  .software__head p,
  .product__art,
  .product__text,
  .product--ousley .product__text,
  .product--ousley .signup {
    grid-column: 1 / -1;
  }

  .product__art {
    margin: 0 calc(var(--gutter) * -1);
  }
}

/* Glimshelf on desktop: the art and its text pin together while the pages settle, and the
   section scrolls on once the icon is finished. site.js sets --glim-pin-h to the pinned height. */
.product__pin {
  display: contents;
}

@media (min-width: 901px) {
  #glimshelf {
    display: block;
    height: calc(var(--glim-pin-h, 700px) + 60vh);
  }

  #glimshelf .product__pin {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: center;
    position: sticky;
    top: max(calc(var(--nav-h) + 16px), calc((100vh - var(--glim-pin-h, 700px)) / 2));
  }

  #glimshelf .product__art {
    margin-top: 0;
  }
}

/* ---------- Inside Glimshelf (product screens) ---------- */

.inside {
  margin-top: clamp(96px, 12vw, 180px);
}

.inside__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: end;
  margin-bottom: clamp(24px, 4vw, 48px);
}

.inside__title {
  grid-column: 1 / span 7;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}

.inside__head p {
  grid-column: 8 / span 4;
  color: var(--on-tide-2);
}

.inside__steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.inside__step {
  min-height: 165vh;
  min-height: 165svh;
}

/* Caption and phone pin together while their step is on screen. */
.inside__pin {
  position: sticky;
  top: max(calc(var(--nav-h) + 8px), calc((100vh - min(736px, 81.8vh)) / 2));
  top: max(calc(var(--nav-h) + 8px), calc((100svh - min(736px, 81.8svh)) / 2));
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: center;
}

.inside__text {
  grid-column: 1 / span 5;
}

.inside__text h4 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 460;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--on-tide);
}

.inside__text p {
  max-width: 40ch;
  color: var(--on-tide-2);
}

.inside__credit {
  margin-top: 18px;
  font-size: 0.85rem;
}

.inside__credit a {
  color: var(--on-tide);
}

.inside__device {
  grid-column: 8 / span 4;
  perspective: 1400px;
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.35));
}

.inside__device img {
  width: min(100%, 360px, 40vh);
  height: auto;
  margin-inline: auto;
}

.inside__ipad {
  margin: clamp(40px, 8vw, 120px) 0 0;
  perspective: 1800px;
}

.inside__ipad-frame {
  filter: drop-shadow(0 50px 80px rgba(0, 0, 0, 0.4));
}

.inside__ipad-frame img {
  width: min(100%, 1100px, 100svh);
  height: auto;
  margin-inline: auto;
}

.inside + .product {
  margin-top: clamp(96px, 12vw, 180px);
}

.inside__ipad figcaption {
  max-width: 44ch;
  margin: clamp(32px, 4vw, 56px) auto 0;
  text-align: center;
}

.inside__ipad h4 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 460;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.inside__ipad figcaption p {
  color: var(--on-tide-2);
}

/* Each phone tilts up out of the page as it arrives and tips back as it leaves. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 901px) {
    .inside__device img {
      animation: phone-arrive linear both, phone-leave linear forwards;
      animation-timeline: view(), view();
      animation-range: entry 0% cover 45%, exit 0% exit 100%;
    }

    .inside__ipad-frame img {
      transform-origin: 50% 100%;
      animation: ipad-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
  }
}

@keyframes phone-arrive {
  from {
    transform: translateY(12vh) rotateX(38deg) rotateZ(-6deg) scale(0.86);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
}

@keyframes phone-leave {
  to {
    transform: translateY(-10vh) rotateX(-30deg) rotateZ(4deg) scale(0.9);
    opacity: 0;
  }
}

@keyframes ipad-rise {
  from {
    transform: rotateX(34deg) scale(0.82);
    opacity: 0.3;
  }
}

@media (max-width: 900px) {
  .inside__title,
  .inside__head p {
    grid-column: 1 / -1;
  }

  .inside__head p {
    margin-top: 16px;
  }

  .inside__step {
    min-height: 0;
    padding-bottom: 72px;
  }

  .inside__pin {
    position: static;
    display: block;
  }

  .inside__text {
    padding-top: 0;
    margin-bottom: 28px;
  }

  .inside__device img {
    width: min(68%, 300px);
  }
}

/* ---------- Invitation ---------- */

.invite {
  position: relative;
  background: var(--mist);
  padding: clamp(110px, 15vw, 220px) 0;
  /* clip, not hidden: hidden would make this a scroll container and freeze the
     heading's scroll-driven animation */
  overflow: clip;
}

.invite__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.invite__grid {
  position: relative;
}

.invite__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
}

.invite h2 {
  grid-column: 1 / span 9;
  font-size: clamp(3rem, 9vw, 9.6rem);
  font-variation-settings: "wdth" 120;
}

.invite__side {
  grid-column: 10 / span 3;
}

.home .invite h2 {
  grid-column: 1 / span 7;
  grid-row: 1 / span 2;
  align-self: center;
}

.invite__mark {
  position: relative;
  grid-column: 8 / span 5;
  grid-row: 1;
  aspect-ratio: 16 / 10;
}

.invite__mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.invite.is-live .invite__mark img {
  visibility: hidden;
}

.home .invite__side {
  grid-column: 8 / span 4;
  grid-row: 2;
}

.invite__side p {
  color: var(--slate);
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .invite h2,
  .invite__side,
  .home .invite h2,
  .home .invite__side,
  .invite__mark {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .invite__mark {
    aspect-ratio: 1;
    max-width: 420px;
    width: 100%;
    justify-self: center;
  }
}

/* ---------- Footer ---------- */

.footer {
  padding: 64px 0 44px;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--slate);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px 24px;
  align-items: start;
}

.footer__brand {
  grid-column: 1 / span 4;
}

.footer__brand img {
  width: 148px;
  height: auto;
  max-width: none;
  margin-bottom: 14px;
}

.footer__line {
  font-size: 1.35rem;
  font-weight: 460;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.footer__nav {
  grid-column: 6 / span 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__nav a {
  text-decoration: none;
  color: var(--ink);
}

.footer__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer__meta {
  grid-column: 9 / span 4;
  display: grid;
  gap: 10px;
}

@media (max-width: 820px) {
  .footer__brand,
  .footer__nav,
  .footer__meta {
    grid-column: 1 / -1;
  }
}

/* ---------- Subpages ---------- */

.field-note {
  padding-top: clamp(72px, 9vw, 130px);
  padding-bottom: clamp(96px, 12vw, 170px);
}

.field-note__body {
  max-width: 760px;
  margin-inline: auto;
}

.field-note__lead {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: clamp(64px, 9vw, 112px);
}

.field-note section + section,
.field-note__figure + section {
  margin-top: clamp(72px, 9vw, 120px);
}

.field-note h2 {
  font-size: clamp(2.25rem, 4.4vw, 4.1rem);
  margin-bottom: 32px;
}

.field-note p + p {
  margin-top: 1.15em;
}

.field-note section p {
  max-width: 68ch;
}

.field-note__figure {
  margin: clamp(72px, 9vw, 120px) auto 0;
  max-width: 440px;
}

.field-note__figure img {
  width: 100%;
  height: auto;
}

.field-note__figure figcaption {
  margin-top: 14px;
  color: var(--slate);
  font-size: 0.9rem;
}

.page-head {
  padding: calc(var(--nav-h) + clamp(56px, 9vw, 140px)) 0 clamp(56px, 7vw, 100px);
  background: var(--mist);
}

.page-head__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
}

.page-head h1 {
  grid-column: 1 / span 8;
  font-size: clamp(3rem, 7.6vw, 7.8rem);
}

.page-head__side {
  grid-column: 9 / span 4;
}

.page-head__side .lede {
  color: var(--ink);
  margin-bottom: 26px;
}

.page-head__side .meta {
  margin-top: 22px;
  font-size: 0.9rem;
  color: var(--slate);
}

@media (max-width: 900px) {
  .page-head h1,
  .page-head__side {
    grid-column: 1 / -1;
  }
}

.detail {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding: clamp(64px, 8vw, 120px) 0;
  border-top: 1px solid var(--rule);
}

.detail:first-child {
  border-top: 0;
}

.detail__art {
  grid-column: 1 / span 4;
  aspect-ratio: 1;
}

.detail:nth-child(even) .detail__art {
  grid-column: 9 / span 4;
  grid-row: 1;
}

.detail:nth-child(even) .detail__text {
  grid-column: 1 / span 6;
  grid-row: 1;
}

.detail__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail__text {
  grid-column: 6 / span 6;
}

.detail h2 {
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  margin-bottom: 20px;
}

.detail h3 {
  font-size: 1.25rem;
  font-weight: 560;
  margin-bottom: 12px;
}

.detail ul {
  margin: 24px 0 28px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.detail li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 900px) {
  .detail__art,
  .detail:nth-child(even) .detail__art {
    grid-column: 1 / span 12;
    grid-row: auto;
    max-width: 280px;
    transform: none;
  }

  .detail__text,
  .detail:nth-child(even) .detail__text {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

.product-proof {
  background: var(--mist);
  padding: clamp(96px, 12vw, 170px) 0;
}

.product-proof__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: center;
}

.product-proof__text {
  grid-column: 1 / span 7;
}

.product-proof h2 {
  max-width: 13ch;
  margin-bottom: 38px;
}

.product-proof .actions {
  margin-top: 30px;
}

.product-proof__figure {
  grid-column: 9 / span 4;
  justify-self: center;
  max-width: 360px;
}

.product-proof__figure img {
  width: 100%;
  height: auto;
}

.product-proof__figure figcaption {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--slate);
}

@media (max-width: 900px) {
  .product-proof__text,
  .product-proof__figure {
    grid-column: 1 / -1;
  }

  .product-proof__figure {
    margin-top: 32px;
  }
}

.process {
  background: var(--tide);
  color: var(--on-tide);
  padding: clamp(96px, 12vw, 170px) 0;
}

.process h2 {
  max-width: 12ch;
  margin-bottom: clamp(48px, 7vw, 96px);
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding-top: 22px;
  border-top: 1px solid rgba(230, 239, 238, 0.22);
  color: var(--on-tide-2);
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 44px;
  font-size: clamp(3rem, 5vw, 4.6rem);
  font-weight: 300;
  font-variation-settings: "wdth" 80;
  line-height: 1;
  color: var(--cyan);
}

.steps h3 {
  font-size: 1.3rem;
  font-weight: 540;
  line-height: 1.25;
  color: var(--on-tide);
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr 1fr;
    row-gap: 48px;
  }
}

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

  .steps li::before {
    margin-bottom: 18px;
  }
}

.faq {
  padding: clamp(96px, 12vw, 170px) 0;
}

.faq__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.faq h2 {
  grid-column: 1 / span 4;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.faq__list {
  grid-column: 6 / span 7;
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  font-size: 1.2rem;
  font-weight: 520;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 6px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  transition: transform 0.35s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding: 0 0 28px;
  max-width: 60ch;
  color: var(--slate);
}

@media (max-width: 900px) {
  .faq h2,
  .faq__list {
    grid-column: 1 / -1;
    position: static;
  }
}

/* ---------- Forms ---------- */

.form-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding-block: clamp(56px, 7vw, 110px) clamp(96px, 12vw, 160px);
}

.form-layout__aside {
  grid-column: 1 / span 4;
  color: var(--slate);
}

.form-layout__aside img {
  width: min(220px, 60%);
  height: auto;
  margin: -12px 0 12px -12px;
}

@media (max-width: 900px) {
  .form-layout__aside img {
    display: none;
  }
}

.form-layout__aside h2 {
  font-size: 1.35rem;
  font-weight: 560;
  color: var(--ink);
  margin-bottom: 14px;
}

.form-layout__aside p + p {
  margin-top: 1em;
}

.form-layout form {
  grid-column: 6 / span 7;
}

@media (max-width: 900px) {
  .form-layout__aside,
  .form-layout form {
    grid-column: 1 / -1;
  }
}

.form-intro {
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 26px;
}

.field__label {
  font-size: 0.95rem;
  font-weight: 560;
  padding: 0;
}

.field__label span {
  font-weight: 400;
  color: var(--slate);
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 36, 42, 0.28);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field__input:hover {
  border-color: rgba(20, 36, 42, 0.5);
}

.field__input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(34, 98, 118, 0.2);
}

textarea.field__input {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

select.field__input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.choices {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
}

.choices legend {
  margin-bottom: 12px;
}

.choices__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.choice span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(20, 36, 42, 0.28);
  border-radius: 4px;
  background: #fff;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.choice span::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transition: background 0.2s;
}

.choice input:checked + span {
  background: var(--tide);
  border-color: var(--tide);
  color: var(--paper);
}

.choice input:checked + span::before {
  background: var(--cyan);
  border-color: var(--cyan);
}

.choice input:focus-visible + span {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.form-notice {
  font-size: 0.875rem;
  color: var(--slate);
  margin: 4px 0 18px;
  max-width: 60ch;
}

.turnstile-widget {
  min-height: 65px;
  margin-bottom: 20px;
}

.form-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 0.95rem;
}

.form-message:focus {
  outline: none;
}

.form-message--success {
  background: #e3f1ec;
  color: #164634;
}

.form-message--error {
  background: #f7e6e3;
  color: #7a2519;
}

/* Signup form on the dark chapter */
.signup .field__input {
  background: var(--tide-2);
  border-color: rgba(230, 239, 238, 0.3);
  color: var(--on-tide);
}

.signup .field__input::placeholder {
  color: rgba(169, 190, 192, 0.7);
}

.signup .field__input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(150, 231, 239, 0.2);
}

.signup__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.signup__row .field {
  margin-bottom: 0;
}

.signup .form-notice {
  color: var(--on-tide-2);
  margin-top: 16px;
}

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

/* ---------- Long-form text (privacy) ---------- */

.doc {
  padding-block: clamp(48px, 6vw, 90px) clamp(96px, 12vw, 160px);
}

.doc {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.doc__index {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  padding-top: 2.4em;
  font-size: 0.9rem;
}

.doc__index ol {
  list-style: none;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.doc__index a {
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--slate);
  text-decoration: none;
}

.doc__index a[aria-current="true"] {
  margin-left: -1px;
  border-left: 2px solid var(--teal);
  padding-left: 15px;
  color: var(--ink);
}

.doc__index a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.doc__body {
  grid-column: 5 / span 8;
  max-width: 68ch;
}

.doc__body h2 {
  font-size: 1.6rem;
  font-weight: 520;
  font-variation-settings: "wdth" 108;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.4em 0 0.7em;
}

.doc__body h3 {
  font-size: 1.15rem;
  font-weight: 580;
  margin: 1.8em 0 0.5em;
}

.doc__body p,
.doc__body ul {
  margin-bottom: 1em;
}

.doc__body ul {
  padding-left: 1.2em;
}

.doc__body li + li {
  margin-top: 0.4em;
}

.doc__body a {
  text-underline-offset: 0.2em;
}

@media (max-width: 900px) {
  .doc__index {
    display: none;
  }

  .doc__body {
    grid-column: 1 / -1;
  }
}

/* ---------- 404 ---------- */

.lost-page .nav {
  background: var(--mist);
}

.lost {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  background: var(--mist);
  overflow: hidden;
}

.lost__art {
  position: absolute;
  top: calc(var(--nav-h) + 4vh);
  right: var(--gutter);
  width: 52%;
  height: max(140px, calc(100svh - var(--nav-h) - 4vh - clamp(300px, 21vw + 170px, 470px)));
  object-fit: contain;
  object-position: right top;
}

.lost__text {
  position: relative;
  padding-block: 0 9vh;
}

.lost__text .lede {
  color: var(--ink);
}

@media (max-width: 820px) {
  .lost__art {
    right: 0;
    width: 100%;
    height: 40%;
    padding-inline: var(--gutter);
    object-position: center top;
  }
}

.lost h1 {
  font-size: clamp(3rem, 9vw, 9rem);
  margin-bottom: 20px;
}

.lost p {
  margin-bottom: 26px;
}

/* ---------- Motion preferences ---------- */

/* Section statements settle from the hero's wide cut to their resting width: the change starts
   once the heading is fully on screen and finishes as it reaches the middle. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .settle {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 100% cover 50%;
    }
  }
}

@keyframes settle {
  from {
    font-variation-settings: "wdth" 125;
    letter-spacing: 0.035em;
    font-weight: 300;
  }
}

/* Page to page: the navigation stays put while the next page wipes up over the last. */
@view-transition {
  navigation: auto;
}

.nav {
  view-transition-name: site-nav;
}

::view-transition {
  background: var(--mist);
}

::view-transition-old(root) {
  animation: vt-leave 0.6s var(--ease) both;
}

::view-transition-new(root) {
  animation: vt-enter 0.7s var(--ease) both;
}

@keyframes vt-leave {
  to {
    transform: translateY(-6vh);
    filter: brightness(0.82);
  }
}

@keyframes vt-enter {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

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

  @view-transition {
    navigation: none;
  }
}

/* Static film until site.js takes over (reduced motion, no JavaScript, or a failed load). */
.film:not(.is-ready) {
  height: auto;
}

.film:not(.is-ready) .film__stage {
  position: relative;
  height: auto;
  overflow: visible;
}

.film:not(.is-ready) .film__poster {
  opacity: var(--rest);
}

.film:not(.is-ready) .film__canvas {
  display: none;
}

.film:not(.is-ready) .hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.film:not(.is-ready) .film__thesis {
  position: relative;
  opacity: 1;
  transform: none;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.035em;
  padding: 14vh var(--gutter) 8vh;
}

/* Without JavaScript the mobile menu cannot open, so show the links inline. */
@media (max-width: 820px) {
  html:not(.js) .nav__toggle {
    display: none;
  }

  html:not(.js) .nav {
    position: absolute;
  }

  html:not(.js) .nav__links {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 14px;
    white-space: nowrap;
    padding: 0;
    background: none;
    box-shadow: none;
    font-size: 0.9rem;
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  html:not(.js) .nav__links a:not(.button) {
    padding: 0;
    border: 0;
  }

  html:not(.js) .nav__links .button {
    display: none;
  }
}
