/* ==========================================================================
   Marlex Projects — Design Tokens
   ========================================================================== */
:root {
  /* Brand colours */
  --color-primary: #0B151F;      /* deep navy/near-black — nav, footer, hero */
  --color-secondary: #063b64;    /* medium blue — section accents, gradients */
  --color-steel: #8B96A1;        /* brushed steel grey — from logo */
  --color-steel-light: #C7CFD6;  /* light steel — borders, muted text on dark */
  --color-accent: #C4913A;       /* bronze/amber — CTAs, highlights (dark bgs) */
  --color-accent-hover: #D9A64F;
  --color-accent-ink: #8A6528;   /* darkened amber — accent TEXT on light bgs.
                                    #C4913A only reaches 2.8:1 on white; this
                                    hits 5.3:1 on white / 4.8:1 on --color-light */
  --color-steel-dark: #5C6975;   /* muted text on light bgs — 5.5:1 on white */
  --color-light: #F3F5F7;        /* light section backgrounds */
  --color-white: #FFFFFF;
  --color-ink: #1A2530;          /* body copy on light backgrounds */

  /* Typography */
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Type scale. Fluid (clamp) for the heading tiers, where the gap between
     a 320px phone and a 1200px+ desktop is large enough to be worth
     smoothing; fixed rem for body copy, where research/WCAG guidance
     favours a stable, accessible minimum over continuous scaling. Body
     text never drops below 16px (1rem) — that's also the iOS Safari
     threshold below which focusing a field auto-zooms the page.
     Before this, H2 was one deliberate size in some places and an
     unstyled browser default in others (About's H2, all 3 CTA banners);
     H3 was five different values across five components for the same
     "card heading" role. This collapses both to one role-based size. */
  --fs-h2: clamp(1.5rem, 1rem + 1.5vw, 2rem);         /* primary section headings */
  --fs-h2-compact: clamp(1rem, 1rem + 0.7vw, 1.8rem);   /* repeated/list-style headings (portfolio type bands) */
  --fs-h3: 1.25rem;                                        /* card / subsection headings */
  --fs-h4: 1.05rem;                                        /* minor headings */
  --fs-body-lg: 1.05rem;                                   /* intro / lede paragraphs */
  --fs-body: 1rem;                                         /* standard paragraph text */
  --fs-small: 0.95rem;                                     /* secondary / meta text */

  /* Spacing / layout */
  --container-width: 1200px;
  --radius: 4px;
  --transition: 0.25s ease;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--color-primary);
}
/* Base sizes so no heading is left to the browser's unstyled default — that
   was the root cause of About's H2 and all 3 CTA-banner H2s rendering at an
   arbitrary size while sibling headings used a deliberate one. More specific
   selectors (.section-head h2, .service-card h3, etc.) still win on
   specificity, so this only fills genuine gaps. h1 isn't listed: every h1 on
   the site already has a dedicated hero/page-hero rule. */
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }
@media (max-width: 768px) {
  section { padding: 56px 0; }
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.9rem;
  color: var(--color-accent-ink);
  margin-bottom: 14px;
}
/* Bright amber is only legible over the dark sections. */
.bg-dark .section-label,
.hero-content .section-label,
.page-hero .section-label { color: var(--color-accent); }

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: var(--fs-h2); }
/* "How We Work" (the only .bg-dark section) — same reasoning as the CTA
   banners: this heading sits over a tight 4-step process grid, not a wide
   section of its own, so the full --fs-h2 read oversized. Fixed, not fluid,
   for the same "hold steady rather than scale up" effect. */
.bg-dark .section-head h2 { font-size: 1.8rem; }
.section-head p { color: #55606B; font-size: var(--fs-body-lg); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: all var(--transition);
}
.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary);
}
/* Inverts to an outline on hover. This is the site-wide behaviour for accent
   buttons — the nav CTA, hero, CTA banner and contact form all share it. */
