@font-face {
  font-family: "IBM Plex Sans";
  src: url("./assets/fonts/IBMPlexSans-Regular.woff2") format("woff2"),
       url("./assets/fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: optional;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("./assets/fonts/IBMPlexSans-Medium.woff2") format("woff2"),
       url("./assets/fonts/IBMPlexSans-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: optional;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("./assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"),
       url("./assets/fonts/IBMPlexSans-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: optional;
}

:root {
  color-scheme: dark;
  --black: #000;
  --ink: #0b0d0f;
  --paper: #f0efeb;
  --muted: #93969b;
  --cyan: #7ac0c5;
  --magenta: #c783a5;
  --gold: #c9aa6d;
  --page-pad: clamp(1.25rem, 4vw, 4rem);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  scroll-behavior: smooth;
  scrollbar-color: #303338 var(--black);
}

body {
  margin: 0;
  min-width: 20rem;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(122, 192, 197, 0.04), transparent 28rem),
    var(--black);
}

a {
  color: inherit;
}

.masthead {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(1.1rem, env(safe-area-inset-top)) var(--page-pad) 1rem;
  color: rgba(240, 239, 235, 0.76);
  mix-blend-mode: difference;
  pointer-events: none;
}

.brand,
.masthead-actions {
  pointer-events: auto;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.brand-mark {
  width: 1.6rem;
  height: 1.6rem;
  overflow: visible;
}

.github-link {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  color: inherit;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.github-link svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.github-link:hover {
  color: var(--paper);
  background: rgba(240, 239, 235, 0.1);
  transform: translateY(-1px);
}

.github-link:active {
  transform: translateY(0);
}

.hero,
.closing {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 8rem var(--page-pad) 5rem;
}

.hero-copy {
  display: grid;
  gap: clamp(1.35rem, 2.5vw, 2.25rem);
}

.hero h1,
.closing h2 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(3rem, 8.4vw, 8.2rem);
  font-weight: 500;
  line-height: 0.91;
  letter-spacing: -0.068em;
  text-wrap: balance;
}

.hero-subline {
  max-width: 47rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  text-wrap: balance;
}

.scroll-cue {
  position: absolute;
  left: var(--page-pad);
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.scroll-cue svg,
.download svg {
  width: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-cue svg {
  animation: nudge 1.8s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(-0.1rem); }
  50% { transform: translateY(0.25rem); }
}

.fold-scroll {
  position: relative;
  height: 380svh;
  background: var(--black);
}

.fold-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

#fold-canvas,
.fallback-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#fold-canvas {
  display: block;
  touch-action: pan-y;
}

.fallback-poster {
  display: none;
  object-fit: contain;
  padding: 12vw;
  opacity: 0;
  transform-origin: 50% 85%;
}

.no-gpu #fold-canvas {
  display: none;
}

.no-gpu .fallback-poster {
  display: block;
  opacity: 1;
}

.no-gpu .fold-scroll {
  height: 100svh;
}

.no-preview .fold-scroll {
  height: auto;
}

.no-preview .fold-stage {
  height: 0;
}

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

.closing {
  min-height: 112svh;
  background:
    radial-gradient(circle at 86% 24%, rgba(199, 131, 165, 0.08), transparent 34rem),
    radial-gradient(circle at 12% 84%, rgba(201, 170, 109, 0.07), transparent 30rem),
    var(--black);
}

.closing-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.closing h2 {
  max-width: 12ch;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.85rem 1.35rem 0.9rem 1.55rem;
  border: 1px solid rgba(240, 239, 235, 0.16);
  border-radius: 999px;
  background: var(--paper);
  color: var(--black);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.download:hover {
  transform: translateY(-2px);
  background: white;
  box-shadow: 0 1rem 3rem rgba(122, 192, 197, 0.14);
}

.download:active {
  transform: translateY(0);
}

.download:focus-visible,
.brand:focus-visible,
.github-link:focus-visible,
.scroll-cue:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}

footer {
  position: absolute;
  left: var(--page-pad);
  right: var(--page-pad);
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: #686c71;
  font-size: 0.75rem;
}

footer p {
  margin: 0;
}

footer a {
  color: inherit;
  text-underline-offset: 0.2em;
}

footer nav {
  display: flex;
  gap: 1rem;
}

.legal-page {
  min-height: 100svh;
  background:
    radial-gradient(circle at 85% 10%, rgba(199, 131, 165, 0.08), transparent 32rem),
    radial-gradient(circle at 8% 78%, rgba(122, 192, 197, 0.07), transparent 30rem),
    var(--black);
}

.legal-page .masthead {
  mix-blend-mode: normal;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
}

.legal-shell {
  width: min(calc(100% - 2 * var(--page-pad)), 50rem);
  margin: 0 auto;
  padding: clamp(8rem, 15vw, 11rem) 0 5rem;
}

.legal-shell h1 {
  max-width: 10ch;
  margin: 0 0 1.5rem;
  font-size: clamp(4rem, 10vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.legal-updated {
  margin: 0 0 clamp(4rem, 9vw, 7rem);
  color: var(--muted);
  font-size: 0.85rem;
}

.legal-section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 1px solid rgba(240, 239, 235, 0.13);
}

.legal-section h2 {
  margin: 0 0 1.5rem;
  color: var(--paper);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.legal-section p,
.legal-section li {
  color: #b7b8ba;
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.72;
}

.legal-section p {
  margin: 0 0 1rem;
}

.legal-section ul {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
}

.legal-section li + li {
  margin-top: 0.75rem;
}

.legal-section a {
  color: var(--paper);
  text-underline-offset: 0.2em;
}

.legal-footer {
  position: static;
  width: min(calc(100% - 2 * var(--page-pad)), 50rem);
  margin: 0 auto;
  padding: 2rem 0 max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(240, 239, 235, 0.13);
}

@media (max-width: 700px) {
  .hero,
  .closing {
    align-items: end;
    padding-bottom: 20svh;
  }

  .hero h1,
  .closing h2 {
    font-size: clamp(2.8rem, 14vw, 5.2rem);
    line-height: 0.94;
    letter-spacing: -0.058em;
  }

  .fold-scroll {
    height: 330svh;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-cue svg {
    animation: none;
  }

  .download {
    transition: none;
  }
}
