@font-face {
  font-family: "Mona Sans";
  src: url("fonts/mona-sans-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --ground: #0b080b;
  --raised: #161116;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #fbf7f4;
  --text-2: rgba(251, 247, 244, 0.76);
  --text-3: rgba(251, 247, 244, 0.52);
  --glass: rgba(24, 18, 24, 0.56);
  --glass-solid: rgba(22, 16, 22, 0.86);
  --glass-blur: blur(26px) saturate(170%);
  --window-shadow: 0 40px 90px -36px rgba(0, 0, 0, 0.75);
  --window-radius: 18px;
  --depth: 1500px;
  --accent: #ff8a3d;
  --accent-soft: rgba(255, 138, 61, 0.32);

  --sans: "Mona Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --page: 1240px;
  --margin: clamp(20px, 4vw, 48px);
  --bar: 60px;
  --columns-gap: clamp(40px, 5vw, 88px);
  --chapter-space: clamp(88px, 10vw, 150px);
  --radius: 12px;
  --radius-small: 8px;
  --clip-gap: clamp(20px, 2.4vw, 32px);
  --feature-space: clamp(56px, 8vw, 120px);
  --phone: 300px;
  --devices-gap: clamp(16px, 2.4vw, 36px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --slide: 450ms;
  --reveal: 800ms;
}

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

html {
  background: var(--ground);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 24px);
  scrollbar-color: var(--line-strong) var(--ground);
  scrollbar-width: thin;
  caret-color: var(--accent);
  /* No rubber-band bounce at the ends, so the top bar stays at the top. */
  overscroll-behavior-y: none;
}

html,
body { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
}

::selection { background: var(--accent-soft); color: var(--text); }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

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

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

code {
  font-family: var(--mono);
  font-size: 0.84em;
  letter-spacing: -0.01em;
  color: var(--text);
}

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

.skip {
  position: absolute;
  left: var(--margin);
  top: -100px;
  z-index: 20;
  background: var(--text);
  color: var(--ground);
  padding: 10px 14px;
  border-radius: var(--radius-small);
}
.skip:focus { top: 10px; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.78em 1.2em;
  border-radius: var(--radius-small);
  background: var(--text);
  color: var(--ground);
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 200ms var(--ease);
}
.button:hover { background: #ffffff; }
.button--small { padding: 0.55em 0.9em; font-size: 0.85rem; }
.button--pending {
  background: transparent;
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: default;
}
.button--pending:hover { background: transparent; }

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--bar);
  background: rgba(11, 8, 11, 0.38);
  backdrop-filter: saturate(170%) blur(20px);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
}
.bar__inner {
  max-width: calc(var(--page) + 2 * var(--margin));
  height: 100%;
  margin: 0 auto;
  padding-inline: var(--margin);
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
}
.bar__name {
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.bar__nav { display: flex; gap: clamp(16px, 2.4vw, 28px); }
.bar__nav a {
  color: var(--text-2);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 200ms var(--ease);
}
.bar__nav a:hover { color: var(--text); }
.bar .button { margin-left: auto; }

/* The wallpaper canvas behind everything */
.field {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}
main,
.foot {
  position: relative;
  z-index: 1;
  max-width: calc(var(--page) + 2 * var(--margin));
  margin: 0 auto;
  padding-inline: var(--margin);
}


/* Hero */
.hero {
  position: relative;
  padding-top: clamp(48px, 6.5vw, 96px);
  --hero-progress: 0;
}
.hero__copy,
.hero__stage { position: relative; }
.hero__copy { max-width: 980px; }
.motion .hero__copy {
  transform: translateY(calc(var(--hero-progress) * -60px));
  opacity: calc(1 - var(--hero-progress) * 0.6);
}
.hero__title {
  margin: 0;
  max-width: 12em;
  font-size: clamp(2.8rem, 6.4vw, 6rem);
  font-weight: 790;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.hero__and {
  font-style: italic;
  padding-right: 0.06em;
  color: var(--accent);
}
/* "beautiful": the wallpaper's hero colours flowing through the letters, a sheen sweeping over once it lands, glints around it */
.hero__beautiful {
  position: relative;
  padding-right: 0.04em;
  background:
    linear-gradient(105deg, transparent 40%, rgba(255, 248, 236, 0.95) 50%, transparent 60%) 200% 0 / 250% 100% no-repeat,
    linear-gradient(100deg, #ffbf55, #ff6a2b, #e2386a, #a03cf0, #e2386a, #ff6a2b, #ffbf55) 0 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.motion .is-said .hero__beautiful {
  animation:
    beautiful-sheen 1.6s var(--ease) calc(var(--w) * 55ms + 900ms) both,
    beautiful-flow 9s ease-in-out calc(var(--w) * 55ms + 2500ms) infinite alternate;
}
.hero__beautiful::before,
.hero__beautiful::after {
  content: "";
  position: absolute;
  width: 0.2em;
  aspect-ratio: 1;
  background: #fff4e0;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 6px rgba(255, 191, 85, 0.9));
  opacity: 0;
  pointer-events: none;
}
.hero__beautiful::before { top: -0.12em; right: -0.1em; }
.hero__beautiful::after { bottom: 0.18em; left: 0.04em; width: 0.13em; }
.motion .is-said .hero__beautiful::before {
  animation: beautiful-glint 3.4s ease-in-out calc(var(--w) * 55ms + 1700ms) infinite;
}
.motion .is-said .hero__beautiful::after {
  animation: beautiful-glint 3.4s ease-in-out calc(var(--w) * 55ms + 3400ms) infinite;
}
@keyframes beautiful-sheen {
  from { background-position: 200% 0, 0 0; }
  to { background-position: -100% 0, 0 0; }
}
@keyframes beautiful-flow {
  from { background-position: -100% 0, 0 0; }
  to { background-position: -100% 0, 100% 0; }
}
@keyframes beautiful-glint {
  0%, 62%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
  72% { opacity: 1; transform: scale(1) rotate(45deg); }
  84% { opacity: 0; transform: scale(0.4) rotate(90deg); }
}
.hero__lede {
  margin: 0.9em 0 0;
  max-width: 34em;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.55;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 32px;
}
.hero__requirement {
  font-size: 0.86rem;
  color: var(--text-3);
}
.hero__stage {
  margin-top: clamp(48px, 6vw, 80px);
  perspective: var(--depth);
}
.hero__stage .demo__frame { transform-origin: 50% 0; }

/* Chapters: a heading, then one row per feature, text and clip alternating sides */
.chapters { margin: var(--chapter-space) auto 0; }

.chapter { padding-block: clamp(24px, 3vw, 40px) var(--chapter-space); }
.chapter__title {
  margin: 0;
  max-width: 18em;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  font-weight: 790;
  line-height: 1;
  letter-spacing: -0.05em;
}
.chapter__lede {
  margin: 0.7em 0 0;
  max-width: 34em;
  color: var(--text-2);
  font-size: 1.1rem;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  grid-template-areas: "copy clip";
  align-items: center;
  column-gap: var(--columns-gap);
  margin-top: var(--feature-space);
}
.feature--flip {
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  grid-template-areas: "clip copy";
}
.feature--phone { grid-template-columns: minmax(0, 1fr) var(--phone); }
.feature--phone.feature--flip { grid-template-columns: var(--phone) minmax(0, 1fr); }
.feature--phone .feature__copy { max-width: 24em; justify-self: center; }
.feature--devices { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.feature--wide.feature--flip { grid-template-columns: minmax(0, 9fr) minmax(0, 3fr); }
.feature__copy { grid-area: copy; }
.feature > .demo,
.feature > .scene,
.feature > .devices,
.feature > .device { grid-area: clip; }
.feature__copy h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.feature__copy p {
  margin: 0.6em 0 0;
  color: var(--text-2);
}
.feature__copy strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Clips */
.demo { margin: 0; }
.demo__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio);
  border-radius: var(--window-radius);
  background: var(--glass-solid);
  box-shadow: inset 0 0 0 1px var(--line), var(--window-shadow);
}
.demo__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 36%);
  opacity: var(--sheen, 0.35);
}
.demo__frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.demo__frame--pending {
  display: grid;
  place-items: center;
}
.demo__frame--pending::after {
  content: "Video coming soon";
  color: var(--text-3);
  font-size: 0.84rem;
}
.demo__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

