:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #14151a;
  --surface-raised: #1c1e24;
  --text: #f1f2f5;
  --soft: #c7c9d0;
  --muted: #9b9ea8;
  --line: rgb(255 255 255 / 0.1);
  --blue: #2f6bf0;
  --blue-hover: #4a80f5;
  --link: #7ea3f7;
  --on-blue: #fff;
  --radius-control: 12px;
  --radius-inner: 16px;
  --radius-tile: 24px;
  --gutter: clamp(20px, 4.5vw, 56px);
  --section: clamp(96px, 13vw, 176px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 1px 2px rgb(4 6 12 / 0.3), 0 12px 32px rgb(4 6 12 / 0.34), 0 40px 80px rgb(4 6 12 / 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { overflow-x: clip; background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure, p { margin: 0; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(3.1rem, 9.4vw, 7.5rem); line-height: 0.98; letter-spacing: -0.045em; }
h2 { font-size: clamp(2.2rem, 5.4vw, 4.25rem); line-height: 1.02; letter-spacing: -0.04em; }
h3 { font-size: clamp(1.4rem, 2.3vw, 1.75rem); line-height: 1.12; letter-spacing: -0.024em; }

/* Controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-control);
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.button:hover { background: var(--blue-hover); color: var(--on-blue); }
.button:active { transform: scale(0.98); }

.button-quiet { background: rgb(255 255 255 / 0.1); color: var(--text); }
.button-quiet:hover { background: rgb(255 255 255 / 0.16); color: var(--text); }
.button-small { min-height: 36px; padding: 0 16px; font-size: 0.88rem; }
.button-large { min-height: 56px; padding: 0 32px; font-size: 1.12rem; }

.fine { color: var(--muted); font-size: 0.88rem; }

/* Light from the Mac desktop, behind each stage */

.ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
  mask-image: radial-gradient(closest-side, #000 30%, transparent);
  pointer-events: none;
}

/* Header and footer */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-inline: var(--gutter);
  background: rgb(11 12 15 / 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
}

.bar nav { display: flex; align-items: center; gap: 24px; font-size: 0.88rem; }
.bar nav a:not(.button), .foot nav a { color: var(--muted); text-decoration: none; }
.bar nav a:not(.button):hover, .foot nav a:hover { color: var(--text); }

.foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  color: var(--muted);
  font-size: 0.82rem;
}
.foot nav { display: flex; gap: 24px; }
.foot .legal { grid-column: 1 / -1; }

/* Hero */

section { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }

.hero { overflow-x: clip; padding-top: clamp(48px, 8vw, 104px); text-align: center; }
.lead { max-width: 33em; margin: 24px auto 0; color: var(--soft); font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.42; letter-spacing: -0.012em; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.hero .fine { margin-top: 16px; }

.hero-device {
  position: relative;
  max-width: 720px;
  margin: clamp(48px, 7vw, 88px) auto 0;
}
.hero-device .ambient {
  inset: -6% -30% auto;
  width: 160%;
  height: 72%;
  opacity: 0.5;
}
.hero-device .device { position: relative; z-index: 1; width: 100%; }

/* Tabbed sections */

[role="tab"] {
  display: block;
  width: 100%;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mode-name { display: block; color: var(--muted); font-size: clamp(1.2rem, 1.9vw, 1.45rem); font-weight: 600; letter-spacing: -0.02em; transition: color 160ms var(--ease); }
[role="tab"]:hover .mode-name, [aria-selected="true"] .mode-name { color: var(--text); }
.mode-text { display: none; max-width: 28em; margin-top: 8px; color: var(--soft); }
.js [aria-selected="true"] .mode-text { display: block; }
html:not(.js) .mode-text { display: block; }

[role="tabpanel"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 40px);
  padding: clamp(20px, 4vw, 48px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease), visibility 280ms;
}
[role="tabpanel"].on { opacity: 1; visibility: visible; transform: none; }

/* Screens */

.modes { margin-top: var(--section); }
.modes-grid, .setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  margin-top: clamp(40px, 5vw, 64px);
}
.modes-stage, .setup-stage {
  position: relative;
  overflow: hidden;
  height: clamp(480px, 72vh, 720px);
  border-radius: var(--radius-tile);
  background: var(--surface);
}
.modes-stage > .ambient, .setup-stage > .ambient { opacity: 0.6; }
.modes-stage [role="tabpanel"] img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 24px 48px rgb(4 6 12 / 0.5));
}

/* Details */

.details {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-top: var(--section);
}
.tile {
  overflow: hidden;
  padding: clamp(24px, 3.2vw, 40px);
  border-radius: var(--radius-tile);
  background: var(--surface);
}
.tile p { max-width: 34em; margin-top: 12px; color: var(--soft); }
.tile-keyboard { grid-column: span 4; padding-bottom: 0; }
.tile-trackpad { display: flex; flex-direction: column; grid-column: span 2; padding-bottom: 0; }
.tile-fit { grid-column: span 2; }
.tile-private { grid-column: span 4; }
.tile-private svg { display: block; margin-bottom: 16px; color: var(--muted); }