.btn-accent:hover {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}
.btn-outline {
  border-color: rgba(255,255,255,0.5);
  color: var(--color-white);
}
.btn-outline:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-primary); }
.btn-outline-dark {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline-dark:hover { border-color: var(--color-accent-ink); color: var(--color-accent-ink); }
/* Accent buttons invert to an outline on hover; over light panels that outline
   needs the darkened amber to stay readable. */
.bg-light .btn-accent:hover,
.contact-form .btn-accent:hover {
  border-color: var(--color-accent-ink);
  color: var(--color-accent-ink);
}

/* Amber outline, transparent interior — used for Send Message. Sits on the
   light form panel, so it uses --color-accent-ink (not the bright accent)
   for the resting border/text to hold WCAG contrast; the bright accent is
   reserved for the hover fill, where it's paired with navy text instead. */
.btn-outline-accent {
  background: transparent;
  border-color: var(--color-accent-ink);
  color: var(--color-accent-ink);
}
.btn-outline-accent:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(11, 21, 31, 0.0);
  transition: background var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  background: rgba(11, 21, 31, 0.96);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 112px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark { height: 60px; width: auto; }
.brand-word { height: 55px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 44px;
}
.nav-links a:not(.btn) {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-white);
  padding: 8px 0;
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}
.nav-links a:not(.btn):hover::after,
.nav-links a.active:not(.btn)::after { width: 100%; }
/* :not(.btn) — the CTA is also a nav link, and on contact.html it matches the
   current page. Without this it turns amber-on-amber and disappears. */
.nav-links a.active:not(.btn) { color: var(--color-accent); }

.nav-cta {
  padding: 10px 22px;
  font-size: 0.98rem;
  /* No colour override — inherits .btn-accent's --color-primary so the nav CTA
     matches every other amber button on the site. */
  border-color: var(--color-accent);
}

/* Hamburger — plain shape by default; morphs into an X via the sibling
   selector below once .nav-links carries .open. Built from absolutely
   positioned bars (not flex+gap) so the rotation pivots true to centre. */
.nav-toggle {
  display: none;
  position: relative;
  width: 30px; height: 20px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%; height: 2.5px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease,
              top 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { top: 100%; transform: translateY(-100%); }

@media (max-width: 900px) {
  .nav-toggle { display: block; z-index: 2; }
  .brand { position: relative; z-index: 2; }
  .brand-mark { height: 46px; }
  .brand-word { height: 42px; }

  /* Full-screen overlay — frosted rather than solid, so the page reads
     faintly through it. Opacity/visibility (not display) so the fade
     transition and staggered link entrance below both have something to
     animate; pointer-events keeps it inert while hidden. */
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(11, 21, 31, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.4s ease;
  }

  .nav-links a:not(.btn) {
    font-size: 1.55rem;
    padding: 16px 0;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .nav-links a:not(.btn)::after { display: none; }
  /* Staggered entrance — delay lives only on the .open rule, so links fall
     into place on the way in but fade out together, quickly, on the way out. */
  .nav-links.open a:not(.btn) { opacity: 1; transform: translateY(0); }
  .nav-links.open a:nth-child(1) { transition-delay: 0.1s; }
  .nav-links.open a:nth-child(2) { transition-delay: 0.16s; }
  .nav-links.open a:nth-child(3) { transition-delay: 0.22s; }
  .nav-links.open a:nth-child(4) { transition-delay: 0.28s; }

  .nav-cta {
    margin-top: 24px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .nav-links.open .nav-cta {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.34s;
  }

  /* Hamburger -> X. Sibling combinator means no JS state needed beyond the
     .open toggle already applied to .nav-links. */
  .nav-links.open ~ .nav-toggle span:nth-child(1) {
    top: 50%; transform: translateY(-50%) rotate(45deg);
  }
  .nav-links.open ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-links.open ~ .nav-toggle span:nth-child(3) {
    top: 50%; transform: translateY(-50%) rotate(-45deg);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--color-white);
  overflow: hidden;
}
.hero-video,
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  /* Promotes the video to its own GPU compositing layer. Doesn't fix
     playbackRate-induced frame-pacing jitter (that's a decoder/timing
     issue, not a paint one) but can smooth out compositor-side jank
     stacking on top of it. */
  transform: translateZ(0);
  will-change: transform;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,21,31,0.75) 0%, rgba(11,21,31,0.55) 45%, rgba(11,21,31,0.92) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding-top: 112px;
}
.hero-content .section-label { color: var(--color-accent); }
.hero-content h1 {
  color: var(--color-white);
  /* Fluid, not just responsive-in-name: derived from the actual measured
     width of "Designed for Excellence." (the longer of the two <br>-split
     lines) against the hero column, which is capped at 680px by
     .hero-content regardless of screen size. Without this, the old fixed
     4.2rem max needed ~805px for that line against only ~632px available,
     so it wrapped on wide screens too, not just phones. Keeps each line to
     one row from a 320px phone up through the 680px column cap. */
  font-size: clamp(1.3rem, calc(7.9vw - 0.24rem), 3.1rem);
  margin-bottom: 20px;
}
.hero-content .lede {
  /* Fluid so it stays clearly secondary to the h1 at every width. A flat
     1.15rem was only ~4px smaller than the h1's mobile size, so the two
     read as near-equal weight on phones; this keeps a legible 16px floor
     while widening the size gap as the h1 grows. */
  font-size: clamp(1rem, calc(0.67vw + 0.87rem), 1.15rem);
  color: var(--color-steel-light);
  max-width: 540px;
  margin-bottom: 36px;
}
.hero-content .lede a {
  color: var(--color-accent);
  text-decoration: none;
}
.hero-content .lede a:hover { color: var(--color-accent-hover); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Equal-width, single-row buttons on phones. flex:1 1 0 makes both buttons
   claim the same share of the row regardless of their text length; the
   padding/font-size are trimmed so "View Our Work" still fits without
   wrapping inside the button at that shared width. */
@media (max-width: 480px) {
  .hero-actions { flex-wrap: nowrap; gap: 12px; }
  .hero-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 14px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

/* Page (non-home) hero — shorter, no video */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 130%);
  color: var(--color-white);
  padding: 204px 0 80px;
  position: relative;
  overflow: hidden;
}
/* Brand-mark watermark, masked from the logo's own alpha shape — the letter
   cutouts become real gaps showing the gradient through, like an engraving. */
.page-hero::after {
  content: '';
  position: absolute;
  right: -10%; top: -30%;
  width: 500px; height: 500px;
  border: 60px solid rgba(255,255,255,0.04);
  border-radius: 50%;
}
.page-hero h1 { color: var(--color-white); font-size: clamp(2rem, 2.8vw, 2.2rem); }
.page-hero p { color: var(--color-steel-light); max-width: 560px; font-size: var(--fs-body-lg); margin-top: 12px; }
.breadcrumb {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ==========================================================================
   Cards / grids (shared)
   ========================================================================== */
.card {
  background: var(--color-white);
  border: 1px solid #E4E8EC;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(11,21,31,0.1);
}

.stats-strip {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 48px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stats-grid .num {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--color-accent);
}
.stats-grid .label {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-steel-light);
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-primary);
  color: var(--color-steel-light);
  padding: 72px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-grid h4 {
  color: var(--color-white);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.footer-grid p, .footer-grid a { color: var(--color-steel-light); font-size: var(--fs-small); }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid ul a:hover { color: var(--color-accent); }
.footer-brand img { height: 60px; margin-bottom: 16px; }
.footer-brand p { max-width: 280px; }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--color-steel); /* #5C6975 was only 3.3:1 against the navy footer */
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Utility
   ========================================================================== */
.bg-light { background: var(--color-light); }
.bg-dark { background: var(--color-primary); color: var(--color-white); }
.bg-dark h2, .bg-dark h3 { color: var(--color-white); }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
}

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 760px) { .services-grid { grid-template-columns: 1fr; } }