/* Terminal */
.terminal {
  border-radius: var(--radius);
  background: #08090b;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.terminal__bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}
.terminal__bar p {
  margin: 0 0 0 auto;
  color: var(--text-3);
  font-size: 0.78rem;
}
.terminal__screen {
  padding: 18px 20px 22px;
  color: var(--text-2);
  font: 400 clamp(0.78rem, 1vw, 0.9rem)/1.75 var(--mono);
  overflow-wrap: break-word;
}
.terminal__line { margin: 0; white-space: pre-wrap; }
.terminal__line--command { color: var(--text); }
.terminal__line--command::before { content: "$ "; color: var(--text-3); }
.terminal__line--output { color: var(--text-3); margin-bottom: 0.6em; }
.terminal__caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: caret 1s steps(2, jump-none) infinite;
}
@keyframes caret {
  to { opacity: 0; }
}

/* Tiles: a heading cell and small looping scenes, each under its label */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 48px) clamp(20px, 2.4vw, 32px);
  padding-top: clamp(24px, 3vw, 40px);
}
.tiles__title {
  margin: 0;
  max-width: 9em;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 790;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.tile h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 620;
  letter-spacing: -0.015em;
}

/* Close */
.close {
  position: relative;
  margin-top: var(--chapter-space);
  padding-block: clamp(96px, 12vw, 180px);
}
.close__copy { position: relative; max-width: 760px; }
.close__title {
  margin: 0;
  font-size: clamp(2.6rem, 5.4vw, 5rem);
  font-weight: 790;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.close__lede {
  margin: 0.8em 0 0;
  max-width: 30em;
  color: var(--text-2);
  font-size: 1.06rem;
}

/* Footer: on a dark base so it reads over the wallpaper */
.foot::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: linear-gradient(rgba(11, 8, 11, 0), rgba(11, 8, 11, 0.9) 40%);
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.82rem;
}
.foot__inner p { margin: 0; }

