/* ============================================================
   AGRAMON PERFORMANCE — Components  (LIGHT / showroom theme)
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  position: relative; display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--btn-bg); color: var(--text); overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              color 0.35s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease);
  isolation: isolate;
}
.btn:hover { transform: translateY(-2px); }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn--primary {
  --btn-bg: var(--orange); color: #fff; border-color: var(--orange);
}
.btn--primary:hover {
  background: var(--orange-bright); border-color: var(--orange-bright);
  box-shadow: 0 12px 34px -12px var(--orange);
}
.btn--ghost { background: rgba(17,17,20,0.03); }
.btn--ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--gutter);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(255,255,255,0.8); backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--line); padding-block: var(--s-3);
}
.brand {
  font-family: var(--font-display); font-size: 1.45rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); white-space: nowrap;
}
.brand b { color: var(--orange); }
.nav__links { display: flex; align-items: center; gap: var(--s-5); }
.nav__links a {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-dim); position: relative; padding-block: 0.3rem; transition: color 0.3s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--orange); transition: width 0.35s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { width: 100%; }
.nav__cta { display: flex; align-items: center; gap: var(--s-3); }
.nav__burger { display: none; }
/* CTA injected into the open mobile menu (main.js); hidden on desktop */
.nav__menu-cta { display: none; }

/* ---------- HERO — scroll-rotating Shelby (constant-velocity glide) ---------- */
/* EXACTLY one screen — no glide gap. A taller hero made the stage glide up and
   reveal a grey band beneath it; the truck's studio floor met that flat grey at a
   hard horizontal line (the "line"). At 100svh the truck stage butts the engine
   directly (no grey void), so it flows straight into the engine's soft grey
   top-fade — no wash, no gap, no line. */