.tile-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.tile-head > div:first-child { flex: 1 1 320px; }
.tile-keyboard img { width: calc(100% + clamp(48px, 6.4vw, 80px)); max-width: none; margin: 32px calc(clamp(24px, 3.2vw, 40px) * -1) 0; }
.tile-trackpad img { flex: none; width: 100%; margin-top: auto; padding-top: 32px; }

.caps { display: flex; gap: 8px; align-self: flex-start; }
.cap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 72px;
  height: 64px;
  padding: 8px;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 2px 0 rgb(0 0 0 / 0.5);
  color: var(--soft);
  font-size: 0.72rem;
  transition: transform 90ms var(--ease), background 90ms var(--ease), box-shadow 90ms var(--ease);
}
.cap i { font-size: 1rem; font-style: normal; line-height: 1; }
.cap-wide { width: 88px; }
.cap.down { background: var(--blue); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2); color: var(--on-blue); transform: translateY(2px); }

/* Setup */

.setup { margin-top: var(--section); scroll-margin-top: 88px; }
.section-lead { max-width: 34em; margin-top: 16px; color: var(--soft); font-size: clamp(1.05rem, 1.5vw, 1.2rem); }

[role="tab"]:has(.step-number) { display: flex; gap: 16px; }
.step-number {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
[aria-selected="true"] .step-number { background: var(--blue); color: var(--on-blue); }

.setup-stage .window {
  width: auto;
  height: min(100%, 560px);
  min-width: 0;
  border-radius: var(--radius-inner);
  box-shadow: var(--shadow), 0 0 0 1px rgb(255 255 255 / 0.1);
}
.setup-stage .phone { width: auto; height: min(100%, 560px); min-width: 0; filter: drop-shadow(0 24px 48px rgb(4 6 12 / 0.5)); }
.setup-note { max-width: 40em; margin-top: 32px; color: var(--muted); }

/* Download */

.get {
  position: relative;
  overflow: hidden;
  margin-top: var(--section);
  max-width: calc(1280px - var(--gutter) * 2);
  padding: clamp(56px, 8vw, 104px) clamp(24px, 6vw, 80px);
  border-radius: var(--radius-tile);
  background: var(--surface);
}
.get > .ambient { inset: -40% -30% -40% 30%; width: 100%; height: 180%; opacity: 0.5; }
.get-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
.get h2 { margin-bottom: 32px; }
.get .fine { margin-top: 12px; color: var(--soft); }
.get .fine:first-of-type { margin-top: 16px; }

.specs { width: 100%; max-width: 760px; margin: 48px 0 0; }
.specs > div {
  display: grid;
  grid-template-columns: minmax(0, 11em) minmax(0, 1fr);
  gap: 16px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}
.specs dt { font-weight: 600; }
.specs dd { margin: 0; color: var(--soft); }
.specs code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }

/* Privacy and Support */

.doc { max-width: 720px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 0; }
.doc h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.02; }
.doc .date { margin-top: 16px; color: var(--muted); font-size: 0.88rem; }
.doc .intro { margin-top: 24px; color: var(--soft); font-size: 1.16rem; line-height: 1.42; }
.doc h2 { margin-top: 56px; font-size: 1.4rem; line-height: 1.2; letter-spacing: -0.02em; }
.doc h3 { margin-top: 32px; font-size: 1.06rem; letter-spacing: -0.01em; }
.doc p, .doc ul, .doc ol { color: var(--soft); }
.doc h2 + p, .doc h2 + ul, .doc h2 + ol, .doc h3 + p { margin-top: 8px; }
.doc p + p, .doc ul + p, .doc ol + p, .doc p + ul { margin-top: 16px; }
.doc ul, .doc ol { margin-bottom: 0; padding-left: 1.25em; }
.doc li + li { margin-top: 8px; }
.doc strong { color: var(--text); font-weight: 600; }

/* One entrance, tied to scroll, where the browser supports it. */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .tile, .modes-stage, .setup-stage {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 36%;
    }
    @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
  }
}

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

@media (max-width: 880px) {
  .hide-small { display: none; }
  .modes-grid, .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .modes-stage, .setup-stage { order: -1; height: clamp(420px, 66vh, 620px); }
  .setup-stage .window, .setup-stage .phone { height: auto; max-height: 100%; }
  .setup-stage .window { width: 58%; }
  .setup-stage .phone { width: 34%; }
  [role="tabpanel"] { padding: 16px; }
  .details { grid-template-columns: minmax(0, 1fr); }
  .tile-keyboard, .tile-trackpad, .tile-fit, .tile-private { grid-column: auto; }
  .get { margin-inline: var(--gutter); max-width: none; }
  .specs > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
