/* Tokens: see DESIGN.md */
:root {
  --page: #ffffff; --surface: #f5f5f7; --line: #e3e3e6;
  --text: #1d1d1f; --text-2: #515154; --text-3: #86868b;
  --night: #111114; --on-night: #f5f5f7; --on-night-2: #a1a1a6;
  --amber: #ffb13d; --amber-ink: #a35f00; --switch-on: #34c759;
  --t-hero: 76px; --t-h2: 52px; --t-lead: 19px; --t-body: 17px; --t-card: 19px; --t-small: 14px;
  --section: 200px; --max: 1120px; --text-max: 640px;
  --gutter: clamp(20px, 5vw, 48px);
  --r-card: 24px; --r-device: 22px; --r-panel: 14px; --r-code: 14px;
  --shadow-device: 0 40px 80px -20px rgba(0,0,0,.35), 0 12px 24px -8px rgba(0,0,0,.2);
  --shadow-panel: 0 20px 50px rgba(0,0,0,.28), 0 0 0 .5px rgba(0,0,0,.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-hover: cubic-bezier(0.4, 0, 0.2, 1);
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}
@media (max-width: 760px) {
  :root { --t-hero: 44px; --t-h2: 34px; --t-lead: 18px; --t-body: 16px; --t-card: 18px; --t-small: 13px; --section: 128px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page); color: var(--text-2);
  font: 400 var(--t-body)/1.55 "Hubot Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3 { color: var(--text); margin: 0; font-weight: 600; }
p { margin: 0; }
code { font: .92em ui-monospace, "SF Mono", Menlo, monospace; }

.sprite { position: absolute; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Nav */
.nav {
  position: absolute; inset: 0 0 auto; z-index: 10; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--text-2); transition: color 180ms var(--ease-hover); }
.nav-links a:not(.btn):hover { color: var(--text); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 24px;
  border-radius: 999px; background: var(--text); color: #fff; text-decoration: none;
  font: 600 16px/1 "Hubot Sans", system-ui, sans-serif; letter-spacing: -.005em;
  transition: background 180ms var(--ease-hover), transform 180ms var(--ease-hover);
}
.btn:hover { background: #000; }
.btn:active { transform: scale(.98); }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-secondary:hover { background: #ebebee; }
.btn-small { height: 36px; padding: 0 16px; font-size: 14px; }

/* Hero */
.hero { padding: 120px var(--gutter) 0; text-align: center; }
.hero-text { max-width: 1120px; margin: 0 auto; }
.hero h1 { font-size: var(--t-hero); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.hero .lead { margin: 24px auto 0; max-width: 620px; }
.lead { font-size: var(--t-lead); line-height: 1.45; letter-spacing: -.005em; color: var(--text-2); text-wrap: pretty; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.requirements { margin-top: 14px; font-size: var(--t-small); color: var(--text-3); }

/* Stage: the display, with the panel over it */
.stage { position: relative; max-width: 1040px; margin: 48px auto 0; }
/* Devices: Apple Design Resources bezels (PNG with a transparent screen), content placed under the frame */
.dev { position: relative; }
.dev-frame { position: relative; z-index: 1; display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.dev-screen { position: absolute; overflow: hidden; background: #000; }
.dev-sd .dev-screen { left: 1.9%; top: 2.5%; width: 96.2%; height: 70.7%; }
.dev-mbp .dev-screen { left: 10.273%; top: 2.395%; width: 79.453%; height: 85.54%; }
.wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dim { position: absolute; inset: 0; background: #000; opacity: calc((1 - var(--b, .7)) * .82); pointer-events: none; }
.menubar {
  position: absolute; inset: 0 0 auto; height: 26px; display: flex; align-items: center; gap: 18px;
  padding: 0 14px; font: 500 13px/1 var(--sys); color: #fff;
  background: rgba(0, 0, 0, .18); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
}
.mb-app { font-weight: 700; }
.mb-spacer { flex: 1; }
.mb-lumac { display: grid; place-items: center; width: 30px; height: 22px; border-radius: 5px; background: rgba(255,255,255,.28); }
.mb-lumac svg { width: 16px; height: 16px; color: #fff; }

/* Panel: rebuilt from Lumac's PanelView (SwiftUI, width 320, padding 10) */
.panel {
  position: absolute; top: 60px; right: 64px; width: 320px; padding: 10px; text-align: left;
  font: 400 13px/1.3 var(--sys); color: #1d1d1f;
  background: rgba(246, 246, 248, .86); backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border-radius: var(--r-panel); box-shadow: var(--shadow-panel);
  transform-origin: top right; pointer-events: none;
}
.p-card { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(0,0,0,.05); }
.p-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: #1d1d1f; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.p-name { font-weight: 600; font-size: 14px; }
.p-sub { font-size: 12px; color: #86868b; margin-top: 1px; }
.p-levels { display: grid; gap: 12px; padding: 12px 6px; }
.p-level { display: grid; gap: 4px; cursor: default; }
.p-row { display: flex; justify-content: space-between; }
.p-pct { color: #86868b; font-variant-numeric: tabular-nums; }
.p-slider { display: flex; align-items: center; gap: 8px; }
.p-sico { width: 15px; height: 15px; flex: none; fill: none; stroke: #86868b; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.p-input { display: flex; align-items: center; gap: 8px; }
.p-menu { margin-left: auto; color: #515154; }

.panel input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 20px; margin: 0; background: transparent; cursor: pointer;
  --fill: 50%;
}
.panel input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--amber) var(--fill), rgba(0,0,0,.12) var(--fill));
}
.panel input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(0,0,0,.12); }
.panel input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--amber); }
.panel input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.25);
}
.panel input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.25); }
.panel input[type=range]:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; border-radius: 4px; }

.panel hr { border: 0; height: 1px; background: rgba(0,0,0,.1); margin: 4px 6px; }
.p-switches { display: grid; gap: 8px; padding: 8px 6px; }
.p-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.p-switch span { flex: 1; }
.p-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.p-switch i {
  position: relative; flex: none; width: 26px; height: 15px; border-radius: 8px; background: rgba(0,0,0,.14);
  transition: background 180ms var(--ease-hover);
}
.p-switch i::after {
  content: ""; position: absolute; top: 1px; left: 1px; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 180ms var(--ease-hover);
}
.p-switch input:checked + i { background: var(--switch-on); }
.p-switch input:checked + i::after { transform: translateX(11px); }
.p-switch input:focus-visible + i { outline: 2px solid #0a84ff; outline-offset: 2px; }
.p-note { font-size: 12px; color: #86868b; margin-top: -4px; }
.p-quit { display: flex; justify-content: space-between; padding: 5px 6px; border-radius: 6px; }
.p-key { color: #86868b; }

@media (max-width: 760px) {
  .stage { margin-top: 56px; }
  .menubar { height: 18px; font-size: 9px; gap: 10px; padding: 0 8px; }
  .mb-hide { display: none; }
  .mb-lumac { width: 22px; height: 15px; }
  .mb-lumac svg { width: 11px; height: 11px; }
  .panel { position: relative; z-index: 2; top: auto; right: auto; margin: -96px auto 0; max-width: 320px; width: 100%; transform: none; }
}

/* Sections */
.section { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: var(--section) var(--gutter) 0; }
.section-head { max-width: 820px; }
.section-head .lead { max-width: var(--text-max); }
.section-head h2 { font-size: var(--t-h2); line-height: 1.06; letter-spacing: -.03em; text-wrap: balance; }
.section-head .lead { margin-top: 20px; }

/* Feature blocks: one large visual per section */
.feature { position: relative; margin-top: 64px; height: 600px; border-radius: 28px; background: var(--surface); overflow: hidden; }
.feature .dim { position: absolute; inset: 0; background: #000; pointer-events: none; }

/* Keys demo: a display above the top row of a Mac keyboard, cut by the block's bottom edge */
.kd-display { position: absolute; left: 50%; top: 48px; width: 600px; transform: translateX(-50%); }
.kd-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kd-screen .dim { opacity: calc((1 - var(--b, 1)) * .9); transition: opacity 200ms var(--ease-hover); }
.kd-pointer { position: absolute; left: 58%; top: 52%; width: 26px; height: 26px; fill: #fff; stroke: #000; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.keyboard { position: absolute; left: 50%; bottom: -40px; transform: translateX(-50%); display: flex; gap: 12px; padding: 18px 18px 54px; border-radius: 22px 22px 0 0; background: linear-gradient(#d9d9de, #c9c9cf); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.k { width: 104px; height: 84px; border: 0; border-radius: 12px; background: #1f1f22; color: #f5f5f7; display: grid; place-items: center; align-content: center; gap: 6px; font: 500 13px/1 var(--sys); box-shadow: 0 2px 0 #000, 0 3px 6px rgba(0,0,0,.25); }
.k svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.k small { font-size: 11px; color: #a1a1a6; }
.k-esc { width: 132px; align-content: end; justify-items: start; padding: 0 0 12px 14px; }
.k.pressed, .k[data-key].pressed { transform: translateY(2px); box-shadow: 0 0 0 #000, 0 1px 3px rgba(0,0,0,.25); color: var(--amber); }

/* Follow demo: MacBook and external display dimming together */
.feature-follow { display: grid; align-content: center; justify-items: center; gap: 48px; }
.fl-pair { display: flex; align-items: flex-end; gap: 32px; }
.fl-ext { width: 540px; } .fl-mac { width: 380px; }
.fl-ext .dev-screen img, .fl-mac .dev-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fl-tag { display: block; margin-bottom: 14px; font: 500 14px/1 var(--sys); color: var(--text-3); white-space: nowrap; }
.fl-tag b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.feature-follow .dim { transition: opacity 120ms linear; }

@media (max-width: 760px) {
  .feature { height: 440px; margin-top: 40px; border-radius: 22px; }
  .kd-display { width: calc(100% - 40px); top: 28px; }
  .keyboard { gap: 6px; padding: 10px 10px 44px; border-radius: 14px 14px 0 0; }
  .k { width: 52px; height: 48px; border-radius: 8px; } .k svg { width: 18px; height: 18px; } .k small { display: none; }
  .k-esc { width: 60px; padding: 0 0 8px 8px; font-size: 11px; }
  .keyboard .k:nth-child(n+5) { display: none; }
  .fl-pair { gap: 12px; } .fl-ext { width: 58%; } .fl-mac { width: 42%; } .fl-tag { font-size: 11px; margin-bottom: 8px; }
}

/* Lid: the one dark section */
.night { background: var(--night); color: var(--on-night-2); margin-top: var(--section); padding: 160px var(--gutter); }
.night-inner { max-width: var(--max); margin: 0 auto; }
.night h2 { color: var(--on-night); }
.night .lead { color: var(--on-night-2); }
/* Desk scene: the MacBook lid closes in 3D, then the display goes dark. Loops while visible. */
.feature-lid { height: auto; margin-top: 24px; display: grid; place-items: end center; padding: 72px 40px; }
.desk { position: relative; margin-top: 0; display: flex; align-items: flex-end; justify-content: center; gap: 28px; padding-bottom: 1px; }
.desk-display { width: 640px; }
.desk-display .dev-screen img, .mbp-front .dev-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.desk-off { position: absolute; inset: 0; background: #050506; opacity: 0; transition: opacity 900ms ease; }
.desk-off { transition: opacity 300ms ease; }
.desk[data-mode="with"] .desk-off { opacity: 1; }
.mode { display: inline-flex; margin-top: 48px; padding: 4px; border-radius: 999px; background: var(--surface); }
.mode button { height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 600 15px/1 "Hubot Sans", system-ui, sans-serif; cursor: pointer; transition: background 200ms var(--ease-hover), color 200ms var(--ease-hover); }
.mode button[aria-checked="true"] { background: var(--text); color: #fff; }
.mode button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.desk-state { margin-top: 20px; font-size: 16px; color: var(--text-2); }
.desk { opacity: 1 !important; transform: none !important; }

@media (max-width: 760px) {
  .desk { flex-direction: column; align-items: center; gap: 40px; margin-top: 48px; }
  .desk-display { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .desk-off { transition: none; } }

/* Lid section: the two cases side by side, text only */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 64px; }
.cmp { padding: 44px 48px 52px; border-radius: 28px; background: var(--surface); }
.cmp-with { background: var(--text); }
.cmp-label { font-size: var(--t-small); font-weight: 600; color: var(--text-3); }
.cmp-with .cmp-label { color: var(--amber); }
.cmp-text { margin-top: 16px; font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; color: var(--text); text-wrap: balance; }
.cmp-with .cmp-text { color: #fff; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; gap: 12px; margin-top: 40px; } .cmp { padding: 28px 24px 32px; } .cmp-text { font-size: 24px; } }

/* Compatibility: one card per connection, drawn as Mac → cable → display */
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 64px; }
.link { background: var(--surface); border-radius: var(--r-card); padding: 40px 32px 32px; }
.ln-chain { display: flex; align-items: center; gap: 10px; height: 96px; margin-bottom: 28px; }
.ln-end { width: 48px; height: 48px; flex: none; fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ln-wire { flex: 1; height: 4px; border-radius: 2px; background: var(--amber); }
.ln-dot { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--amber); }
.ln-dot svg { width: 20px; height: 20px; fill: none; stroke: var(--night); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.link-no .ln-wire { background: repeating-linear-gradient(to right, #c7c7cc 0 8px, transparent 8px 14px); height: 3px; }
.link-no .ln-dot { background: #dcdce0; } .link-no .ln-dot svg { stroke: var(--text-2); }
.link-no .ln-end { stroke: var(--text-3); }
.link h3 { font-size: var(--t-card); line-height: 1.3; letter-spacing: -.01em; }
.link p { margin-top: 6px; font-size: 16px; }
.link-yes p { color: var(--amber-ink); font-weight: 500; }
.compat-foot { margin-top: 28px; font-size: var(--t-small); color: var(--text-3); }
.compat-foot a { color: var(--text-2); text-underline-offset: 3px; }
@media (max-width: 960px) { .links { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .links { grid-template-columns: 1fr; gap: 12px; margin-top: 40px; } .link { padding: 24px; } .ln-chain { height: 64px; margin-bottom: 16px; } }

/* FAQ */
.faq { margin-top: 48px; border-top: 1px solid var(--line); max-width: 800px; }
.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: 24px 0; font-size: 19px; font-weight: 500; color: var(--text); letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--text-3); transition: transform 180ms var(--ease-hover); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; max-width: var(--text-max); }

/* Download */
.section-end { text-align: center; display: flex; flex-direction: column; align-items: center; padding-bottom: 160px; }
.end-icon { width: 168px; height: 168px; margin-bottom: 28px; }
.section-end h2 { font-size: var(--t-h2); line-height: 1.06; letter-spacing: -.03em; }
.section-end .cta { margin-top: 32px; }
.brew { margin-top: 48px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.brew-label { font-size: var(--t-small); color: var(--text-3); width: 100%; }
.brew code { background: var(--surface); border-radius: var(--r-code); padding: 12px 16px; color: var(--text); font-size: 14px; }
.copy {
  height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text);
  font: 500 14px "Hubot Sans", system-ui, sans-serif; cursor: pointer; transition: background 180ms var(--ease-hover);
}
.copy:hover { background: #ebebee; }

/* Footer */
.footer {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; gap: 24px; flex-wrap: wrap; font-size: var(--t-small); color: var(--text-3); border-top: 1px solid var(--line);
}
.footer span { margin-right: auto; }
.footer a { text-decoration: none; transition: color 180ms var(--ease-hover); }
.footer a:hover { color: var(--text); }

/* Reveal on scroll: content stays visible without JS */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
