/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }
html, body { margin: 0; padding: 0; background: #131519; }

/* Self-hosted variable font: the page practices "no server, no account". */
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('./assets/fonts/familjen-grotesk-var.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-soft: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.95);
  --text-mid: rgba(255, 255, 255, 0.5);
  /* Meaningful small print: 0.55 measures 6.2:1 on #131519 (4.5:1 needs 0.46). */
  --text-dim: rgba(255, 255, 255, 0.55);
  /* Decorative marks only (stamps, replica chrome): 2.9:1, below AA on purpose. */
  --text-faint: rgba(255, 255, 255, 0.32);
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --display: 'Familjen Grotesk', sans-serif;
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
a:hover { color: #ffffff; }

::selection { background: rgba(10, 132, 255, 0.35); }

button:focus-visible,
a:focus-visible { outline: 2px solid #0A84FF; outline-offset: 2px; }

.spacer { flex: 1; }
.mono { font-family: var(--mono); }
.container { max-width: 1040px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Skip link: the first focusable element on the page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1200;
  padding: 12px 16px;
  border-radius: 0 0 12px 0;
  background: #0A84FF;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Grain: one fixed feTurbulence tile over everything, videos included,
   which glues the loops to the page. */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Hero ============ */
.hero {
  position: relative;
  background: radial-gradient(120% 90% at 50% 0%, #1a1d24 0%, rgba(19, 21, 25, 0) 70%);
}

/* macOS menu bar suggestion */
.menubar {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 16px;
  background: rgba(28, 30, 36, 0.85);
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  user-select: none;
}
.menubar__app { font-weight: 600; color: rgba(255, 255, 255, 0.5); }
.menubar__items { display: flex; gap: 14px; }
.menubar__clock {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}
/* Narrow viewports: drop the menu items so the clock keeps one line in the bar. */
@media (max-width: 700px) {
  .menubar__items { display: none; }
}

/* Island scene */
.scene-box { position: relative; height: 392px; z-index: 2; }
.scene {
  position: relative;
  width: 600px;
  height: 392px;
  /* Explicit centering: auto margins clamp to 0 when the child is wider than
     the parent, which put the scale() center off screen on phones. */
  margin-left: calc(50% - 300px);
  transform-origin: top center;
}

/* Blueprint leader lines. The direction hides these below 700px; the page hides
   them below 1100px because the labels would clip against overflow-x sooner. */
.leaders {
  position: absolute;
  top: 0;
  left: -240px;
  width: 1080px;
  height: 392px;
  pointer-events: none;
  z-index: 3;
}
.leader path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.leader circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
}
.leader text {
  font-family: var(--mono);
  font-size: 12px;
  fill: rgba(255, 255, 255, 0.45);
  opacity: 0;
}
.hero.is-drawn .leader path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s var(--ease); }
.hero.is-drawn .leader circle { transform: scale(1); transition: transform 0.3s var(--ease); }
.hero.is-drawn .leader text { opacity: 1; transition: opacity 0.2s var(--ease); }
.hero.is-drawn .leader--1 path { transition-delay: 0ms; }
.hero.is-drawn .leader--1 circle { transition-delay: 0ms; }
.hero.is-drawn .leader--1 text { transition-delay: 900ms; }
.hero.is-drawn .leader--2 path { transition-delay: 150ms; }
.hero.is-drawn .leader--2 circle { transition-delay: 150ms; }
.hero.is-drawn .leader--2 text { transition-delay: 1050ms; }
.hero.is-drawn .leader--3 path { transition-delay: 300ms; }
.hero.is-drawn .leader--3 circle { transition-delay: 300ms; }
.hero.is-drawn .leader--3 text { transition-delay: 1200ms; }
@media (max-width: 1099px) { .leaders { display: none; } }

/* The island: a fixed 600x372 stage. The spring writes one clip-path inset on
   .island__clip per frame; the drop-shadow on this wrapper hugs the clipped
   silhouette. Fallback if clip-path ever fights back: restore the old
   width/height/transform apply() from git history (constants are identical). */
.island {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -300px;
  width: 600px;
  height: 372px;
  filter: drop-shadow(0 6px 18px rgba(8, 10, 16, 0.35));
}
.island__clip {
  position: absolute;
  inset: 0;
  background: #000000;
  /* Closed pill: 180x38 centered at the top of the stage. */
  clip-path: inset(0px 210px 334px 210px round 19px);
}

/* Open-state black glass: top-lit shell gradient + 1px specular rim.
   --open-glass is driven by the open spring in main.js, so the glass fades in
   with the panel and the closed pill stays pure black, the notch illusion. */
.island__clip::before,
.island__clip::after {
  content: '';
  position: absolute;
  /* Match the 560px open window (the clip insets 20px per side), so the rim's
     radius-22 corners land on the visible corners instead of 20px outside. */
  left: 20px;
  right: 20px;
  top: 32px;
  bottom: 20px;
  border-radius: 22px;
  pointer-events: none;
  opacity: var(--open-glass, 0);
}
.island__clip::before { background: linear-gradient(180deg, #121216 0%, #000000 55%); }
.island__clip::after {
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* Closed pill button layer */
.island__open {
  position: absolute;
  top: 0;
  left: 210px;
  width: 180px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 19px;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.island__open:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #0A84FF; }
.island__open:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.island__open:active { transform: scale(0.98); }

/* Active module's accent, bled into the top of the panel. Registered so the
   colour interpolates on tab change instead of snapping. */
@property --island-accent {
  syntax: '<color>';
  inherits: false;
  initial-value: rgba(0, 0, 0, 0);
}

/* Open panel layer (fixed final layout, revealed by the clip) */
.panel {
  position: absolute;
  top: 32px;
  left: 20px;
  width: 560px;
  height: 320px;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  /* Transcribe is the tab active on load. */
  --island-accent: rgba(10, 132, 255, 0.04);
  background: radial-gradient(220px 220px at 50% 0%, var(--island-accent), rgba(0, 0, 0, 0) 100%);
  transition: --island-accent 0.25s var(--ease);
}

.panel__tabs {
  display: flex;
  align-items: center;
  padding: 10px 12px 6px;
}
.tab-btn {
  position: relative;
  /* 40px pitch: 8 tabs = 320px inside the 560px panel, and 40 x 0.623 keeps
     each tab's exclusive touch target >= 24px wide at the phone scale. */
  width: 40px;
  height: 28px;
  border-radius: 14px;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  transition: background 0.28s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.tab-btn:hover { background: rgba(220, 228, 245, 0.06); color: rgba(255, 255, 255, 0.7); }
.tab-btn.is-active { background: rgba(220, 228, 245, 0.10); color: #ffffff; }
.tab-btn:active { transform: scale(0.96); }
/* Expanded hit areas. Tabs sit flush against each other, so a horizontal
   expansion would paint over the neighbour and shrink its exclusive target;
   the tab width alone carries the horizontal size, ::after adds only height. */
.tab-btn::after {
  content: '';
  position: absolute;
  inset: -8px 0;
}
.panel__close::after {
  content: '';
  position: absolute;
  inset: -8px;
}
.tab-btn__mono {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}
.tab-btn__glyph { font-size: 12px; line-height: 1; }

.panel__close {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.panel__close:hover { background: rgba(220, 228, 245, 0.09); color: #ffffff; }
.panel__close:active { transform: scale(0.96); }

/* Module bodies */
.panel__body { flex: 1; position: relative; }
.mock {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.mock.is-active { opacity: 1; transform: none; pointer-events: auto; }

/* Resize pull indicator */
.panel__handle { height: 18px; display: grid; place-items: center; }
.panel__handle span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

/* --- Mock: Transcribe --- */
.mock-transcribe {
  height: 100%;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mt-head { display: flex; align-items: center; gap: 8px; }
.mt-file { font-size: 12.5px; color: var(--text); }
.mt-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.mt-bar {
  height: 3px;
  border-radius: 2px;
  background: rgba(220, 228, 245, 0.12);
  overflow: hidden;
}
.mt-bar__fill {
  width: 64%;
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
}
.mt-status { font-size: 11px; color: var(--text-faint); }
.mt-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.mt-line { display: flex; gap: 10px; align-items: baseline; }
.mt-speaker {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-mid);
  width: 52px;
  flex: none;
}
.mt-text { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.mt-text--muted { color: var(--text-mid); }
/* Same footer treatment as .mc-foot / .ms-foot, pinned by margin-top: auto. */
.mt-foot {
  margin-top: auto;
  padding: 9px 10px;
  border-top: 1px solid rgba(220, 228, 245, 0.06);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

/* --- Mock: Refiner --- */
.mock-refiner {
  height: 100%;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mr-input {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.04);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-mid);
  line-height: 1.5;
}
.mr-meta { display: flex; align-items: center; gap: 7px; }
.mr-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9px;
  background: rgba(220, 228, 245, 0.05);
  font-size: 10.5px;
  color: var(--text-mid);
}
.mr-chip__dot { width: 5px; height: 5px; border-radius: 3px; background: #BF5AF2; }
.mr-elapsed { font-size: 10.5px; color: var(--text-faint); }
.mr-output {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.05);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
}
.mr-note { font-size: 10.5px; color: var(--text-faint); }
.mr-foot { margin-top: auto; font-size: 11px; color: var(--text-faint); }

/* --- Mock: Accounts --- */
.mock-accounts {
  height: 100%;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ma-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
}
.ma-row--active { background: rgba(220, 228, 245, 0.05); }
.ma-avatar {
  width: 24px;
  height: 24px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.ma-avatar--claude { background: rgba(217, 119, 87, 0.18); color: #D97757; }
.ma-avatar--muted { background: rgba(220, 228, 245, 0.07); color: var(--text-mid); }
.ma-info { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.ma-name { font-size: 12.5px; font-weight: 500; color: var(--text-mid); }
.ma-name--strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.ma-dot { width: 5px; height: 5px; border-radius: 3px; }
.ma-dot--green { background: #30D158; }
.ma-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(220, 228, 245, 0.12);
  overflow: hidden;
  display: block;
}
.ma-fill { display: block; height: 100%; border-radius: 2px; }
.ma-fill--green { width: 13%; background: #30D158; }
.ma-fill--orange { width: 72%; background: #FF9F0A; }
.ma-usage {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mid);
}
.ma-reset { font-size: 9.5px; color: var(--text-faint); }
.ma-swap {
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.05);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-mid);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.ma-swap:hover { background: rgba(220, 228, 245, 0.09); color: var(--text); }
.ma-foot { margin-top: auto; font-size: 11px; color: var(--text-faint); }
.ma-foot__glyph { color: #D97757; }

/* --- Mock: Clipboard --- */
.mock-clipboard {
  height: 100%;
  padding: 8px 16px 0;
  display: flex;
  flex-direction: column;
}
.mc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
}
.mc-row:hover { background: rgba(220, 228, 245, 0.09); }
.mc-icon { flex: none; }
.mc-text {
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.mc-text.mono { font-size: 11.5px; }
.mc-age {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.mc-foot {
  margin-top: auto;
  padding: 9px 10px;
  border-top: 1px solid rgba(220, 228, 245, 0.06);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

/* --- Mock: Skills --- */
.mock-skills {
  height: 100%;
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.04);
  margin-bottom: 4px;
}
.ms-query { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.ms-installed { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.ms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
}
.ms-row:hover { background: rgba(220, 228, 245, 0.09); }
.ms-name { font-size: 12.5px; color: var(--text); }
.ms-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-mid);
}
.ms-state--done { color: #64D2FF; }
.ms-state--action {
  padding: 3px 9px;
  border-radius: 9px;
  background: rgba(220, 228, 245, 0.05);
}
.ms-spinner {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(220, 228, 245, 0.2);
  border-top-color: rgba(255, 255, 255, 0.8);
  animation: ms-spin 0.8s linear infinite;
}
@keyframes ms-spin { to { transform: rotate(360deg); } }
.ms-foot {
  margin-top: auto;
  padding: 9px 10px;
  border-top: 1px solid rgba(220, 228, 245, 0.06);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

/* --- Mock: Keys --- */
.mock-keys {
  height: 100%;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
}
.mk-row:hover { background: rgba(220, 228, 245, 0.09); }
.mk-name { font-size: 11px; color: var(--text); }
.mk-mask { font-size: 10.5px; color: var(--text-faint); }
.mk-verdict { font-family: var(--mono); font-size: 10.5px; }
.mk-verdict--valid { color: #30D158; }
.mk-verdict--invalid { color: #FF453A; }
.mk-toast {
  margin-top: auto;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.05);
  font-size: 10.5px;
  color: var(--text-mid);
}

/* --- Mock: Actions --- */
.mock-actions {
  height: 100%;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.05);
}
.mx-icon { flex: none; display: grid; place-items: center; }
.mx-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mx-name { font-size: 12.5px; color: var(--text); }
.mx-status { font-size: 10.5px; color: var(--text-mid); }
.mx-stop {
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.07);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-mid);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.mx-stop:hover { background: rgba(220, 228, 245, 0.11); color: var(--text); }
.mx-report {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(220, 228, 245, 0.04);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-mid);
}
.mx-foot { margin-top: auto; font-size: 11px; color: var(--text-faint); }

/* --- Mock: Modules manager (7 rows) --- */
.mock-modules {
  height: 100%;
  padding: 6px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: 8px;
}
.mm-tile {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
}
.mm-tile--mono {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}
.mm-tile--transcribe { background: rgba(10, 132, 255, 0.16); }
.mm-tile--refiner { background: rgba(191, 90, 242, 0.16); color: #BF5AF2; }
.mm-tile--accounts { background: rgba(217, 119, 87, 0.16); color: #D97757; font-size: 11px; }
.mm-tile--clipboard { background: rgba(255, 159, 10, 0.16); }
.mm-tile--skills { background: rgba(100, 210, 255, 0.16); }
.mm-tile--keys { background: rgba(255, 214, 10, 0.16); }
.mm-tile--actions { background: rgba(94, 92, 230, 0.16); }
.mm-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mm-name { font-size: 11.5px; font-weight: 500; }
.mm-desc {
  font-size: 10px;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-key {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}
.mm-toggle {
  width: 26px;
  height: 16px;
  border-radius: 8px;
  background: #0A84FF;
  position: relative;
  flex: none;
}
.mm-knob {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: #ffffff;
}
.mm-toggle--off { background: rgba(220, 228, 245, 0.12); }
.mm-toggle--off .mm-knob { right: auto; left: 2px; }

/* ============ App icon ============ */
.app-icon {
  position: relative;
  display: inline-block;
  border-radius: 17px;
  background: linear-gradient(#33477E, #141E3C);
  overflow: hidden;
  flex: none;
}
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; }
.app-icon .l-gear { opacity: 0.4; transition: transform 0.6s var(--ease); }

.app-icon--lg {
  width: 76px;
  height: 76px;
  border-radius: 17px;
  box-shadow: 0 8px 20px rgba(8, 10, 16, 0.4), inset 0 0 0 0.5px rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
}
.app-icon--lg:hover .l-gear { transform: rotate(30deg); }
.app-icon--lg .l-glasses { filter: drop-shadow(0 2px 3px rgba(8, 10, 16, 0.4)); }
.app-icon--lg .l-stache { filter: drop-shadow(0 2px 3px rgba(8, 10, 16, 0.5)); }

.app-icon--sm { width: 20px; height: 20px; border-radius: 4.5px; }

/* ============ Hero copy ============ */
.hero__copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: -24px auto 0; /* the open panel overlaps the copy block */
  padding: 8px 24px 96px;
  text-align: center;
}
.hero__copy h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: 'wght' 600;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}
/* Variable-weight settle: JS puts the h1 at 500 pre-paint (motion on only) and
   releases it to 600 over the hero reveal. */
.hero__copy h1.h1-start { font-variation-settings: 'wght' 500; }
.hero__copy h1.h1-anim { transition: font-variation-settings 0.8s var(--ease); }
@supports (-webkit-background-clip: text) {
  .hero__copy h1 {
    background: linear-gradient(90deg, #FFFFFF, #9B9B9B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.hero__sub {
  margin: 16px auto 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-mid);
  text-wrap: pretty;
}

/* ============ CTA ============ */
.cta-block {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  background: #0A84FF;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.4s var(--ease), background 0.2s var(--ease);
}
.cta:hover {
  transform: translateY(-1px) scale(1.02);
  background: #2492ff;
  color: #ffffff;
}
.cta:active { transform: scale(0.97); }
.fine-print {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
}
.proof {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
}

/* ============ Section chrome ============ */
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 16px;
}
.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
.section-sub {
  margin: 12px 0 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-mid);
  text-wrap: pretty;
}

/* ============ The bench: stations ============ */
.bench { padding-top: 96px; }
.station {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 96px;
}
.station:first-of-type { margin-top: 64px; }
.station__media { grid-column: 1 / 8; min-width: 0; }
.station__copy { grid-column: 9 / 13; padding-top: 48px; min-width: 0; }
.station--2 .station__copy { grid-column: 1 / 5; }
.station--2 .station__media { grid-column: 6 / 13; }
.station__tile {
  position: relative;
  background: #000000;
  border-radius: 24px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.station__tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Fig. 2's tile bleeds past the right container edge: the one deliberate bleed. */
@media (min-width: 1200px) {
  .station--2 .station__media { margin-right: -32px; }
}
.station__fig {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
}
.station__title {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.015em;
  color: var(--text);
  text-wrap: balance;
}
.station__body {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-mid);
  text-wrap: pretty;
}

/* Drawn annotation on a tile: dot, leader stroke, mono label. */
.anno {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}
/* Dot at the svg top: it anchors on the OUTPUT block's lower-right corner. */
.anno--br { right: 24px; bottom: 34px; }
/* Dot tucks under the Swap now chip; the label hangs in the empty band below. */
.anno--sw { right: 20px; top: 46%; }
.anno svg { display: block; }
.anno circle { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; }
.anno path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.anno span { opacity: 0; }
.station__tile.is-drawn .anno path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s var(--ease); }
.station__tile.is-drawn .anno span { opacity: 1; transition: opacity 0.2s var(--ease) 0.9s; }
/* Below 560px the tile is under ~445px, so the fixed-size label must reach
   into the transcribe loop's transcript and footer; no band stays empty at
   that scale. The loop's own footer carries the same words. */
@media (max-width: 560px) { .station .anno { display: none; } }

/* One-line caption shown only when motion is off: nothing is lost with the loop paused. */
.station__rmcap {
  display: none;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
}

/* ============ The pegboard ============ */
.pegboard-band {
  margin-top: 96px;
  padding: 96px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='1.5' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
}
.pegboard__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.peg-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.peg-slot { position: relative; min-width: 0; }
.peg-slot--actions { grid-column: 1 / 9; }
.peg-slot--empty { grid-column: 9 / 13; }
.peg-slot:nth-child(3) { grid-column: 1 / 5; }
.peg-slot:nth-child(4) { grid-column: 5 / 9; }
.peg-slot:nth-child(5) { grid-column: 9 / 13; }

/* The painted silhouette behind a lifted tool: a dashed outline at the resting
   position, revealed while the tile hovers 3px up. */
.peg-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.peg-slot:hover::before { opacity: 1; }
.peg-slot--empty::before { display: none; }

.peg-tile {
  position: relative;
  height: 100%;
  background: #000000;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease);
}
.peg-slot:hover .peg-tile { transform: translateY(-3px); }

/* Spotlight border: a radial highlight riding the hairline, fed by --mx/--my. */
.peg-tile::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.35), transparent 70%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.peg-tile:hover::after { opacity: 1; }

.peg-tile__head { display: flex; align-items: center; gap: 8px; }
.peg-tile__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  color: rgba(255, 255, 255, 0.65);
}
.peg-tile__name {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.peg-tile__title {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}
.peg-tile__copy {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-mid);
  text-wrap: pretty;
}
/* The wide Actions tile: copy on top, the loop below. The loop is capped at
   its authored 560px CSS width so it paints at or below 1:1 device pixels
   (the intrinsic asset is 1120x640 at DPR 2); wider would soften the type. */
.peg-tile--actions {
  gap: 24px;
}
.peg-tile--actions .peg-tile__text { min-width: 0; }
.peg-tile--actions .peg-tile__side { min-width: 0; }
.peg-tile__loop {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 8px; /* nested: outer 16 minus the 24 gap clamps to the small step */
  overflow: hidden;
  background: #000000;
  aspect-ratio: 7 / 4;
}
.peg-tile__loop video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The empty hook keeps its own height instead of stretching to the tall
   Actions tile beside it: about the row-2 tile height, caption centered. */
.peg-slot--empty { align-self: start; }
.peg-empty {
  height: 280px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  display: grid;
  place-items: center;
  padding: 24px;
}
.peg-empty__cap {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
  text-align: center;
}

/* Small replica fragments inside compact tiles */
.frag {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(220, 228, 245, 0.06);
}
.peg-tile__copy + .frag { margin-top: 16px; }
.frag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text);
}
.frag-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frag-text.mono { font-size: 11px; }
.frag-text--muted { color: var(--text-faint); font-family: var(--mono); font-size: 11px; }
.frag-age { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.frag-state { font-family: var(--mono); font-size: 10.5px; color: var(--text-mid); }
.frag-state--ok { color: #30D158; }
.frag-state--bad { color: #FF453A; }

/* ============ Workshop rules ============ */
.rules { padding-top: 96px; }
.rules__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.rules__main { grid-column: 1 / 8; max-width: 560px; min-width: 0; }
.rules__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.rules__body {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-mid);
  text-wrap: pretty;
}
.rules__labels {
  grid-column: 9 / 13;
  margin: 0;
  align-self: start;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 24px;
  color: var(--text-mid);
}

/* The network ledger */
.ledger {
  margin-top: 48px;
  max-width: 680px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
}
.ledger__title {
  margin: 0 0 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.ledger__table { margin: 0; }
.ledger__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--hairline-soft);
}
.ledger__row dt { margin: 0; color: var(--text); }
.ledger__row dd { margin: 0; color: var(--text-mid); }
.ledger__end {
  margin: 16px 0 0;
  color: var(--text-dim);
}

/* ============ Questions ============ */
.questions { padding-top: 96px; }
.questions__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 880px;
  margin-top: 32px;
}
.qa__q {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--text);
}
.qa__a {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-mid);
  text-wrap: pretty;
}

/* ============ Download ============ */
.download {
  max-width: 600px;
  margin: 0 auto;
  padding: 96px 24px 0;
  text-align: center;
}
.download__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
.download .cta-block { margin-top: 24px; }

/* Parts list plate */
.parts {
  max-width: 400px;
  margin: 48px auto 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
}
.parts__title {
  margin: 0 0 12px;
  letter-spacing: 0.08em;
  color: var(--text-mid);
}
.parts__row {
  display: grid;
  grid-template-columns: 24px 128px 1fr;
  gap: 12px;
  padding: 4px 0;
}
.parts__qty { color: var(--text-dim); }
.parts__item { color: var(--text); }
.parts__note { color: var(--text-mid); }

/* ============ Sticky pill CTA ============ */
.sticky-pill {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 180px;
  height: 38px;
  border-radius: 19px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(8, 10, 16, 0.5);
  transform: translate(-50%, -48px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.4, 1), opacity 0.3s var(--ease), visibility 0s linear 0.5s, border-color 0.2s var(--ease);
}
.sticky-pill.is-shown {
  transform: translate(-50%, 12px);
  opacity: 1;
  visibility: visible;
  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.4, 1), opacity 0.3s var(--ease), border-color 0.2s var(--ease);
}
.sticky-pill:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.22); }
/* transform is not additive, so the docked translate repeats here. */
.sticky-pill:active { transform: translate(-50%, 12px) scale(0.97); }
@media (max-width: 860px) { .sticky-pill { display: none; } }

/* ============ Footer: the title block ============ */
.titleblock {
  margin-top: 96px;
  margin-bottom: 48px;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  border: 1px solid var(--hairline);
}
.titleblock__cell {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-left: 1px solid var(--hairline);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
}
.titleblock__cell:first-child { border-left: none; }
/* Drawing-frame stamps are decorative and stay faint on purpose. */
.titleblock__cell--stamp {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.titleblock__cell--spacer { flex: 1; padding: 0; }
.titleblock__link { font-size: 12px; }
@media (max-width: 700px) {
  .titleblock__cell--stamp, .titleblock__cell--spacer { display: none; }
  .titleblock__cell--credit { flex: 1; }
}

/* ============ Simple pages (privacy, 404) ============ */
.page {
  max-width: 680px;
  padding-top: 96px;
  padding-bottom: 96px;
}
.page h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page p {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-mid);
  text-wrap: pretty;
}
.page .ledger { margin-top: 32px; }
.page--404 { text-align: center; }
.page--404 .cta-block { margin-top: 32px; }
.pill-static {
  width: 180px;
  height: 38px;
  margin: 0 auto 32px;
  border-radius: 19px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(8, 10, 16, 0.35);
}

/* ============ Scroll reveals ============ */
.reveal-init {
  opacity: 0;
  transform: translateY(64px);
  filter: blur(8px);
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .station { display: block; margin-top: 64px; }
  .station__copy, .station--2 .station__copy { padding-top: 24px; }
  .station--2 { display: flex; flex-direction: column-reverse; }
  .peg-grid { display: block; }
  .peg-slot { margin-top: 16px; }
  .peg-slot:first-child { margin-top: 0; }
  .peg-slot--empty .peg-empty { height: auto; min-height: 96px; }
  .rules__grid { display: block; }
  .rules__labels { margin-top: 16px; }
  .qa-grid { grid-template-columns: 1fr; }
  .ledger__row { grid-template-columns: 110px 1fr; }
}
@media (min-width: 561px) and (max-width: 860px) {
  .peg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .peg-slot, .peg-slot--actions, .peg-slot--empty,
  .peg-slot:nth-child(3), .peg-slot:nth-child(4), .peg-slot:nth-child(5) { grid-column: auto; margin-top: 0; }
  .peg-slot--actions { grid-column: 1 / -1; }
  /* In the two-column grid the hook pairs with a tile of its own height class,
     so it may stretch to match its row again. */
  .peg-slot--empty { align-self: stretch; }
  .peg-slot--empty .peg-empty { height: 100%; }
}

/* ============ Reduced motion: the complete page ============ */
@media (prefers-reduced-motion: reduce) {
  .reveal-init { opacity: 1 !important; transform: none !important; filter: none !important; }
  /* Leader lines render fully drawn, labels visible. */
  .leader path { stroke-dashoffset: 0 !important; transition: none !important; }
  .leader circle { transform: scale(1) !important; transition: none !important; }
  .leader text { opacity: 1 !important; transition: none !important; }
  /* Tile annotations sit where the native video controls draw; the rmcap
     caption below each poster carries the same content. */
  .anno { display: none !important; }
  /* Loops never play; posters show; the caption keeps the story. */
  .station__rmcap { display: block; }
  .sticky-pill { display: none !important; }
  .ms-spinner { animation: none !important; }
  /* Keep color and border feedback; drop transforms and slide motion. */
  .cta, .tab-btn, .panel__close, .mock, .peg-tile, .app-icon .l-gear, .island__open { transition: none !important; }
  .cta:hover, .cta:active, .tab-btn:active, .panel__close:active, .sticky-pill:active, .island__open:active { transform: none !important; }
  .peg-slot:hover .peg-tile { transform: none !important; }
  .app-icon--lg:hover .l-gear { transform: none !important; }
  .mock, .mock.is-active { transform: none !important; }
  .hero__copy h1, .hero__copy h1.h1-start { font-variation-settings: 'wght' 600 !important; transition: none !important; }
}
