/* PerformanceHUD — one stylesheet, no build step.
   Layout and type scale follow promaxdisplay.com. Light by default, whatever the system setting; the nav
   switch sets :root[data-theme="dark"], which swaps the palette below, the MacBook finish (silver / space
   black) and the HUD video. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-raised: #f5f5f7;
  --card: #f5f5f7;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: #1d1d1f;
  --body: #333336;
  --muted: #424245;
  --dim: #6e6e73;
  --tint: rgba(0, 0, 0, 0.04);
  --tint-strong: rgba(0, 0, 0, 0.06);
  --selection: rgba(0, 0, 0, 0.12);
  --underline: rgba(0, 0, 0, 0.3);
  --code-bg: rgba(0, 0, 0, 0.05);
  --btn-bg: #000;
  --btn-fg: #fff;
  --btn-hover: #333336;
  --btn-gray-bg: #e8e8ed;
  --btn-gray-hover: #dcdce1;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --nav-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --wrap: 980px;
  --wrap-wide: 1240px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #161617;
  --bg-raised: #1c1c1e;
  --card: #1c1c1e;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f5f7;
  --body: #d2d2d7;
  --muted: #a1a1a6;
  --dim: #86868b;
  --tint: rgba(255, 255, 255, 0.06);
  --tint-strong: rgba(255, 255, 255, 0.1);
  --selection: rgba(255, 255, 255, 0.2);
  --underline: rgba(255, 255, 255, 0.35);
  --code-bg: rgba(255, 255, 255, 0.08);
  --btn-bg: #fff;
  --btn-fg: #000;
  --btn-hover: #d2d2d7;
  --btn-gray-bg: #2c2c2e;
  --btn-gray-hover: #3a3a3c;
  --nav-bg: rgba(29, 29, 31, 0.72);
  --nav-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.47 var(--font); letter-spacing: -0.022em; -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 12px; }

.wrap { width: min(var(--wrap), 100% - 60px); margin-inline: auto; }
.center { text-align: center; }

/* Type */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(44px, 7.4vw, 80px); line-height: 1.05; letter-spacing: -0.015em; max-width: 900px; }
h2 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.07; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.eyebrow { font: 600 21px/1.2 var(--font-display); letter-spacing: 0.011em; color: var(--muted); margin: 0 0 6px; }
.lede { font: 400 clamp(18px, 1.9vw, 20.5px)/1.38 var(--font-display); letter-spacing: 0.011em; color: var(--muted); max-width: 40em; margin: 20px auto 0; }
.fine { font-size: 14px; color: var(--dim); max-width: 44em; margin: 40px auto 0; }
.fine a { color: var(--muted); }

/* Buttons: black (white in dark mode) */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; border-radius: 999px; font-size: 17px; line-height: 1.18; text-decoration: none; white-space: nowrap; transition: background .15s ease, border-color .15s ease; }
.btn-primary, .btn-secondary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover, .btn-secondary:hover { background: var(--btn-hover); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-small { padding: 8px 18px; font-size: 13px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.cta-stack { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 32px; }
.btn-large { padding: 16px 36px; font-size: 20px; }
.btn-gray { flex-direction: column; padding: 9px 22px; border-radius: 18px; font-size: 15px; line-height: 1.25; background: var(--btn-gray-bg); color: var(--muted); }
.btn-gray:hover { background: var(--btn-gray-hover); }
.btn-gray small { font-size: 12px; color: var(--dim); }

/* Navigation: a floating pill */
.nav { position: fixed; top: 16px; left: 0; right: 0; z-index: 20; padding-inline: 16px; pointer-events: none; }
.nav-inner { pointer-events: auto; max-width: 980px; height: 56px; margin-inline: auto; padding: 0 12px 0 18px; display: flex; align-items: center; justify-content: space-between;
  border-radius: 999px; background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--nav-shadow); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; text-decoration: none; }
.brand img { border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-size: 11px; font-weight: 400; color: var(--dim); letter-spacing: 0; }
.nav-actions { display: flex; align-items: center; gap: 22px; }
.nav-link { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--text); }
.nav-link:hover { color: var(--muted); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-right: -10px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; transition: background .15s; }
.theme-toggle:hover { background: var(--tint-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
/* Switching themes: everything changes in the same frame (no per-element fades), inside a short whole-page
   cross-fade where the browser supports view transitions. */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; animation-timing-function: ease; }

/* Hero */
.hero { padding: 156px 30px 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-sub { font: 400 clamp(19px, 2.2vw, 24.5px)/1.38 var(--font-display); letter-spacing: 0.011em; color: var(--muted); max-width: 720px; margin: 14px auto 0; }

/* MacBook showcase, following the reference site's pattern: a sticky stage whose gray card widens to the
   full window as the section scrolls in, then narrows again on the way out (the script in index.html sets
   --clip). The MacBook frame (14-inch MacBook Pro with PROLED XDR Display, from tools/make_macbook_frames.py)
   is an SVG drawn over the video; .device-screen matches its transparent opening (x 139-1460, y 132-999.55 in a
   -4 100 1608 996 viewBox). Silver by default; :root[data-theme="dark"] switches to space black. */
.showcase-pin { position: relative; height: 160vh; margin-top: 40px; --inset-x: max(30px, calc((100% - 1240px) / 2)); }
.showcase-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; --clip: inset(60px var(--inset-x) round 44px); }
.showcase-frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 81px 0 15px;
  background: var(--bg-alt); clip-path: var(--clip); will-change: clip-path; --dev-w: min(80.1vw, 1126px, (100vh - 300px) * 1.449); }
