/* Reset, typography, shared components (nav, buttons, keycaps, window frame, footer) */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  background: var(--bg-window);
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: var(--credit-height);
  background: var(--bg-window);
  color: var(--label);
  font-family: var(--font-system);
  font-size: var(--text-body);
  line-height: 1.47;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

[hidden] {
  display: none !important;
}

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

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

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus {
  top: 8px;
}

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}
.container--wide {
  width: min(100% - var(--gutter) * 2, var(--container-wide));
}

/* ------------------------------------------------------------------ */
/* Type                                                                 */
/* ------------------------------------------------------------------ */
.eyebrow {
  display: inline-block;
  font-size: var(--text-callout);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-text);
}

.h1,
.h2 {
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h1 {
  font-size: var(--text-h1);
}
.h2 {
  font-size: var(--text-h2);
  letter-spacing: -0.03em;
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.38;
  letter-spacing: -0.018em;
  color: var(--label-secondary);
  text-wrap: pretty;
}

.muted {
  color: var(--label-secondary);
}

.grad {
  background: linear-gradient(100deg, var(--grad-a), var(--grad-b) 55%, var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section {
  position: relative;
  padding-block: clamp(72px, 11vw, 160px);
}
.section__head {
  display: grid;
  gap: 16px;
  max-width: 820px;
  margin-bottom: clamp(36px, 6vw, 72px);
}
.section__head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}
.section--tint {
  background: var(--bg-secondary);
}

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), box-shadow var(--dur-base);
}
.btn:active {
  transform: scale(0.97);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 38%, transparent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 46%, transparent);
}
.btn--ghost {
  background: var(--fill-tertiary);
  color: var(--label);
}
.btn--ghost:hover {
  background: var(--fill-secondary);
}
.btn--sm {
  min-height: 32px;
  padding: 0 16px;
  font-size: 0.875rem;
}
.btn--lg {
  min-height: 54px;
  padding: 0 32px;
  font-size: 1.125rem;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-arrow {
  font-weight: 600;
  color: var(--accent-text);
}
.link-arrow::after {
  content: ' ›';
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-out);
}
.link-arrow:hover::after {
  transform: translateX(3px);
}

/* ------------------------------------------------------------------ */
/* Nav (vibrancy bar)                                                   */
/* ------------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color var(--dur-base);
}
.nav[data-scrolled='true'] {
  border-bottom-color: var(--separator);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--label);
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}
.nav__brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.nav__links {
  display: none;
  gap: 4px;
  margin-right: auto;
}
.nav__links a {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  color: var(--label-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav__links a:hover,
.nav__links a[aria-current='true'] {
  color: var(--label);
  background: var(--fill-quaternary);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--label-secondary);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover {
  background: var(--fill-tertiary);
  color: var(--label);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .i-sun {
  display: none;
}
:root:not([data-theme='dark']) .theme-toggle .i-sun {
  display: block;
}
:root:not([data-theme='dark']) .theme-toggle .i-moon {
  display: none;
}
.nav__menu-btn {
  display: inline-grid;
}
.nav__sheet {
  position: fixed;
  inset: var(--nav-height) 0 auto 0;
  z-index: 99;
  display: grid;
  gap: 2px;
  padding: 8px var(--gutter) 20px;
  background: var(--bg-bar);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  border-bottom: 0.5px solid var(--separator);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
    visibility 0s var(--dur-base);
}
.nav__sheet[data-open='true'] {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.nav__sheet a {
  padding: 14px 4px;
  border-bottom: 0.5px solid var(--separator);
  color: var(--label);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
@media (min-width: 860px) {
  .nav__links {
    display: flex;
  }
  .nav__brand {
    margin-right: 0;
  }
  .nav__menu-btn,
  .nav__sheet {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Keycaps                                                              */
