/* =========================================================
   Hallucination Media — One-Page Site
   Dark, editorial, architectural. The work is the identity.
========================================================= */

:root {
  --bg: #0a0a0b;
  --bg-alt: #131315;
  --bg-raised: #18181b;
  --fg: #f3f1ec;
  --fg-dim: #a8a49c;
  --fg-faint: #6b675f;
  --accent: #d99a52;
  --accent-dim: #8a6a45;
  --line: rgba(243, 241, 236, 0.12);
  --line-strong: rgba(243, 241, 236, 0.22);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1400px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: hidden; /* mobile browsers often scroll html, not body — body's
    own overflow-x:hidden below doesn't reliably clip that root scroller */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 6vw;
}

.section-index {
  display: block;
  font-family: var(--font-body);
  font-size: 0.98rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  --stagger: 0;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--stagger) * 0.09s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance for grouped items */
.feature-text > *:nth-child(1),
.collab-text > *:nth-child(1) { --stagger: 0; }
.feature-text > *:nth-child(2),
.collab-text > *:nth-child(2) { --stagger: 1; }
.feature-text > *:nth-child(3),
.collab-text > *:nth-child(3) { --stagger: 2; }
.feature-text > *:nth-child(4),
.collab-text > *:nth-child(4) { --stagger: 3; }
.collab-text > *:nth-child(5) { --stagger: 4; }

.gallery-item:nth-child(1) { --stagger: 0; }
.gallery-item:nth-child(2) { --stagger: 1; }
.gallery-item:nth-child(3) { --stagger: 2; }

.capability-group:nth-child(1) { --stagger: 0; }
.capability-group:nth-child(2) { --stagger: 1; }
.capability-group:nth-child(3) { --stagger: 2; }
.capability-group:nth-child(4) { --stagger: 3; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1.1rem 2.2rem;
  border: 1px solid var(--line-strong);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}
.btn-primary {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}

/* ---------- Placeholder media (swap for real photo/video) ----------
   Always lives inside an overflow-hidden "frame" (.hero-media,
   .feature-media, .gallery-item). Sized larger than its frame so the
   scroll-parallax transform (applied via JS to [data-parallax]) has
   room to move without exposing an edge. The buffer grows width AND
   height in the SAME proportion as the frame's own aspect ratio (not
   height-only) — growing only one dimension changes the box's aspect
   ratio away from the frame/source-image ratio, which forces
   object-fit:cover to crop the sides to compensate, making correctly
   4:3-cropped photos look zoomed/over-cropped. Pixel amounts are sized
   to main.js's strengthFor() (max translateY travel = strength * 2px)
   per context. Default below assumes a 4:3 frame (collab-media, the
   only context currently using the un-overridden default; strength 24). */