/* Windows: the app's frosted glass in depth; their tilt and lift come from the scroll and pointer (depth.js) */
.feature,
.tiles,
.devices { perspective: var(--depth); }
.scene,
.device { will-change: transform; }
.feature > .scene {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.14), transparent 38%);
  opacity: var(--sheen, 0.35);
}

/* Headlines: hidden until split into words, then the words rise in one after another, sharpening from a blur */
.motion [data-words]:not(.is-split) { visibility: hidden; }
.motion [data-words] .word {
  display: inline-block;
  opacity: 0;
  translate: 0 0.5em;
  rotate: 2deg;
  filter: blur(8px);
  transition: opacity 900ms var(--ease), translate 1100ms var(--ease), rotate 1100ms var(--ease), filter 900ms var(--ease);
  transition-delay: calc(var(--w) * 55ms);
}
.motion [data-words].is-said .word {
  opacity: 1;
  translate: none;
  rotate: none;
  filter: none;
}

/* Scroll reveals: text rises in, windows swing up from tilted back (individual transform properties, so the depth tilt composes) */
.motion [data-reveal] {
  opacity: 0;
  translate: 0 24px;
  transition: opacity var(--reveal) var(--ease), translate var(--reveal) var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.motion .demo:not([data-eager]) .demo__frame,
.motion .feature > :is(.scene, .devices, .device) {
  opacity: 0;
  translate: 0 60px;
  rotate: x 16deg;
  scale: 0.94;
  transition: opacity var(--reveal) var(--ease), translate 1300ms var(--ease), rotate 1300ms var(--ease), scale 1300ms var(--ease);
}
.motion .feature .demo .demo__frame,
.motion .feature > :is(.scene, .devices, .device) { translate: 64px 40px; rotate: y -10deg; }
.motion .feature--flip .demo .demo__frame,
.motion .feature--flip > :is(.scene, .devices, .device) { translate: -64px 40px; rotate: y 10deg; }
.motion [data-reveal].is-in,
.motion .demo.is-in .demo__frame,
.motion .feature .demo.is-in .demo__frame,
.motion .feature > :is(.scene, .devices, .device).is-in {
  opacity: 1;
  translate: none;
  rotate: none;
  scale: none;
}

/* Narrow screens: one column, text above its clip */
@media (max-width: 900px) {
  .close { grid-template-columns: minmax(0, 1fr); }
  .feature,
  .feature--flip,
  .feature--phone,
  .feature--phone.feature--flip,
  .feature--devices,
  .feature--wide.feature--flip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "clip";
    row-gap: 20px;
  }
  .feature--phone > .device { width: min(100%, var(--phone)); justify-self: center; }
  .feature--phone .feature__copy { justify-self: start; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles__title { grid-column: 1 / -1; max-width: none; }
}

/* Phones and touch screens: no frosted blur under the windows, a denser fill instead */
@media (max-width: 700px), (pointer: coarse) {
  .feature > .scene {
    background: var(--glass-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .bar {
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
  }
}

/* Touch screens: words rise without a blur (iOS cuts it off at each word's box), clips rise straight up */
@media (pointer: coarse), (max-width: 900px) {
  .motion [data-words] .word { filter: none; }
  .motion .feature .demo .demo__frame,
  .motion .feature > :is(.scene, .devices, .device),
  .motion .feature--flip .demo .demo__frame,
  .motion .feature--flip > :is(.scene, .devices, .device) { translate: 0 40px; rotate: none; }
}

@media (max-width: 640px) {
  html { font-size: 16px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .bar__nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation: none !important;
  }
}