.hero { position: relative; height: 100svh; background: var(--studio, #BCBCBE); }
.hero__stage {
  position: absolute; top: 0; left: 0; width: 100%; height: 100svh; overflow: hidden;
  display: grid; place-items: center; background: var(--studio, #BCBCBE);
}
/* truck frame sequence — grey studio bg blends straight into --studio */
.hero__canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
/* SCROLL-ACTIVATED floor fade. The footage's studio floor is DARK (~72) while the
   page/engine scene is light grey (~189); a dark edge meeting light grey is always
   a hard line. A permanent fade fixes the line but leaves a visible grey band at
   rest (the thing you kept seeing). So this fade is INVISIBLE at rest
   (opacity:var(--floorfade,0) = 0 at the top of the page) and ramps on only as you
   scroll into the handoff — JS drives --floorfade 0→1 over the first ~18% of scroll.
   Result: clean truck at rest, dark floor dissolves into grey during the transition
   (no hard line), no static band. */
.hero__stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; z-index: 1; height: 32%;
  opacity: var(--floorfade, 0); will-change: opacity;
  background: linear-gradient(to bottom,
    rgba(var(--studio-rgb),0)    0%,
    rgba(var(--studio-rgb),0)    50%,
    rgba(var(--studio-rgb),0.35) 72%,
    rgba(var(--studio-rgb),0.72) 84%,
    rgba(var(--studio-rgb),0.95) 92%,
    rgba(var(--studio-rgb),1)    96%,
    rgba(var(--studio-rgb),1)    100%);
  pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 2; text-align: center;
  max-width: 1000px; padding-inline: var(--gutter); will-change: opacity, transform;
}
/* soft light halo so ink text reads over the dark truck */
.hero__inner::before {
  content: ""; position: absolute; inset: -45% -25%; z-index: -1;
  background: radial-gradient(58% 60% at 50% 50%,
    rgba(244,244,242,0.88), rgba(244,244,242,0.35) 46%, transparent 72%);
}
.hero__tag {
  display: inline-flex; gap: 0.7rem; align-items: center;
  font-family: var(--font-ui); font-weight: 700; font-size: var(--fs-eyebrow);
  letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--text-dim);
  margin-bottom: var(--s-2);
}
.hero__tag b { color: var(--orange); }
.hero__title { margin-block: 0.12em 0.32em; color: var(--text); }
.hero__sub { color: var(--text-dim); max-width: 46ch; margin: 0 auto var(--s-5); }
.hero__actions { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: var(--s-5); left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-faint);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.hero__scroll span { width: 1px; height: 38px; background: linear-gradient(var(--orange), transparent);
  animation: scrollPulse 2s var(--ease) infinite; }
@keyframes scrollPulse { 0%,100% { opacity: .3; transform: scaleY(.6);} 50% { opacity: 1; transform: scaleY(1);} }

/* ---------- ENGINE — scroll-exploding engine (page 2, mirrors hero) ---------- */
/* ENGINE — real supercharged-V8 turntable rotation. Now its OWN section AFTER the
   statement (page 3) for breathing room. It's a grey studio panel living in the
   white page: it SCROLLS THROUGH the viewport while spinning (starts the moment
   it's visible, never pinned — mirrors the truck), and its top + bottom edges fade
   to the page white so it materialises and dissolves cleanly into the content
   around it. (Engine edges are uniform mid-grey, so grey->white fades are clean —
   none of the truck's dark-floor seam problem.) */
.engine { position: relative; height: 100svh; background: var(--bg); }
.engine__stage {
  position: relative; width: 100%; height: 100svh; overflow: hidden;
  display: grid; place-items: center; background: var(--bg);
}
.engine__canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
/* TOP edge fades to page white — grey studio emerges from the page as it rises in */
.engine__stage::before {
  content: ""; position: absolute; inset: 0 0 auto 0; z-index: 1; height: 16%;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(244,244,242,0) 100%);
  pointer-events: none;
}
/* BOTTOM edge fades to page white — dissolves into the section below as it leaves */
.engine__stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; z-index: 1; height: 16%;
  background: linear-gradient(to top, var(--bg) 0%, rgba(244,244,242,0) 100%);
  pointer-events: none;
}
.engine__inner {
  position: relative; z-index: 2; text-align: center;
  max-width: 1000px; padding-inline: var(--gutter); will-change: opacity, transform;
}
.engine__tag {
  display: inline-flex; gap: 0.7rem; align-items: center;
  font-family: var(--font-ui); font-weight: 700; font-size: var(--fs-eyebrow);
  letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--text-dim);
  margin-bottom: var(--s-2);
}
.engine__tag b { color: var(--orange); }
.engine__h {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: var(--track-display);
  font-size: clamp(2rem, 5vw, 4rem); line-height: 1.02; color: var(--text); margin: 0;
}
.engine__h em { font-style: normal; color: var(--orange); }

/* ---------- Statement band (replaces engine section) ---------- */
/* studio-grey -> page-white handoff as the engine zone ends (one clean fade) */
.statement { text-align: center; position: relative; }
.statement::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40svh; z-index: 0;
  background: linear-gradient(to bottom, var(--studio) 0%, rgba(var(--studio-rgb),0) 100%);
  pointer-events: none;
}
.statement > .container { position: relative; z-index: 1; }
.statement__h {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: var(--track-display);
  font-size: clamp(2rem, 5vw, 4rem); line-height: 1.02; max-width: 18ch; margin: var(--s-4) auto var(--s-2);
}
.statement__h em { font-style: normal; color: var(--orange); }
.statement p.lede { margin-inline: auto; }

/* ---------- Section header ---------- */
.sec-head { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-7); max-width: 60ch; }
.sec-head.center { align-items: center; text-align: center; margin-inline: auto; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.35rem); color: var(--text-dim); max-width: 52ch; }

