/* MatDrone chrome — preloader, nav, mobile menu, hero HUD, footer. Owned by CHROME.
   Prefixes: pre-, nav-, menu-, hero-, hud- (base owns .hud-frame itself), foot-.
   Only tokens for colour/font/radius/easing. Nothing hidden unless a JS-set class is present. */

/* ============================================================ PRELOADER */
/* JS dead → never shown (html.js is set before first paint, so no flash). */
.pre { display: none; }
html.js .pre {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: var(--z-preloader);
  background: var(--bg);
  color: var(--fg);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out), visibility 0s linear var(--t-slow);
}
html.js body.pre--done .pre {
  opacity: 0;
  transform: translateY(-3%);
  visibility: hidden;
  pointer-events: none;
}
.pre__in {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  width: min(100% - 2 * var(--gutter), 22rem);
}
.pre__mark { width: 3rem; height: 3rem; flex: none; color: var(--fg); }
/* The logo JPG has a black ground; "screen" drops it into the page background */
.pre__logo { width: min(26rem, 82vw); height: auto; mix-blend-mode: screen; }
.pre__in { width: min(100% - 2 * var(--gutter), 26rem); }
.hero-kicker__sep { color: var(--accent); }
.foot-hero { margin: 0 auto clamp(1rem, 3vw, 2rem); width: min(100%, 44rem); }
.foot-hero img { width: 100%; height: auto; mix-blend-mode: screen; }
.pre__readout {
  display: flex;
  align-items: baseline;
  gap: 0.1em;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.pre__num { font-size: clamp(2.5rem, 8vw, 4.5rem); font-weight: 500; }
.pre__pct { font-size: 1.25rem; color: var(--fg-3); }
.pre__bar {
  width: 100%;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.pre__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s linear;
}

/* ============================================================ NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  /* functional scrim only — no glassmorphism */
  background: linear-gradient(to bottom, rgba(var(--bg-rgb), 0.72), rgba(var(--bg-rgb), 0));
  transition: transform var(--t) var(--ease-out);
}
.nav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--line);
  opacity: 0;
  transition: opacity var(--t) var(--ease-out);
}
/* chrome.js: solid once scrolled, tucked away while scrolling down */
.nav--solid { background: var(--bg); }
.nav--solid::after { opacity: 1; }
.nav--hidden { transform: translateY(-100%); }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}
.nav__logo { flex: none; }

.nav__links { display: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color var(--t-fast) var(--ease-out);
}
@media (hover: hover) { .nav-link:hover { color: var(--fg); } }
.nav-link--on { color: var(--accent); }

.nav__cta { display: none; }
/* scoped touch-target lift: base .btn--sm is 40px; bring to 44px on touch devices */
.nav__cta .btn--sm { min-height: 2.75rem; }

.nav__burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  flex: none;
}
.nav__burger-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--fg);
  transition: transform var(--t) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}

@media (min-width: 600px) {
  .nav__cta { display: block; }
}
@media (min-width: 900px) {
  .nav__links { display: flex; align-items: center; gap: 0.25rem; }
  .nav__burger { display: none; }
}

/* ============================================================ MOBILE MENU */
.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t) var(--ease-out), visibility 0s linear var(--t);
}
.menu--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--t) var(--ease-out);
}
.menu__inner {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--nav-h) + 1rem) 3rem;
}
.menu__close {
  position: absolute;
  top: calc((var(--nav-h) - 44px) / 2);
  right: var(--gutter);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.menu__close-bar {
  position: absolute;
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--fg);
}
.menu__close-bar:nth-child(1) { transform: rotate(45deg); }
.menu__close-bar:nth-child(2) { transform: rotate(-45deg); }

.menu__nav { display: grid; gap: 0.15rem; }
.menu-link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-height: 44px;
  padding-block: 0.35rem;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 9vw, 3.75rem);
  line-height: 1;
  color: var(--fg);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.menu--open .menu-link { opacity: 1; transform: none; }
.menu--open .menu-link:nth-child(1) { transition-delay: 0.08s; }
.menu--open .menu-link:nth-child(2) { transition-delay: 0.13s; }
.menu--open .menu-link:nth-child(3) { transition-delay: 0.18s; }
.menu--open .menu-link:nth-child(4) { transition-delay: 0.23s; }
.menu--open .menu-link:nth-child(5) { transition-delay: 0.28s; }
.menu--open .menu-link:nth-child(6) { transition-delay: 0.33s; }
.menu-link__idx {
  font-family: var(--font-mono);
  font-stretch: 100%;
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--accent);
}
.menu-link--on { color: var(--accent); }

.menu__foot {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out);
}
.menu--open .menu__foot { opacity: 1; transform: none; transition-delay: 0.42s; }
.menu__cta { justify-self: start; }
.menu__mail a { color: var(--fg-2); transition: color var(--t-fast) var(--ease-out); }
@media (hover: hover) { .menu__mail a:hover { color: var(--fg); } }

