/* The hero: centred copy, then a framed Mac where a scripted cursor demos Switchy.
   The Mac is a recording, not a control: it is inert and ignores the pointer. */

.hero { position: relative; background: var(--paper); padding-bottom: 8px; overflow: hidden; }

/* ---------- Top nav ---------- */
.topnav {
  max-width: 1376px; margin: 0 auto; padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topnav__brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.topnav__brand:hover { text-decoration: none; }
.topnav__brand img { border-radius: 7px; }
.topnav__links { display: flex; gap: 28px; font-size: 15px; font-weight: 500; }
.topnav__links a { color: var(--ink); }
.btn--sm { min-height: 38px; padding: 0 18px; font-size: 14px; box-shadow: none; }

/* ---------- Copy ---------- */
.hero__copy {
  max-width: 1120px; margin: 0 auto; padding: 44px 24px 44px;
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.hero h1 { font-size: clamp(40px, 5.2vw, 72px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.hero__accent { display: block; color: var(--violet); }
.hero__copy p { max-width: 600px; font-size: 19px; line-height: 1.5; color: var(--muted); }
.hero__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero__meta { font-size: 13px; color: var(--muted); }

/* ---------- Stage: the Mac is drawn at a fixed design size, then scaled to fit ---------- */
.stage {
  --w: 968; --h: 720;
  position: relative; width: min(1160px, calc(100% - 64px)); margin: 0 auto;
  aspect-ratio: var(--w) / var(--h);
  perspective: 1800px;
  /* The bottom 15% fades out into the page */
  -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
}
.stage__frame { position: absolute; inset: 0; transform-origin: 50% 0; }
.mac {
  position: absolute; left: 0; top: 0;
  width: calc(var(--w) * 1px); height: calc(var(--h) * 1px);
  transform: scale(var(--k, 1)); transform-origin: 0 0;
  border-radius: 18px; overflow: hidden; isolation: isolate;
  pointer-events: none; user-select: none;
  color: #0b1530;
  --mb-ink: #000; --mb-hl: rgb(0 0 0 / 0.1); --mb-bg: rgb(255 255 255 / 0.2);
}
.mac[data-theme="dark"] { color: #fff; --mb-ink: #fff; --mb-hl: rgb(255 255 255 / 0.2); --mb-bg: rgb(0 0 0 / 0.18); }
.mac::after { content: ""; position: absolute; inset: 0; z-index: 70; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(17 18 20 / 0.08); }

/* Wallpaper: the day artwork loads with the page; the night one fades in after load */
.wallpaper { position: absolute; inset: 0; z-index: -1; background: linear-gradient(170deg, #a9cbff 0%, #dcdcff 55%, #f6dff0 100%); }
.mac[data-theme="dark"] .wallpaper { background: linear-gradient(170deg, #050820 0%, #0d1140 60%, #1d1048 100%); }
.wallpaper__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; opacity: 0; transition: opacity 0.9s var(--ease-out); }
.mac:not([data-theme="dark"]) .wallpaper__img--day,
.mac[data-theme="dark"] .wallpaper__img--night.is-loaded { opacity: 1; }

/* ---------- Menu bar ---------- */
.menubar {
  position: relative; z-index: 20; height: 24px; padding: 0 8px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--mb-ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 13px; letter-spacing: -0.01em; transition: color 0.5s;
}
/* Blur lives on a pseudo-element: a blurred ancestor would stop the panel's own blur */
.menubar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--mb-bg); transition: background-color 0.5s;
  -webkit-backdrop-filter: blur(40px) saturate(160%); backdrop-filter: blur(40px) saturate(160%);
}
.mb-group { display: flex; align-items: center; height: 100%; min-width: 0; }
.mb-item { height: 22px; padding: 0 10px; border-radius: 5px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: background-color 0.15s; }
.mb-item--app { font-weight: 700; }
.mb-apple { padding: 0 12px 0 10px; }
.mb-apple svg { width: 14px; height: 16px; }
.mb-icon { padding: 0 7px; }
.mb-icon svg { width: 18px; height: 18px; }
.mb-clock { padding: 0 8px 0 10px; font-variant-numeric: tabular-nums; }
.mb-switchy { position: relative; display: flex; align-items: center; height: 100%; }
.mb-switchy__btn[data-on="true"] { background: var(--mb-hl); }
.mb-pill {
  height: 22px; padding: 0 8px; margin-right: 4px; border-radius: 11px;
  display: inline-flex; align-items: center; gap: 4px;
  color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: #007aff; transition: background-color 0.35s;
}
.mb-pill svg { width: 13px; height: 13px; }
.mb-pill[data-phase="succeeded"] { background: #28cd41; }

/* The panel hangs 6pt under the icon, centred on it (StatusPanelController) */
/* Centred by margin, not translate, so the demo can find targets from layout offsets */
.sw-panel--hero { position: absolute; top: calc(100% + 6px); left: 50%; margin-left: -180px; z-index: 30; }

/* ---------- Dock ---------- */
.dock {
  position: absolute; left: 50%; bottom: 8px; translate: -50% 0; z-index: 10;
  display: flex; align-items: flex-end; gap: 6px; padding: 5px 7px; border-radius: 18px;
  background: rgb(255 255 255 / 0.28);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.45), 0 10px 30px rgb(0 0 0 / 0.15);
  transition: background-color 0.6s;
}
.mac[data-theme="dark"] .dock { background: rgb(30 30 34 / 0.35); box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.18), 0 10px 30px rgb(0 0 0 / 0.35); }
.dock__app { position: relative; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.dock__app svg { width: 26px; height: 26px; }
.dock__app img { width: 44px; height: 44px; border-radius: 11px; }
.dock__app.is-running::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: rgb(0 0 0 / 0.55);
}
.mac[data-theme="dark"] .dock__app.is-running::after { background: rgb(255 255 255 / 0.8); }

/* ---------- Scripted cursor ---------- */
.cursor { position: absolute; left: 0; top: 0; z-index: 60; will-change: transform; visibility: hidden; }
.cursor svg { width: 19px; height: 24px; transform-origin: 2px 2px; filter: drop-shadow(0 1.5px 2px rgb(0 0 0 / 0.35)); }
.cursor__ring {
  position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%;
  background: rgb(10 132 255 / 0.22); box-shadow: 0 0 0 1.5px rgb(10 132 255 / 0.55); opacity: 0;
}

/* ---------- Narrow screens: a slimmer Mac, cropped to the menu bar's right side ---------- */
@media (max-width: 760px) {
  .topnav { padding: 16px 20px; }
  .topnav__links { display: none; }
  .hero__copy { padding: 36px 20px 32px; }
  .hero__copy p { font-size: 17px; }
  .stage { --w: 440; width: calc(100% - 32px); }
  .mb-hide-sm { display: none !important; }
}

/* Intro: hero extras wait for GSAP (the headline never does) */
html.is-intro [data-intro] { opacity: 0; }

/* The Mac rises in with CSS, transform only: it paints at once, so it never delays LCP */
@keyframes stage-rise { from { transform: translateY(36px); } }
@media (prefers-reduced-motion: no-preference) {
  .stage { animation: stage-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both; }
}