/* ---------- Services grid ---------- */
.svc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
@media (max-width: 900px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .svc-grid { grid-template-columns: 1fr; } }
.svc {
  background: var(--bg-elev); padding: var(--s-6) var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
  transition: background 0.4s var(--ease); position: relative;
}
.svc:hover { background: #fff; }
.svc__num { font-family: var(--font-display); font-size: 1rem; color: var(--text-faint); letter-spacing: 0.1em; }
.svc h3 { font-size: 1.35rem; }
.svc p { color: var(--text-dim); font-size: 0.95rem; }
.svc__bar { height: 2px; width: 36px; background: var(--orange); transition: width 0.4s var(--ease); margin-top: auto; }
.svc:hover .svc__bar { width: 100%; }

/* ---------- Page header (sub-pages) ---------- */
.page-head { position: relative; padding-block: clamp(8rem, 16vw, 13rem) var(--section-y); text-align: center; overflow: hidden; }
.page-head::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 60% at 50% 0%, var(--orange-soft), transparent 60%), var(--bg); }
.page-head h1 { font-size: var(--fs-h1); }
.page-head p:not(.eyebrow) { color: var(--text-dim); max-width: 50ch; margin: var(--s-4) auto 0; }

/* ---------- Build cards ---------- */
.build-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--s-4); }
.build-card { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: var(--bg-elev-2); isolation: isolate; }
.build-card__img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.7s var(--ease); }
.build-card:nth-child(3n)   .build-card__img { background: linear-gradient(135deg, #d9d9d7, #bcbcba); }
.build-card:nth-child(3n+1) .build-card__img { background: linear-gradient(135deg, #cfcfcd, #a9a9a7); }
.build-card:nth-child(3n+2) .build-card__img { background: linear-gradient(135deg, #d2d2d0, #b3b3b1); }
.build-card:hover .build-card__img { transform: scale(1.06); }
.build-card__body { position: absolute; inset: auto 0 0 0; padding: var(--s-5); z-index: 1;
  background: linear-gradient(to top, rgba(12,13,16,0.86), transparent); color: #fff; }
.build-card__tag { font-size: var(--fs-eyebrow); letter-spacing: 0.2em; text-transform: uppercase; color: #fff; font-weight: 700; }
.build-card__tag::before { content: "● "; color: var(--orange); }
.build-card h3 { font-size: 1.5rem; margin-top: 0.3rem; color: #fff; }
.build-card.is-wide { grid-column: span 2; aspect-ratio: 16/9; }
@media (max-width: 720px) { .build-card.is-wide { grid-column: span 1; aspect-ratio: 4/3; } }

/* ---------- Gallery ---------- */
.gallery-grid { columns: 3 280px; column-gap: var(--s-4); }
.gallery-grid figure { break-inside: avoid; margin-bottom: var(--s-4); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.gallery-grid .ph { background: linear-gradient(135deg, #dededc, #c4c4c2); }
.gallery-grid .ph:nth-child(odd) { background: linear-gradient(135deg, #d4d4d2, #b8b8b6); }
.gallery-grid figure > div { width: 100%; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: var(--s-2); }
.field label { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--text); background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 0.9rem 1rem; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft);
}
.field textarea { min-height: 140px; resize: vertical; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-7); align-items: start; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.info-list { display: grid; gap: var(--s-4); }
.info-list div { border-left: 2px solid var(--orange); padding-left: var(--s-4); }
.info-list span { display: block; font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); }
.map-embed { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16/10; background: var(--bg-elev-2); }
.map-embed iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.2) contrast(1.02); }

/* prose / stats */
.prose { max-width: 62ch; }
.prose p { margin-bottom: var(--s-4); color: var(--text-dim); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-4); margin-top: var(--s-6); }
.stat { border-top: 1px solid var(--line-strong); padding-top: var(--s-3); }
.stat b { font-family: var(--font-display); font-size: 2.6rem; display: block; color: var(--text); }
.stat span { color: var(--text-faint); font-size: var(--fs-sm); }

/* ---------- Footer (ink block to ground the light page) ---------- */
.footer { background: var(--ink); color: var(--text-on-ink); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-6); padding-block: var(--s-8) var(--s-6); }
.footer h4 { font-family: var(--font-ui); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(244,244,242,0.45); margin-bottom: var(--s-4); }
.footer a { color: rgba(244,244,242,0.72); display: block; padding-block: 0.35rem; transition: color 0.3s var(--ease); }
.footer a:hover { color: var(--orange-bright); }
.footer .muted { color: rgba(244,244,242,0.55); }
.footer__brand { font-family: var(--font-display); font-size: 2.2rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-on-ink); }
.footer__brand b { color: var(--orange); }
.footer__bottom { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding-block: var(--s-4); border-top: 1px solid rgba(244,244,242,0.12); color: rgba(244,244,242,0.5); font-size: var(--fs-sm); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  /* trimmer header on phones (was a chunky ~99px from full padding + tall burger) */
  .nav { padding-block: var(--s-3); }
  .nav__burger { padding: 0.7rem 1.15rem; }
  .nav__links { display: none; }
  /* Mobile menu: the burger toggles .is-open (main.js); this reveals it as a
     dropdown panel under the fixed nav bar. .nav__links.is-open (0,2,0) outranks
     .nav__links (0,1,0) so display:flex wins over the display:none above. */
  .nav__links.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: var(--s-1);
    position: absolute; top: 100%; left: var(--gutter); right: var(--gutter);
    padding: var(--s-3) var(--s-4) var(--s-4);
    background: rgba(255,255,255,0.97); backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: 0 18px 50px -20px rgba(17,17,20,0.35);
  }
  /* full-row links with a comfortable >=44px touch target */
  .nav__links.is-open a {
    width: 100%; min-height: 44px; display: flex; align-items: center;
    padding-block: 0.3rem;
  }
  .nav__burger { display: inline-flex; }
  /* the bar carries only brand + burger on mobile; the CTA moves into the menu */
  .nav__cta .btn--primary { display: none; }
  .nav__links.is-open .nav__menu-cta {
    display: flex; justify-content: center; min-height: 48px;
    margin-top: var(--s-2); background: var(--orange); color: #fff;
    border-radius: var(--r-pill); font-family: var(--font-ui); font-weight: 700;
    font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  }
  .nav__links.is-open .nav__menu-cta::after { content: none; } /* kill link-underline pseudo */
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .btn { padding: 0.85rem 1.3rem; }
  /* tighter vertical rhythm on phones (section padding also trimmed in tokens.css) */
  .svc { padding: var(--s-5) var(--s-4); }
  .sec-head { margin-bottom: var(--s-5); }
}

/* ---------- MOBILE hero / engine: rotate in a full-width band ----------
   A wide vehicle shot cover-cropped into a tall phone screen showed only a
   cut-off middle slice. On touch we flow the stage as a column — headline/copy
   on top, the truck/engine rotating in a full-width 16:9 band below — so the
   WHOLE vehicle is visible while it still turns on scroll. Matches liteMotion
   in main.js (<=768px OR a coarse pointer). Desktop keeps the full-bleed hero. */
@media (max-width: 768px), (pointer: coarse) {
  .hero, .engine { height: auto; min-height: 100svh; }
  .hero__stage, .engine__stage {
    position: relative; top: auto; left: auto; height: auto; min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center; gap: var(--s-5);
    padding-block: 13svh 9svh;
  }
  .hero__canvas, .engine__canvas {
    position: relative; inset: auto; order: 2;
    width: 100%; height: auto; aspect-ratio: 16 / 9;
  }
  .hero__inner, .engine__inner { order: 1; }
  .hero__stage::after { display: none; } /* desktop floor-fade is for the full-bleed hero only */
}

/* ---------- CMS gallery media (content.js renders <img>/<video> into figures) ---------- */
.gallery-grid figure > img,
.gallery-grid figure > a > img,
.gallery-grid figure > video { width: 100%; height: auto; display: block; }

/* ---------- Social / TikTok feed (content.js renders embeds or a follow card) ---------- */
.tiktok-feed { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: center; }
.tiktok-feed .tiktok-embed { flex: 0 1 325px; margin: 0 !important; }
.tiktok-empty {
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-4);
  padding: clamp(2.5rem, 6vw, var(--s-8)) var(--s-5);
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.tiktok-empty p { color: var(--text-dim); font-size: clamp(1.05rem, 1.4vw, 1.25rem); max-width: 34ch; margin: 0; }