.placeholder-media {
  position: absolute;
  top: -24px;
  left: -32px;
  width: calc(100% + 64px);
  max-width: none; /* overrides the global `img, video { max-width: 100% }` reset, which
    would otherwise clamp this deliberately oversized box back down and reintroduce the
    aspect-ratio distortion (crop) this sizing is meant to avoid — see comment above. */
  height: calc(100% + 48px);
  background:
    radial-gradient(120% 140% at 15% 15%, rgba(217, 154, 82, 0.16), transparent 55%),
    linear-gradient(155deg, #1c1c1f 0%, #101012 55%, #0a0a0b 100%);
  overflow: hidden;
  will-change: transform;
  object-fit: cover; /* takes effect once this class is used on an <img>/<video> */
}
/* 4:3 frames — width buffer = height buffer * 4/3 to preserve aspect ratio.
   strength 40 (feature-media) / strength 16 (gallery-item), see main.js strengthFor(). */
.feature-media .placeholder-media { top: -40px; left: -53px; width: calc(100% + 107px); height: calc(100% + 80px); }
.gallery-item .placeholder-media { top: -16px; left: -21px; width: calc(100% + 43px); height: calc(100% + 32px); }
.placeholder-media::before {
  content: attr(data-label);
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(243, 241, 236, 0.38);
  border-top: 1px solid rgba(243, 241, 236, 0.14);
  padding-top: 0.6rem;
  z-index: 2;
}
.placeholder-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(243,241,236,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243,241,236,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(120% 120% at 50% 50%, black, transparent 75%);
}
.grain {
  position: absolute;
  inset: -20%;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Frames: fixed-size, clip the oversized .placeholder-media inside them */
.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero-video {
  position: absolute;
  top: -12%;
  left: 0;
  width: 100%;
  height: 124%;
  object-fit: cover;
  will-change: transform;
}
.hero-media .placeholder-media::before {
  bottom: 3rem;
  left: 6vw;
  right: auto;
  max-width: 420px;
}
.feature-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  pointer-events: none;
}

/* ---------- Featured Work slideshow (auto crossfade, no UI chrome) ---------- */
.slideshow {
  position: absolute;
  inset: 0;
}
.slide {
  opacity: 0;
  transition: opacity 1.4s var(--ease);
  z-index: 0;
}
.slide.is-active {
  opacity: 1;
  z-index: 1;
}
.slideshow > .grain {
  z-index: 2;
}

/* ---------- Media reveal (clip-path wipe) ----------
   IMPORTANT: .media-reveal must NEVER sit on the same element that carries
   .reveal (the one IntersectionObserver actually observes). Chromium has a
   bug where an element clipped to zero visible area via clip-path permanently
   reports zero IntersectionObserver overlap for ITSELF, even once scrolled
   fully into view — so the observed element would never gain .is-visible and
   the clip-path would never open (a permanent deadlock). Instead, .media-reveal
   goes on a child of the observed .reveal element, and opens once its PARENT
   is marked visible. Clip-path on a child does not affect the parent's own
   intersection reporting. */
.media-reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.15s var(--ease);
  transition-delay: calc(var(--stagger, 0) * 0.09s);
}
.reveal.is-visible .media-reveal {
  clip-path: inset(0 0 0% 0);
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 1.1rem 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: marqueeScroll 30s linear infinite;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--fg-dim);
}
/* No gap at the track level — the two .marquee-set copies must be exactly
   adjacent and exactly equal width for translateX(-50%) to land seamlessly
   on the boundary between them. */
.marquee-set {
  display: flex;
  align-items: center;
  flex: none;
  gap: 2.5rem;
  padding-right: 2.5rem;
}
.marquee-track span { flex: none; }
.marquee-dot { color: var(--accent); font-family: var(--font-body); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Magnetic buttons ---------- */
.magnetic {
  transition: transform 0.35s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.8rem 6vw;
  background: transparent;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(10, 10, 11, 0.86);
  backdrop-filter: blur(10px);
  padding: 1.1rem 6vw;
  border-bottom: 1px solid var(--line);
}
.nav-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  font-weight: 500;
}
.nav-mark-icon {
  flex: none;
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
}
.nav-links a:hover { color: var(--fg); }
.nav-links .nav-cta {
  color: var(--fg);
  border: 1px solid var(--line-strong);
  padding: 0.6rem 1.2rem;
}
.nav-links .nav-cta:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle {
  display: none;
  width: 26px; height: 20px;
  background: none; border: none;
  position: relative;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--fg);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span { top: 9px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,10,11,0.94) 0%, rgba(10,10,11,0.55) 42%, rgba(10,10,11,0.25) 65%, rgba(10,10,11,0.55) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 6vw 8rem;
  max-width: 900px;
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
  transition-delay: 0.05s;
}
.hero-headline {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 1.04;
  margin-bottom: 1.8rem;
  transition-delay: 0.15s;
}
.hero-copy {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: var(--fg-dim);
  max-width: 560px;
  margin-bottom: 2.4rem;
  font-weight: 300;
  transition-delay: 0.25s;
}
.hero-content .btn { transition-delay: 0.35s; }

.scroll-cue {
  position: absolute;
  right: 6vw;
  bottom: 3rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, var(--fg-faint), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ---------- About ---------- */
.about {
  padding: 9rem 0;
  border-top: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 6vw;
}
.about-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.14;
}
.about-body p {
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  color: var(--fg-dim);
  max-width: 46ch;
}
.about-body p + p { margin-top: 1.4rem; }

/* ---------- Featured Work ---------- */
.featured-work {
  padding-top: 5rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--line);
}
.featured-work > .section-inner { margin-bottom: 2rem; }