.service-card {
  padding: 40px;
  border-top: 3px solid var(--color-accent);
}
.service-card .num {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-steel-dark);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  display: block;
}
.service-card h3 { font-size: var(--fs-h3); margin-bottom: 12px; }
.service-card p { color: #55606B; margin-bottom: 0; }
.service-card ul { margin-top: 16px; }
.service-card ul li {
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
  color: #55606B;
  font-size: 0.95rem;
}
.service-card ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 10px; height: 2px;
  background: var(--color-accent);
}
.service-card.addon {
  border-top-color: var(--color-steel);
  background: var(--color-light);
}
/* Stacked view: always lead with the heading/text, never the image */
@media (max-width: 860px) {
  .service-card.grid-2 > img { order: 2; }
  .service-card.grid-2 > div { order: 1; }
}
.tag-optional {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: rgba(6,59,100,0.08);
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 10px;
  vertical-align: middle;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
@media (max-width: 900px) { .process-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .process-steps { grid-template-columns: 1fr; } }
.process-step {
  position: relative;
  padding: 32px 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
}
.process-step .step-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--color-accent);
  margin-bottom: 10px;
  display: block;
}
.process-step h4 { color: var(--color-white); font-size: var(--fs-h4); margin-bottom: 8px; }
.process-step p { color: var(--color-steel-light); font-size: var(--fs-small); margin: 0; }

.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -13px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent);
  transform: translateY(-50%) rotate(45deg);
  animation: arrow-pulse 2s ease-in-out infinite;
  z-index: 2;
}
.process-step:nth-child(1)::after { animation-delay: 0s; }
.process-step:nth-child(2)::after { animation-delay: 0.3s; }
.process-step:nth-child(3)::after { animation-delay: 0.6s; }
@keyframes arrow-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@media (max-width: 900px) {
  .process-step::after { display: none; }
}

/* ==========================================================================
   Featured Work — Structural / Architectural split
   ========================================================================== */