.device { position: relative; flex: none; width: var(--dev-w); aspect-ratio: 1608 / 996; margin: 0; }
.device-screen { position: absolute; left: 8.893%; top: 3.2129%; width: 82.1517%; height: 87.1034%; background: #000; box-shadow: 0 0 0 2px #000; }
.device-screen video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.device-screen video.is-shown { opacity: 1; }
.device-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.frame-space-black, :root[data-theme="dark"] .frame-silver { display: none; }
:root[data-theme="dark"] .frame-space-black { display: block; }
@media (min-width: 1100px) {
  .showcase-pin { --inset-x: max(220px, calc((100% - 1240px) / 2)); }
  .showcase-frame { --dev-w: min(80.1vw, 1126px, (100vh - 300px) * 1.449, 100vw - 480px); }
}
@media (max-width: 734px) {
  .showcase-pin { --inset-x: 16px; }
  .showcase-stage { --clip: inset(40px var(--inset-x) round 36px); }
}
/* Portrait, short landscape windows and Reduce Motion: a plain rounded card, no pinning. */
@media (orientation: portrait), (max-height: 500px), (prefers-reduced-motion: reduce) {
  .showcase-pin { height: auto; max-width: 1272px; margin: 40px auto 0; padding: 0 16px; }
  .showcase-stage { position: relative; height: auto; }
  .showcase-frame { position: relative; inset: auto; clip-path: none; will-change: auto; border-radius: 20px; padding: 34px 18px 38px; }
  .device { width: 100%; max-width: 840px; }
}
@media (min-width: 1100px) and (orientation: portrait), (min-width: 1100px) and (prefers-reduced-motion: reduce) {
  .showcase-pin { max-width: none; padding-inline: 220px; }
}

/* Layouts band, directly below the showcase: a closer look at the top of the same MacBook (the lid cut off by the
   card's bottom edge). The card matches the showcase card at rest: same side insets and corner radius. The frame is
   macbook-pro-14-top-*.svg; .device-screen matches its opening (x 139-1460, y 132-656.45 in a 115 105 1369 551.45
   viewBox), which the band render fills down to the bottom edge. */
.layouts { padding: 0 max(30px, calc((100% - 1240px) / 2)); margin-bottom: 72px; }
.layouts-card { display: flex; justify-content: center; overflow: hidden; padding-top: 64px; border-radius: 44px; background: var(--bg-alt); }
.device-top { width: min(100% - clamp(32px, 8%, 96px), 1150px); aspect-ratio: 1369 / 551.45; }
.device-top .device-screen { left: 1.7531%; top: 4.8962%; width: 96.4938%; height: 95.1038%; }
@media (min-width: 1100px) {
  .layouts { padding-inline: max(220px, calc((100% - 1240px) / 2)); }
}
@media (max-width: 734px) {
  .layouts { padding-inline: 16px; }
  .layouts-card { border-radius: 36px; padding-top: 40px; }
}
@media (orientation: portrait), (max-height: 500px), (prefers-reduced-motion: reduce) {
  .layouts { max-width: 1272px; margin: 24px auto 72px; padding: 0 16px; }
  .layouts-card { border-radius: 20px; padding-top: 34px; }
}
@media (min-width: 1100px) and (orientation: portrait), (min-width: 1100px) and (prefers-reduced-motion: reduce) {
  .layouts { max-width: none; padding-inline: 220px; }
}

/* Homepage side menu: fixed on the left, vertically centered, styled like the docs sidebar.
   Hidden below 1100px, where there's no room beside the content. */
.page-nav { display: none; }
@media (min-width: 1100px) {
  .page-nav { display: flex; flex-direction: column; gap: 2px; position: fixed; left: 24px; top: 50%; transform: translateY(-50%); z-index: 10; width: 180px; font-size: 14px; }
  .page-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; transition: color .15s, background .15s; }
  .page-nav a:hover { color: var(--text); background: var(--tint); }
  .page-nav a[aria-current] { color: var(--text); background: var(--tint-strong); }
  .index .hero, .index .section { padding-inline: 220px; }
}