.feature-project {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
  gap: 5vw;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 6vw 7rem;
}
.feature-reverse { direction: rtl; }
.feature-reverse .feature-text { direction: ltr; }
.feature-reverse .feature-media { direction: ltr; }

.feature-text {
  padding: 0;
}
.feature-text h3 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.feature-subtitle {
  font-size: 1.05rem;
  color: var(--fg);
  font-weight: 400;
  margin-bottom: 1.4rem;
  max-width: 40ch;
}
.feature-copy {
  color: var(--fg-dim);
  max-width: 46ch;
  font-size: 0.98rem;
}

/* ---------- Gallery ---------- */
.gallery {
  padding: 9rem 0;
  border-top: 1px solid var(--line);
}
/* Three explicit rows (2 / 3 / 2). Each row's tiles stretch to fill the
   full container width evenly, so the 2-up rows are naturally larger and
   the 3-up row is naturally smaller — same total width per row, not the
   same tile size across rows. */
.gallery-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 6vw;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  perspective: 1000px;
}
.gallery-row {
  display: flex;
  gap: 1.4rem;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 5px;
  aspect-ratio: 4 / 3;
  flex: 1 1 0;
  min-width: 0;
}
.gallery-item .placeholder-media::before { display: none; }

/* .tilt items get their transform driven by JS pointermove (cursor-tilt + hover-scale
   combined in one transform so they don't fight); .tilt-active disables the CSS
   transition while the pointer is moving so the tilt tracks the cursor immediately. */
.tilt {
  transition: transform 0.5s var(--ease);
  transform-style: preserve-3d;
}
.tilt.tilt-active { transition: none; }

.gallery-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem;
  background: linear-gradient(0deg, rgba(10,10,11,0.9) 0%, rgba(10,10,11,0) 55%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  pointer-events: none;
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Tiles with more than one photo (JS adds .has-multiple-slides once it
   counts >1 .slide) get a click-to-advance cursor as a subtle affordance;
   the click handler itself lives in main.js. */
.gallery-item.has-multiple-slides {
  cursor: pointer;
}
.gallery-category {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}
.gallery-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--fg);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

/* ---------- Capabilities ---------- */
.capabilities {
  position: relative;
  padding: 9rem 0;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(60% 70% at 15% 0%, rgba(217, 154, 82, 0.08), transparent 60%),
    radial-gradient(50% 60% at 100% 100%, rgba(217, 154, 82, 0.05), transparent 60%);
}
.capabilities-heading {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  max-width: 30ch;
  margin-top: 1rem;
}

/* Editorial grouping rather than a service grid — four disciplines, each a
   short list of plain-text titles. Descriptions stay collapsed until hovered
   (mouse) or tapped (touch, via .is-expanded toggled in main.js), keeping the
   resting state quiet and typographic. */
.capability-groups {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
}
.capability-group {
  border-left: 1px solid var(--line);
  padding-left: 1.8rem;
}
.capability-group:first-child {
  border-left: none;
  padding-left: 0;
}
.capability-group-label {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.capability-item-toggle {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  padding: 0.95rem 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.capability-group > .capability-item:first-child .capability-item-toggle {
  border-top: none;
  padding-top: 0;
}
.capability-item-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.3;
  color: var(--fg);
  transition: color 0.3s var(--ease);
}
.capability-item:hover .capability-item-title,
.capability-item.is-expanded .capability-item-title {
  color: var(--accent);
}
.capability-item-desc {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--fg-dim);
  font-size: 0.9rem;
  line-height: 1.55;
  transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), padding-bottom 0.5s var(--ease);
}
.capability-item:hover .capability-item-desc,
.capability-item.is-expanded .capability-item-desc {
  max-height: 220px;
  opacity: 1;
  padding-bottom: 1.3rem;
}

/* Project Integration is a single-item group — shown as a standalone
   statement rather than another collapsible item, so it doesn't repeat
   its own group label as a redundant hover target. */
.capability-standalone-desc {
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--fg);
}

/* ---------- Inline text links (Collaboration: Etch Pros / Stine) ---------- */
.text-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
}
.text-link:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* ---------- Collaboration ----------
   Framed entirely around Hallucination's multidisciplinary approach — not a
   two-person or two-company "team" split. Bryan's background and Etch Pros
   are supporting context inside the same block (no name-as-heading, no
   founder/owner language); Stine Custom Woodworks gets a short, clearly
   independent paragraph below with real (not faint) type weight so it reads
   as a genuine credit rather than an equal profile or a footnote. A raised
   background panel (var(--bg-alt)) distinguishes the section from its
   neighbors. */