.work-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
@media (max-width: 860px) { .work-split { grid-template-columns: 1fr; gap: 56px; } }

.work-category > h3 { font-size: var(--fs-h3); margin-bottom: 14px; }
.work-category > p {
  color: #55606B;
  font-size: var(--fs-body);
  margin-bottom: 28px;
}
.work-category:last-child {
  border-left: 1px solid #E4E8EC;
  padding-left: 56px;
}
@media (max-width: 860px) {
  .work-category:last-child { border-left: none; padding-left: 0; }
}

.work-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 480px) { .work-types { grid-template-columns: 1fr 1fr; } }

.work-type { display: block; }
.work-type .thumb {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--color-light);
}
.work-type .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.work-type:hover .thumb img { transform: scale(1.08); }
.work-type .label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  text-align: center;
}

/* ==========================================================================
   Portfolio
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.filter-btn {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  border: 1px solid #D5DAE0;
  background: var(--color-white);
  border-radius: 30px;
  color: var(--color-ink);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--color-accent); }
.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .portfolio-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Portfolio — Model / Drawing comparison
   ========================================================================== */
.compare {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-primary);
  touch-action: pan-y;
  user-select: none;
  --pos: 50%;
}
.compare img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.compare .compare-top {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.compare-divider {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--color-accent);
  transform: translateX(-1px);
  pointer-events: none;
}
.compare-handle {
  position: absolute;
  top: 50%; left: var(--pos);
  width: 46px; height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: rgba(11, 21, 31, 0.86);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: ew-resize;
  padding: 0;
  transition: background var(--transition), transform 0.1s ease;
}
.compare-handle:hover { background: var(--color-accent); color: var(--color-primary); }
.compare-handle:focus-visible {
  outline: 3px solid var(--color-white);
  outline-offset: 3px;
}
.compare-handle span {
  display: block;
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.compare-handle .l { border-right: 7px solid currentColor; }
.compare-handle .r { border-left: 7px solid currentColor; }

.compare-tag {
  position: absolute;
  bottom: 16px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 2px;
  background: rgba(11, 21, 31, 0.78);
  color: var(--color-white);
  pointer-events: none;
}
.compare-tag.left { left: 16px; }
.compare-tag.right { right: 16px; color: var(--color-primary); background: rgba(255,255,255,0.9); }

.compare-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-top: 18px;
}
.compare-caption h3 { margin: 0; font-size: var(--fs-h3); }
.compare-caption .meta {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  color: var(--color-steel-dark);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Portfolio — type bands
   ========================================================================== */
.type-nav {
  position: sticky;
  top: 112px;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #E4E8EC;
}
.type-nav a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 16px;
  border: 1px solid #DCE2E7;
  border-radius: 2px;
  color: var(--color-ink);
  transition: all var(--transition);
}
.type-nav a:hover { border-color: var(--color-accent-ink); color: var(--color-accent-ink); }
/* Keep the jump-nav to a single scrollable row on small screens, otherwise it
   wraps to ~118px and, with the 112px header, swallows a third of the viewport. */
@media (max-width: 700px) {
  .type-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .type-nav::-webkit-scrollbar { display: none; }
  .type-nav a { white-space: nowrap; flex: 0 0 auto; }
}