/* Sections */
.section { padding: 120px 0; }
.section.alt { background: var(--bg-alt); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 64px; }
.tile { background: var(--card); border-radius: 28px; padding: 30px; margin: 0; color: var(--muted); }
.tile strong { color: var(--text); font-weight: 600; }

.faq { max-width: 860px; }
.faq h2 { text-align: center; margin-bottom: 56px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font: 600 19px/1.3 var(--font-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { color: var(--muted); margin: -6px 0 24px; max-width: 46em; }
.faq strong { color: var(--text); font-weight: 600; }

.sysreq { padding-top: 0; }
.sysreq h2 { font-size: 32px; margin-bottom: 36px; }
.sysreq dl { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; margin: 0; }
.sysreq dl div { display: flex; justify-content: space-between; gap: 24px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sysreq dt { color: var(--dim); }
.sysreq dd { margin: 0; text-align: right; }

/* Documentation pages */
.doc-shell { width: min(var(--wrap-wide), 100% - 48px); margin: 0 auto; display: grid; grid-template-columns: 200px minmax(0, 720px) 200px; gap: 56px; justify-content: center; padding: 128px 0 120px; }
.doc-nav, .doc-toc { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.doc-nav a, .doc-toc a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; transition: color .15s, background .15s; }
.doc-nav a:hover, .doc-toc a:hover { color: var(--text); background: var(--tint); }
.doc-nav a[aria-current="page"] { color: var(--text); background: var(--tint-strong); }
.doc-nav .eyebrow, .doc-toc .eyebrow { margin: 0 0 10px 10px; font: 600 11px var(--font); letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.doc-toc.hidden { visibility: hidden; }
.doc-head { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: clamp(38px, 5vw, 56px); margin-bottom: 16px; }
.doc-body h2 { font-size: 28px; letter-spacing: -0.025em; margin: 56px 0 18px; }
.doc-body h3 { font-size: 19px; margin: 36px 0 12px; }
.doc-body h4 { font-size: 16px; margin: 28px 0 10px; }
.doc-body p, .doc-body li { color: var(--body); }
.doc-body strong { color: var(--text); font-weight: 600; }
.doc-body a { color: var(--text); text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 3px; }
.doc-body a:hover { text-decoration-color: var(--text); }
.doc-body ul, .doc-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.doc-body li { margin: 0.45em 0; }
.doc-body li::marker { color: var(--dim); }
.doc-body code { font: 0.86em var(--mono); background: var(--code-bg); padding: 2px 6px; border-radius: 6px; color: var(--text); overflow-wrap: anywhere; }
.doc-body .plain { white-space: pre-wrap; font: 14px/1.7 var(--mono); color: var(--body); background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; overflow-x: auto; }
.doc-edit { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.doc-edit a { color: var(--dim); }

/* 404 */
.notfound { padding: 180px 0 160px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.notfound .lede { margin-top: 20px; }

/* Footer */
.footer { padding: 64px 0; font-size: 12px; line-height: 1.33; color: var(--dim); border-top: 1px solid var(--line); }
.footer-inner { width: min(var(--wrap), 100% - 60px); margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-cols h2 { font: 600 12px var(--font); color: var(--text); margin-bottom: 12px; }
.footer-cols a { display: block; color: var(--muted); text-decoration: none; margin: 9px 0; }
.footer-cols a:hover { color: var(--text); text-decoration: underline; }
.footer-note { margin: 0; }

/* Smaller screens */
@media (max-width: 1100px) {
  .doc-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .doc-toc { display: none; }
}
@media (max-width: 820px) {
  .wrap, .footer-inner { width: calc(100% - 32px); }
  .hero { padding: 128px 16px 0; }
  .section { padding: 88px 0; }
  .tiles { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .faq h2 { margin-bottom: 36px; }
  .sysreq dl { grid-template-columns: 1fr; }
  .footer-cols { gap: 40px; }
  .doc-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 112px; }
  .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .doc-nav .eyebrow { width: 100%; margin-left: 0; }
  .doc-nav a { border: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .nav .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary::after { transition: none; }
}
