
/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--bar);
  background: color-mix(in srgb, var(--drop-light, #0c070b) 16%, rgba(12, 7, 11, 0.5));
  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 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.bar__mark { width: 30px; height: auto; }
.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-follow: 520ms;
}
.hero__copy,
.hero__stage { position: relative; }
.hero__copy {
  max-width: 1000px;
  margin-inline: auto;
  text-align: center;
}
.motion .hero__copy,
.motion .get {
  transform: translateY(calc(var(--hero-progress) * -60px));
  opacity: calc(1 - var(--hero-progress) * 0.85);
}
.hero__title {
  margin: 0 auto;
  max-width: 11.5em;
  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(--peach);
}
/* "beautiful": jelly 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,
    var(--jelly-flow) 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: #fff0f0;
  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, 140, 150, 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 auto 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;
  justify-content: var(--actions-align, center);
  align-items: center;
  gap: 14px 20px;
  margin-top: 32px;
}
.hero__requirement {
  font-size: 0.86rem;
  color: var(--text-3);
}
/* Get: the Mac download, the server install command and the store links in one row */
.get {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}
.get__command {
  gap: 10px;
  padding: 3px 3px 3px 14px;
  border-radius: 999px;
  min-width: 0;
}
.get__command .command__copy { padding: 0.45em; }
.get__command code {
  padding-block: 0;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.get__label {
  flex: none;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 600;
}
/* The running horse: a 14-frame run cycle looping on its track, carried from left to right by the scroll (runner.js sets --run) */
.runner {
  container-type: inline-size;
  height: calc(var(--horse) * 180 / 265);
  margin-bottom: clamp(18px, 2.4vw, 30px);
}
.runner__horse {
  position: relative;
  display: block;
  width: var(--horse);
  height: 100%;
  translate: calc(var(--run, 0) * (100cqw - 100%)) 0;
  background: url("brand/horse-run.webp") 0 0 / auto 100% repeat-x;
  filter: drop-shadow(0 10px 18px rgba(224, 48, 79, 0.45));
}
.runner__horse::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 10%;
  bottom: -6px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 90, 110, 0.45), transparent);
}
.motion .runner__horse { animation: run var(--stride) steps(14) infinite; }
@keyframes run {
  to { background-position-x: calc(var(--horse) * -14); }
}
.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: var(--window-edge), 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: #0a0509;
  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(12, 7, 11, 0), rgba(12, 7, 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;
}

/* Hero: the lede, then each item of the get row, rise in after the title the same way */
.motion .hero :is(.hero__lede, .get > *) { opacity: 0; }
.motion .hero:has(.hero__title.is-said) :is(.hero__lede, .get > *) {
  animation: hero-follow 1100ms var(--ease) calc(var(--hero-follow) + var(--i, 0) * 90ms) both;
}
.get > :nth-child(1) { --i: 1; }
.get > :nth-child(2) { --i: 2; }
.get > :nth-child(3) { --i: 3; }
.get > :nth-child(4) { --i: 4; }
@keyframes hero-follow {
  from { opacity: 0; translate: 0 0.6em; filter: blur(8px); }
  to { opacity: 1; translate: 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; }
  .get { gap: 8px; }
  .get__command { order: 1; width: 100%; }
  .get__command code { mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .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;
  }
}