.type-band { padding-top: 64px; scroll-margin-top: 190px; }
@media (max-width: 700px) { .type-band { scroll-margin-top: 178px; } }
.type-band:first-of-type { padding-top: 40px; }
.type-band-head {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid #E4E8EC;
}
.type-band-head h2 { font-size: var(--fs-h2-compact); margin-bottom: 8px; }
.type-band-head p { color: #55606B; max-width: 68ch; margin: 0; font-size: var(--fs-body); }

/* "includes drawing" badge on gallery tiles */
.portfolio-item .has-drawing {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 2px;
  background: rgba(196, 145, 58, 0.94);
  color: var(--color-primary);
}

/* ==========================================================================
   Lightbox — deliverable tabs
   ========================================================================== */
.lightbox-tabs {
  position: absolute;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 60px;
}
.lightbox-tab {
  font-family: var(--font-heading);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 18px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 2px;
  background: rgba(11, 21, 31, 0.7);
  color: var(--color-white);
  transition: all var(--transition);
}
.lightbox-tab:hover { border-color: var(--color-accent); color: var(--color-accent); }
.lightbox-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
}
@media (max-width: 620px) {
  .lightbox-tabs { top: 16px; gap: 4px; padding: 0 50px; }
  .lightbox-tab { font-size: 0.64rem; padding: 7px 11px; letter-spacing: 0.08em; }
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--color-light);
}
.portfolio-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.portfolio-item:hover img { transform: scale(1.08); }
.portfolio-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px;
  background: linear-gradient(0deg, rgba(11,21,31,0.9) 0%, rgba(11,21,31,0) 100%);
  color: var(--color-white);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition);
}
.portfolio-item:hover .portfolio-caption { opacity: 1; transform: translateY(0); }
.portfolio-caption .cat {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
  margin-bottom: 4px;
}
.portfolio-caption h4 { color: var(--color-white); font-size: var(--fs-h4); margin: 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(11,21,31,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox-caption {
  position: absolute;
  bottom: 30px; left: 0; right: 0;
  text-align: center;
  color: var(--color-steel-light);
  font-size: 0.9rem;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--color-white);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all var(--transition);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.1rem; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
/* Grid items default to min-width:auto, which lets a child's intrinsic
   content (here, the long <select> option text) force this item wider
   than its track instead of shrinking — a well-known CSS Grid "blowout".
   On a 320px phone .contact-form was rendering at 350px, wider than the
   viewport itself. min-width:0 lets it actually respect the track. */
.contact-info-card, .contact-form { min-width: 0; }

.contact-info-card {
  padding: 40px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius);
}
.contact-info-card h3 { color: var(--color-white); font-size: var(--fs-h3); }
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.contact-item:last-of-type { border-bottom: none; }
.contact-item .icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(196,145,58,0.15);
  color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
}
.contact-item .label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-steel-light);
  margin-bottom: 4px;
}
.contact-item a, .contact-item span {
  color: var(--color-white);
  font-size: 1.05rem;
  /* The email address has no spaces to wrap at, so normal white-space lets
     it overflow the card on narrow phones instead of breaking. */
  overflow-wrap: break-word;
  min-width: 0;
}
.contact-item > div:last-child { min-width: 0; }

.contact-form {
  padding: 44px;
  background: var(--color-light);
  border-radius: var(--radius);
}
/* Nav CTA jump target. Anchored to the section (not the form panel) so the
   scroll lands with the page banner's bottom edge exactly at the header's
   bottom edge — the section top and the banner bottom are the same line.
   Must equal the fixed header height. */
#enquiry { scroll-margin-top: 112px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 22px; min-width: 0; }
.field label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0; /* select's long option text is the actual root cause of the grid blowout above */
  padding: 13px 16px;
  border: 1px solid #D5DAE0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  /* 16px is the iOS Safari threshold below which focusing a field auto-zooms
     the whole page — that's the "boxes go out of the frame" symptom, not a
     layout overflow. 1rem keeps it just at that line. */
  font-size: 1rem;
  background: var(--color-white);
  color: var(--color-ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note {
  font-size: 0.85rem;
  color: var(--color-steel-dark); /* #7A848D was 3.5:1 on the light form panel */
  margin-top: 8px;
}
.form-success {
  display: none;
  background: #E7F3EA;
  border: 1px solid #B7DDC1;
  color: #235A32;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.95rem;
}
.form-success.show { display: block; }
.form-error {
  display: none;
  background: #FBEAEA;
  border: 1px solid #E8B4B4;
  color: #7A2020;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.95rem;
}
.form-error.show { display: block; }

/* Honeypot — off-screen rather than display:none. Some bots skip fields
   hidden via display:none/visibility:hidden, so this moves it out of the
   viewport instead while staying "visible" to a naive DOM scan. Real users
   never encounter it: tabindex="-1" skips it in keyboard nav and
   aria-hidden hides it from screen readers. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   CTA banner
   ========================================================================== */
.cta-banner {
  background: linear-gradient(120deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  color: var(--color-white);
  padding: 64px 0;
  text-align: center;
}
/* Fixed, deliberately modest — a CTA banner is a brief, centred prompt next
   to a one-line paragraph and a button, not a section header. Even the
   compact heading tier (which scales up to 33.6px) still read too large
   here; this holds a steady, clearly-secondary size instead of scaling with
   the viewport. */
.cta-banner h2 { color: var(--color-white); font-size: 1.4rem; margin-bottom: 16px; }
.cta-banner p { color: var(--color-steel-light); max-width: 560px; margin: 0 auto 32px; }

/* ==========================================================================
   About / values
   ========================================================================== */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 760px) { .values-grid { grid-template-columns: 1fr; } }
.value-card { padding: 36px 32px; }
.value-card .icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(196,145,58,0.12);
  color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.value-card h3 { font-size: 1.1rem; }
.value-card p { color: #55606B; font-size: 0.95rem; margin: 0; }