/* ============================================================ HERO */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 4rem));
  padding-bottom: clamp(4rem, 10vw, 7rem);
  overflow: hidden;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(var(--bg-rgb), 0.88) 0%, rgba(var(--bg-rgb), 0.42) 38%, rgba(var(--bg-rgb), 0.08) 68%, transparent 100%);
}
/* .wrap supplies the gutter and max width; the copy keeps to the left half so the drone owns the right. */
.hero-inner { position: relative; z-index: 2; }
.hero-copy {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  justify-items: start;
}
.hero-kicker { display: inline-flex; align-items: center; gap: 0.6em; }
.hero-title { margin: 0; font-size: clamp(2.35rem, 6.1vw, 7.5rem); }
/* line mask for the intro rise; padding/margin trick keeps descenders uncropped */
.hero-title__line {
  display: block;
  overflow: hidden;
  padding: 0.06em 0.08em 0.18em;
  margin: -0.06em -0.08em -0.18em;
}
.hero-title__in { display: block; will-change: transform; }
.hero-lead { margin-top: 0.35rem; }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

/* ---- Hero intro animation (driven by chrome.js after preloader:done) ----
   Initial hidden state is gated on body.hero--prep, a class only JS adds. */
html.js body.hero--prep .hero-anim {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
html.js body.hero--prep .hero-title__in { transform: translateY(112%); }
html.js body.hero--in .hero-anim { opacity: 1; transform: none; }
html.js body.hero--in .hero-title__in { transform: none; }
/* stagger */
html.js body.hero--prep .hero-kicker { transition-delay: 0.05s; }
html.js body.hero--prep .hero-title__line:nth-child(1) .hero-title__in { transition-delay: 0.15s; }
html.js body.hero--prep .hero-title__line:nth-child(2) .hero-title__in { transition-delay: 0.25s; }
html.js body.hero--prep .hero-title__line:nth-child(3) .hero-title__in { transition-delay: 0.35s; }
html.js body.hero--prep .hero-title__line:nth-child(4) .hero-title__in { transition-delay: 0.45s; }
html.js body.hero--prep .hero-lead { transition-delay: 0.5s; }
html.js body.hero--prep .hero-cta { transition-delay: 0.65s; }

html.js body.hero--prep .hero-hud {
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}
html.js body.hero--in .hero-hud { opacity: 1; transition-delay: 0.8s; }

@media (prefers-reduced-motion: reduce) {
  html.js body.hero--prep .hero-anim,
  html.js body.hero--prep .hero-title__in { transform: none; }
}

/* ---- HUD readouts (decorative, aria-hidden) ---- */
.hero-hud {
  position: absolute;
  inset: clamp(0.75rem, 2vw, 1.75rem);
  top: calc(var(--nav-h) + 0.5rem); /* clear the fixed nav */
  z-index: 2;
  pointer-events: none;
}
.hud-cluster {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
}
.hud-cluster--tl { top: 0; left: 0; }
.hud-cluster--tr { top: 0; right: 0; justify-content: flex-end; }
.hud-cluster--br { bottom: 0; right: 0; justify-content: flex-end; }
.hud-cell { display: inline-flex; align-items: baseline; gap: 0.45em; }
.hud-k.label { color: var(--fg-3); }
.hud-cell .mono { font-size: var(--fs-label); color: var(--fg); }
.hud-u { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--fg-3); }
.hud-rec { display: inline-flex; align-items: center; gap: 0.45em; }

.hud-cluster { padding: 0.9rem 1rem; }
/* Short screens (landscape phones, small windows): the copy needs the height, so drop the readouts */
@media (max-height: 560px) {
  .hero .hud-cluster, .hero .hero-cue { display: none; }
}
@media (max-width: 599px) {
  .hud-cluster--tl, .hud-cluster--br { display: none; }
  .hero .hero-cue { display: none; }
}

/* ---- Scroll cue ---- */
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 3vw, 2rem);
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  pointer-events: none;
  transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out);
}
.hero-cue--hidden { opacity: 0; transform: translate(-50%, 10px); }
.hero-cue__line {
  width: 1px;
  height: 2.75rem;
  background: linear-gradient(to bottom, var(--fg-2), transparent);
  transform-origin: top;
  animation: hero-cue-drop 2.2s var(--ease-in-out) infinite;
}
@keyframes hero-cue-drop {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.2) translateY(2.2rem); opacity: 0; }
}

/* ============================================================ FOOTER */
.footer { padding-top: clamp(3rem, 7vw, 6rem); }
.foot-inner { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.foot-top {
  display: grid;
  gap: 2.5rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.foot-brand { display: grid; gap: 1rem; align-content: start; max-width: 32ch; }
.foot-tag { color: var(--fg-2); }

.foot-nav, .foot-social, .foot-contact { display: grid; gap: 0.25rem; align-content: start; }
.foot-social__label, .foot-contact__label { margin-bottom: 0.5rem; }
.foot-nav__link,
.foot-social__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  color: var(--fg-2);
  transition: color var(--t-fast) var(--ease-out);
}
@media (hover: hover) {
  .foot-nav__link:hover,
  .foot-social__link:hover { color: var(--fg); }
}
.foot-social__icon { width: 1.1rem; height: 1.1rem; flex: none; color: var(--fg-3); }
.foot-social__link:hover .foot-social__icon { color: var(--accent); }
.foot-mail {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
}

.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
}
.foot-bottom .small { color: var(--fg-3); }

@media (min-width: 900px) {
  .foot-top { grid-template-columns: 1.5fr 1fr 1.2fr 1fr; column-gap: var(--gap); }
}