/* ------------------------------------------------------------------ */
.keycap {
  --kc-h: 40px;
  display: inline-grid;
  place-items: center;
  min-width: var(--kc-h);
  height: var(--kc-h);
  padding: 0 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--keycap-top), var(--keycap-bottom));
  color: var(--keycap-text);
  font-family: var(--font-system);
  font-size: calc(var(--kc-h) * 0.42);
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 0 1px var(--keycap-edge), 0 4px 0 1px var(--keycap-edge), 0 8px 16px rgba(60, 56, 54, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  user-select: none;
}
:root[data-theme='dark'] .keycap {
  box-shadow: 0 1px 0 1px var(--keycap-edge), 0 4px 0 1px var(--keycap-edge), 0 8px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.keycap-group {
  display: inline-flex;
  gap: 6px;
}

kbd.k {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.12em 0.45em 0.16em;
  border-radius: 6px;
  background: var(--fill-tertiary);
  box-shadow: inset 0 -1px 0 var(--separator), 0 0 0 0.5px var(--separator);
  font-family: var(--font-system);
  font-size: 0.82em;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  color: var(--label);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Mac window frame + media                                             */
/* ------------------------------------------------------------------ */
.mac {
  position: relative;
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}
.mac::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0.5px var(--separator);
  pointer-events: none;
  z-index: 3;
}
.mac__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.hero__window .media > video {
  will-change: opacity;
}
.hero__window .mac__bar {
  /* Sits on the flat window background, never on the video: the blur adds nothing but cost. */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.mac__lights {
  display: flex;
  gap: 8px;
}
.mac__lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.mac__lights i:nth-child(1) {
  background: var(--tl-red);
}
.mac__lights i:nth-child(2) {
  background: var(--tl-yellow);
}
.mac__lights i:nth-child(3) {
  background: var(--tl-green);
}
.mac__title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label-secondary);
  pointer-events: none;
}

.media {
  position: relative;
  aspect-ratio: var(--ar, 16 / 10);
  background: var(--bg-tertiary);
  overflow: hidden;
}
.media > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.media > video {
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.media > video[data-live='true'] {
  opacity: 1;
}
.media[data-fit='contain'] > img,
.media[data-fit='contain'] > video {
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Scroll reveal                                                        */
/* ------------------------------------------------------------------ */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-spring);
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform;
}
.js [data-reveal='scale'] {
  transform: scale(0.94) translate3d(0, 24px, 0);
}
.js [data-reveal].in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ------------------------------------------------------------------ */
/* Footer + credit strip                                                */
/* ------------------------------------------------------------------ */
.footer {
  border-top: 0.5px solid var(--separator);
  background: var(--bg-secondary);
  padding-block: 48px 36px;
  font-size: var(--text-footnote);
  color: var(--label-secondary);
}
.footer__grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.footer__brand {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  max-width: 340px;
}
.footer__brand .nav__brand {
  margin: 0;
}
.footer h3 {
  margin-bottom: 10px;
  font-size: var(--text-footnote);
  font-weight: 600;
  color: var(--label);
}
.footer li + li {
  margin-top: 8px;
}
.footer a {
  color: var(--label-secondary);
}
.footer a:hover {
  color: var(--accent-text);
}
.footer__fine {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 0.5px solid var(--separator);
  color: var(--label-tertiary);
}
@media (min-width: 760px) {
  .footer__grid {
    grid-template-columns: 1.6fr repeat(3, 1fr);
  }
  .footer__brand {
    grid-column: auto;
  }
}

.credit {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--credit-height);
  padding: 0 var(--gutter);
  background: var(--bg-bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.credit a {
  display: inline-flex;
  align-items: center;
  color: var(--label);
  font-weight: 600;
  transition: color var(--dur-fast);
}
.credit a:hover {
  color: var(--system-blue);
}
.credit__sep {
  color: var(--separator);
  user-select: none;
}
.credit svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ */
/* Reduced motion: no transforms, no loops, instant state changes       */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* While the hero (and its playing video) is on screen, the fixed nav and credit strip drop
   backdrop-filter, which would otherwise re-blur the video on every decoded frame. They use a
   near-opaque fill of the same tint instead, and the frosted blur returns below the hero. */
:root[data-hero='on'] .nav,
:root[data-hero='on'] .credit {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: color-mix(in srgb, var(--bg-bar) 80%, var(--bg-window));
}
@media (prefers-reduced-transparency: reduce) {
  .nav,
  .credit,
  .hero__pill {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in srgb, var(--bg-bar) 30%, var(--bg-window));
  }
}
