/* Hero: 23:42, four Ghostty windows, thirty-two tabs, one jump. */

.site-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 var(--gutter);
  background: var(--night-deep);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--moon);
  text-decoration: none;
  font-weight: 720;
  font-size: 1.0625rem;
  font-variation-settings: "CASL" 0.6, "MONO" 0;
  letter-spacing: -0.01em;
}
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); font-size: 0.9375rem; }
.site-nav .link { text-decoration-color: transparent; color: var(--haze); }
.site-nav .link:hover { color: var(--moon); text-decoration-color: currentColor; }

/* ---------- The desktop: full bleed, the wallpaper runs to the bottom and fades into the night ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  /* one screen tall, capped so a tall portrait display doesn't get an empty desktop */
  min-height: min(calc(100vh - 56px), 1040px);
  min-height: min(calc(100svh - 56px), 1040px);
  background:
    linear-gradient(180deg, rgba(18, 23, 46, 0) 0, rgba(18, 23, 46, 0) calc(100% - 260px), var(--night) 100%),
    linear-gradient(164deg, #131834 0%, #1a2149 34%, #243067 68%, #2e3a73 100%);
}
.hero-screen { position: relative; }
.hero-screen .macbar { position: relative; z-index: 2; }
.wall-stage {
  position: relative;
  height: var(--wall-h, 360px);
  overflow: hidden;
  /* the zoomed camera crops the stack; fade the crop instead of cutting it */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
}
/* The camera is a WAAPI animation in hero.js; no CSS transition, so the first fit and every resize land without a slide */
.wall {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.wall .gw { transition: opacity 520ms var(--ease-out); }
.wall .gw.is-target { z-index: 5; } /* TabPulse raises the window it jumps to */
.wall.is-zoomed .gw:not(.is-target) { opacity: 0.22; }
.wall .gw-body { padding-top: 6px; font-size: 12px; line-height: 18px; }
/* Back windows show only their prompt line; the rest would peek out as clipped fragments */
.wall .gw:not(.is-target):not(.is-focused) .gw-body p + p { visibility: hidden; }

/* The caption is drawn in screen space, at a size that matches the zoomed tab */
.wall-caption {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  opacity: 0;
  transform: scale(var(--cap-k, 1));
  transform-origin: 0 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}
.wall-caption.is-on {
  opacity: 1;
  transition-delay: 420ms;
}
.wall-caption .tpmenu { position: relative; }

/* ---------- Copy on the desktop, under the windows ---------- */
.hero-copy {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  /* install sits right under the title, so the command is in the first view on a laptop */
  grid-template-areas:
    "title jump"
    "install jump"
    "lead jump";
  grid-template-rows: auto auto 1fr;
  align-items: start;
  column-gap: clamp(28px, 4vw, 80px);
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
  padding: clamp(18px, 2.4vw, 34px) 0 clamp(120px, 12vw, 200px);
}
.hero-title {
  grid-area: title;
  max-width: 19ch;
  font-size: var(--text-h1);
  font-weight: 720;
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-variation-settings: "CASL" 0.3, "MONO" 0;
}
.hero-lead {
  grid-area: lead;
  max-width: 46ch;
  margin-top: clamp(18px, 2vw, 26px);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--moon);
}
.hero-install { grid-area: install; margin-top: 24px; max-width: 640px; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 14px; }
.hero-reqs { margin-top: 16px; max-width: 60ch; font-size: var(--text-small); color: var(--haze); }

/* ---------- ⌃⌥⌘J ---------- */
/* A dock-like tray on the desktop: the keycaps, what they do, and the pause control */
.jump {
  grid-area: jump;
  justify-self: start;
  width: min(100%, 520px);
  padding: 16px 18px 18px;
  border-radius: 22px;
  background: rgba(11, 14, 32, 0.5);
  box-shadow: inset 0 0 0 1px rgba(233, 230, 247, 0.1), 0 24px 48px -26px rgba(3, 5, 18, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}
.jump-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.keycaps {
  display: inline-flex;
  gap: 8px;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background: rgba(5, 7, 18, 0.55);
  box-shadow: inset 0 0 0 1px rgba(233, 230, 247, 0.08), inset 0 2px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.keycaps:focus-visible { outline-offset: 4px; border-radius: 16px; }
.key {
  position: relative;
  display: block;
  width: 62px;
  height: 58px;
  border-radius: 9px;
  background: linear-gradient(180deg, #2b3049 0%, #23273d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.32),
    0 2.5px 0 #070915,
    0 4px 9px rgba(0, 0, 0, 0.42);
  color: var(--moon);
  transition: transform 70ms ease-out, box-shadow 70ms ease-out, color 240ms ease, background-color 240ms ease;
}
.key-sym {
  position: absolute;
  top: 7px;
  right: 9px;
  font-family: var(--font-key);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}
.key-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-family: var(--font-key);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  color: var(--haze);
}
.key-letter .key-sym {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -52%);
  font-size: 21px;
}
.key.is-down {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0.5px 0 #070915,
    0 1px 3px rgba(0, 0, 0, 0.4);
}
.keycaps.is-armed .key-letter {
  color: var(--amber);
  box-shadow:
    inset 0 0 0 1.5px rgba(240, 163, 94, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 2.5px 0 #070915,
    0 4px 9px rgba(0, 0, 0, 0.42);
}
.keycaps.is-armed .key-letter.is-down {
  box-shadow: inset 0 0 0 1.5px rgba(240, 163, 94, 0.85), 0 0.5px 0 #070915;
}
.keycaps.is-beep { animation: beep 340ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes beep {
  0%, 100% { transform: none; }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
.jump-prompt {
  margin-top: 14px;
  min-height: 3.1em;
  max-width: 36ch;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--moon);
}
.jump-hint { margin-top: 6px; max-width: 40ch; font-size: var(--text-small); color: var(--haze); }

/* Laptop screens up to 1440x900: a two-line title, so the keycaps, the prompt and the install command share the first view */
@media (min-width: 901px) and (max-height: 960px) {
  .hero-copy { padding-top: 14px; }
  .hero-title { max-width: none; font-size: clamp(2.6rem, 8.5vh, 4.25rem); }
  .jump { padding: 12px 14px 14px; }
  .jump-prompt { margin-top: 10px; }
  /* the browser caveat stays for screen readers but leaves the tray */
  .jump-hint-extra {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .hero-copy {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "install" "jump" "lead";
    grid-template-rows: none;
  }
  .jump { margin-top: 28px; }
  .hero-install { margin-top: 22px; }
  .hero-lead { margin-top: 24px; }
}
@media (max-width: 560px) {
  .site-nav .nav-extra { display: none; }
  .jump { padding: 12px 12px 14px; border-radius: 20px; }
}
@media (max-width: 380px) {
  .keycaps { gap: 6px; padding: 8px; }
  .key { width: 56px; height: 54px; }
}

/* With Reduce Motion on the hero is a still picture, so it has nothing to pause */
html.rm .motion-toggle--hero { display: none; }

@media (prefers-reduced-motion: reduce) {
  .wall .gw, .wall-caption, .key { transition: none; }
  .keycaps.is-beep { animation: none; box-shadow: inset 0 0 0 1.5px var(--haze); }
}