.collaboration {
  padding: 8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.collaboration-heading {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  max-width: 26ch;
  margin-top: 1rem;
}
.collaboration-primary {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 6vw;
  align-items: start;
}
.collab-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}
/* This slideshow holds logo marks, not photos — the cover+oversize-buffer
   treatment above (built for photos) crops into a logo's intentional
   whitespace and reads as "zoomed in". Show logos uncropped instead. */
.collab-media .placeholder-media {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.collab-text p {
  color: var(--fg-dim);
  font-size: 0.98rem;
  max-width: 46ch;
}
.collab-text p + p { margin-top: 1.1rem; }
.collab-text p.collab-lede {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.4;
  max-width: 42ch;
}
.collab-text strong { color: var(--fg); font-weight: 500; }
.collab-text .text-link { display: inline-block; margin-top: 1.4rem; }

/* Stine mention: labeled and full body-text weight so it reads as a real
   credit, but still no card, border image, or heading of its own — kept
   visually secondary to the primary Hallucination block above. Sits
   mid-column (right after Etch Pros) rather than at the section's end. */
.collab-secondary {
  margin-top: 2.2rem;
  padding-top: 1.8rem;
  padding-bottom: 0.2rem;
  border-top: 1px solid var(--line);
  max-width: 46ch;
}
.collab-secondary-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 0.7rem;
}
.collab-secondary p {
  color: var(--fg-dim);
  font-size: 0.95rem;
}
.collab-secondary .text-link {
  color: var(--fg-dim);
  border-bottom-color: var(--line-strong);
}
.collab-secondary .text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.collab-secondary + p { margin-top: 1.8rem; }

/* ---------- Final CTA ---------- */
.final-cta {
  padding: 10rem 0 8rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.final-cta-inner { max-width: 720px; }
.final-cta h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 1.2rem;
}
.final-cta > .section-inner > p {
  color: var(--fg-dim);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.final-cta > .section-inner > p.final-cta-phone {
  font-size: 0.95rem;
  margin-bottom: 3.5rem;
}

.contact-form {
  text-align: left;
  display: grid;
  gap: 1.4rem;
}
/* Off-screen (not display:none — some spam bots skip hidden fields when
   deciding what to fill in) so real visitors never see or tab into it. */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-row { display: flex; flex-direction: column; gap: 0.5rem; }
.form-row label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.form-row input,
.form-row textarea {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.9rem 1rem;
  resize: vertical;
  transition: border-color 0.3s var(--ease);
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form .btn { justify-self: start; margin-top: 0.5rem; border: none; cursor: pointer; }
.form-status {
  font-size: 0.85rem;
  color: var(--fg-dim);
  min-height: 1.2em;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.footer-links a:hover { color: var(--accent); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.78rem;
  color: var(--fg-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .collaboration-primary {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .collab-media { max-width: 380px; }
  .feature-project, .feature-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    min-height: auto;
    gap: 2rem;
    padding: 4rem 6vw;
  }
  .feature-text { padding: 0; }
  .capability-groups { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 2rem; }
  .capability-group:nth-child(odd) { border-left: none; padding-left: 0; }
  .capability-group:nth-child(even) { border-left: 1px solid var(--line); padding-left: 1.8rem; }
}

/* Nav switches to the off-canvas menu earlier than the other mobile rules —
   at ~700-900px the inline nav-links row (5 items + logo) doesn't have
   enough room and wraps ungracefully otherwise. */
@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--bg-alt);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 2.4rem;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    border-left: 1px solid var(--line);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: block; z-index: 101; }
}

@media (max-width: 640px) {
  .capability-groups { grid-template-columns: 1fr; gap: 2.5rem; }
  .capability-group,
  .capability-group:nth-child(odd),
  .capability-group:nth-child(even) { border-left: none; padding-left: 0; }
  .gallery-row { flex-direction: column; }
  .gallery-item { flex: none; width: 100%; }
  .hero-media .placeholder-media::before { display: none; }
}
