/* ==========================================================================
   Urgent Facility Management Service Ltd — website styles
   Palette: Corbeau, Blue Graphite, Lush Aqua, Often Orange, Dark Ages, Perfect White
   Fonts:   Gabarito (text and headings), IBM Plex Mono (labels and figures)
   ========================================================================== */

:root {
  /* Palette */
  --corbeau: #111122;      /* page background */
  --graphite: #3A383F;     /* form fields */
  --aqua: #004466;         /* drawing-sheet sections */
  --orange: #FF714E;       /* buttons, markers, highlights */
  --dark-ages: #9698A3;    /* lines and secondary text */
  --white: #F0EEEE;        /* main text */

  /* Roles */
  --bg: var(--corbeau);
  --sheet: var(--aqua);
  --accent: var(--orange);
  --text: var(--white);
  --muted: var(--dark-ages);
  --line: var(--dark-ages);
  --sheet-line: rgba(240, 238, 238, 0.3);
  --sheet-muted: rgba(240, 238, 238, 0.78);

  /* Type */
  --font-sans: 'Gabarito', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', Menlo, Consolas, monospace;

  /* Layout */
  --max: 1320px;
  --gutter: 24px;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

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

a { color: var(--text); }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 0;
  box-shadow: 0 0 0 6px var(--corbeau);
}

h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { list-style: none; padding: 0; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); }

.label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--corbeau);
  font-weight: 600;
  z-index: 10;
}
.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 24px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--corbeau); }
.btn--primary:hover { color: var(--corbeau); filter: brightness(1.06); }
.btn--outline { border: 1px solid var(--sheet-muted); color: var(--white); }
.btn--outline:hover { color: var(--white); border-color: var(--white); }
.btn--small { min-height: 44px; padding: 10px 18px; font-size: 15px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 17, 34, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
section[id] { scroll-margin-top: 72px; }
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand__logo {
  width: 44px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1);   /* white logo, same treatment as the partner logos */
}
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 800; font-size: 26px; letter-spacing: -0.01em; }
.brand__sub { margin-top: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  font-size: 15px;
  font-weight: 500;
}
.main-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="true"],
.main-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

/* Menu button: only shown on small screens */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
}
.menu-toggle .menu-icon-close { display: none; }
.site-header.is-open .menu-toggle .menu-icon-open { display: none; }
.site-header.is-open .menu-toggle .menu-icon-close { display: inline; }

/* ---------- Drawing sheets (hero + contact) ---------- */

.sheet {
  background-color: var(--sheet);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--white);
  padding: 20px;
}
.sheet__frame {
  max-width: 1360px;
  margin: 0 auto;
  border: 1px solid var(--sheet-line);
}
.sheet__strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--sheet-line);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sheet-muted);
}

/* Hero */
.hero__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding: 56px 32px 40px;
}
.hero__text {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hero__title {
  font-weight: 800;
  font-size: clamp(48px, 6.6vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.hero__intro { max-width: 32em; font-size: 19px; line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__drawing {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.elevation { display: block; width: 100%; height: auto; }
.elevation .level-markers { fill: var(--accent); }
.hero__drawing figcaption {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--sheet-muted);
}

.stages {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--sheet-line);
}
.stages li {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 32px 32px;
  border-right: 1px solid var(--sheet-line);
}
.stages li:last-child { border-right: 0; }
.stages__label { font-family: var(--font-mono); font-size: 13px; }
.stages__name { font-weight: 700; font-size: 28px; line-height: 1; }
.stages__text { font-size: 15px; line-height: 1.55; }

/* The building drawing "constructs" itself once it comes into view:
   ground first, then setting-out lines, then the building rises floor by floor */
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.elevation .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-line var(--t, 1.2s) cubic-bezier(0.45, 0, 0.25, 1) var(--d, 0s) both;
}
.elevation .fade {
  opacity: 0;
  animation: fade-in var(--t, 0.9s) ease-in-out var(--d, 0s) both;
}
.elevation .pop {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: pop-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s) both;
}
.elevation.is-waiting * { animation-play-state: paused; }

/* ---------- Sections on the dark page ---------- */

.section { border-top: 1px solid var(--line); }
.section--no-rule { border-top: 0; }
.section__inner {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-block: 96px;
}
.section__strip {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px 72px;
}
.section__title {
  flex: 1 1 520px;
  min-width: 0;
  font-weight: 700;
  font-size: clamp(36px, 4.4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.section__intro {
  flex: 1 1 360px;
  min-width: 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}
.subhead {
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Bordered grid of cells (title block, services, numbers, partners) */
.cells {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cells > * {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- Company ---------- */

.statement {
  max-width: 18em;
  font-weight: 700;
  font-size: clamp(36px, 4.4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.about {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 72px;
}
.about__text {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about__text h2 { font-size: 24px; font-weight: 700; line-height: 1.15; }
.about__text p { max-width: 36em; font-size: 18px; line-height: 1.65; }

.vision-mission {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.vision-mission > div { border-top: 2px solid var(--line); padding-top: 14px; }
.vision-mission dd { margin-top: 8px; font-size: 21px; line-height: 1.45; font-weight: 500; }

.title-block { display: flex; flex-direction: column; gap: 12px; }
.title-block .cells > div { flex: 1 1 180px; padding: 14px 16px; }
.title-block dt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.title-block dd { margin-top: 6px; font-size: 17px; font-weight: 600; }

.values { display: flex; flex-direction: column; gap: 20px; }
.values h3 { font-size: 24px; font-weight: 700; line-height: 1.15; }
.values ul { display: flex; flex-wrap: wrap; gap: 24px 32px; }
.values li { flex: 1 1 200px; min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.values strong { display: block; margin-bottom: 4px; font-size: 17px; }
.values span { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- Services ---------- */

.divisions > div {
  flex: 1 1 340px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}
.divisions h3 { font-size: 26px; font-weight: 700; line-height: 1.1; margin-top: 6px; }
.divisions h4 { margin-bottom: 4px; font-size: 16px; font-weight: 600; }
.divisions p { font-size: 15px; line-height: 1.6; color: var(--muted); }

.also { max-width: 900px; font-size: 16px; line-height: 1.65; }

.process { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; }
.process__list { border-top: 1px solid var(--line); }
.process__list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.process__num { flex: 0 0 64px; padding-top: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.process__name { flex: 1 1 260px; min-width: 0; font-weight: 700; font-size: 24px; line-height: 1.15; }
.process__text { flex: 2 1 420px; min-width: 0; padding-top: 4px; font-size: 16px; line-height: 1.6; color: var(--muted); }

/* ---------- Projects ---------- */

.numbers > div { flex: 1 1 260px; padding: 20px 24px; }
.numbers .num { font-family: var(--font-mono); font-weight: 500; font-size: 52px; line-height: 1; }
.numbers .num-label { margin-top: 6px; font-size: 15px; color: var(--muted); }

.schedule { display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; border-top: 2px solid var(--line); }
.schedule table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}
.schedule thead th {
  padding: 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.schedule tr { border-bottom: 1px solid var(--line); }
.schedule td, .schedule tbody th { padding: 18px 12px; vertical-align: top; text-align: left; }
.schedule td:first-child, .schedule thead th:first-child { padding-left: 0; }
.schedule td:last-child, .schedule thead th:last-child { padding-right: 0; }
.schedule .code { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.schedule tbody th { font-size: 19px; font-weight: 700; line-height: 1.25; }
.schedule .work { color: var(--muted); }
.ongoing-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  background: var(--accent);
}
.note { font-size: 15px; line-height: 1.6; color: var(--muted); }

.plates { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.plates h3 { font-size: 28px; font-weight: 700; line-height: 1.1; }
.plates__grid { display: flex; flex-wrap: wrap; gap: 24px; }
.plate {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
}
.plate img { width: 100%; height: 300px; object-fit: cover; }
.plate figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Partners ---------- */

.partners__inner { padding-block: 72px; gap: 28px; }
.partners__title {
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Logo wall: every logo in one colour so the set looks even and
   sits in the same drawing grid as the rest of the page */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.logo-wall li {
  min-width: 0;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--white);
  opacity: 0.9;
  transition: opacity 0.2s, background-color 0.2s;
}
.logo-wall li:hover { opacity: 1; background: var(--graphite); }
.logo-wall img {
  width: auto;
  height: var(--h, 60px);
  max-width: 80%;
  object-fit: contain;
  filter: brightness(0) invert(1);   /* turns each logo Perfect White */
}

/* Dantata: symbol with the name beside it */
.lockup { display: flex; align-items: center; gap: 12px; }
.lockup img { max-width: none; }
.lockup__name { font-size: 19px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }

/* Partners without an image logo: set as a wordmark, as in the brochure */
.wordmark {
  display: flex;
  flex-direction: column;
  font-family: 'Ibarra Real Nova', Georgia, serif;
  font-weight: 700;
  line-height: 1;
}
.wordmark__main { font-size: clamp(22px, 2vw, 28px); letter-spacing: 0.02em; }
.wordmark__sub { margin-top: 4px; font-size: clamp(14px, 1.3vw, 18px); }
.wordmark__sub--small { margin-top: 5px; font-size: clamp(11px, 1vw, 14px); letter-spacing: 0.02em; }

/* ---------- Contact ---------- */

.contact__body {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 72px;
  padding: 64px 32px;
}
.contact__info {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.contact__title {
  font-weight: 800;
  font-size: clamp(40px, 4.8vw, 70px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.contact__intro { max-width: 30em; font-size: 18px; line-height: 1.6; }

.contact-cells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--sheet-line);
  border-left: 1px solid var(--sheet-line);
}
.contact-cells > div {
  min-width: 0;
  padding: 16px 18px 18px;
  border-right: 1px solid var(--sheet-line);
  border-bottom: 1px solid var(--sheet-line);
}
.contact-cells__wide { grid-column: 1 / -1; }
.contact-cells dt { font-family: var(--font-mono); font-size: 13px; color: var(--sheet-muted); }
.contact-cells dd { margin-top: 8px; font-size: 16px; line-height: 1.5; }
.contact-cells .phones {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  font-family: var(--font-mono);
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 500;
}
.contact-cells .email { font-size: clamp(17px, 1.6vw, 20px); font-weight: 600; }
.contact-cells a { color: var(--white); text-decoration: none; padding: 4px 0; overflow-wrap: anywhere; }
.contact-cells a:hover { color: var(--white); text-decoration: underline; }
.map-link {
  display: block;
  width: fit-content;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* Enquiry form: laid out like a drawing's title block, filled in on the sheet */
.enquiry {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  color: var(--white);
}
.enquiry__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--sheet-line);
  border-bottom: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sheet-muted);
}
.enquiry__title { font-family: var(--font-sans); font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: -0.01em; }

.tb {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--sheet-line);
  border-left: 1px solid var(--sheet-line);
}
.tb__cell {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--sheet-line);
  border-bottom: 1px solid var(--sheet-line);
  transition: background-color 0.15s, box-shadow 0.15s;
}
.tb__cell--half { flex: 1 1 220px; }
.tb__cell:focus-within {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.tb__cell > label,
.tb__cell > legend {
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sheet-muted);
}
.tb__cell > legend { float: left; width: 100%; margin-bottom: 10px; }
.tb input,
.tb textarea {
  width: 100%;
  min-height: 40px;
  padding: 4px 0;
  font: inherit;
  font-size: 18px;
  color: var(--white);
  background: transparent;
  border: 0;
}
.tb input:focus-visible,
.tb textarea:focus-visible { outline: none; box-shadow: none; }  /* the cell shows focus instead */
.tb textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
.tb ::placeholder { color: rgba(240, 238, 238, 0.42); opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 6px; clear: both; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--sheet-muted);
  transition: background-color 0.15s, color 0.15s;
}
.chip input:hover + span { border-color: var(--white); }
.chip input:checked + span { background: var(--white); color: var(--aqua); border-color: var(--white); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.enquiry__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding-top: 20px;
}
.enquiry__send { min-height: 54px; padding: 14px 36px; font-size: 17px; }
.enquiry__alt { font-size: 15px; color: var(--sheet-muted); }
.enquiry__alt a { color: var(--white); font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.form-status { min-height: 1.5em; padding-top: 10px; font-size: 15px; }

/* ---------- Footer ---------- */

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: 48px 32px;
}
.footer__cols { display: flex; flex-wrap: wrap; gap: 32px 48px; }
.footer__brand { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__name { font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -0.01em; }
.footer__tagline { font-size: 15px; color: var(--muted); }
.footer__col { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.footer__addr + .footer__addr { margin-top: 8px; }
.footer__addr-label { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.footer__bottom a { padding: 8px 0; }

/* ---------- Gallery page ---------- */

.plates__more { align-self: flex-start; margin-top: 8px; }
.gallery__inner { gap: 32px; }
.gallery__title { font-size: clamp(40px, 5.4vw, 76px); }

.g-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.g-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}
.g-filter span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.g-filter:hover { border-color: var(--white); }
.g-filter[aria-pressed="true"] { background: var(--white); color: var(--corbeau); border-color: var(--white); font-weight: 600; }
.g-filter[aria-pressed="true"] span { color: var(--graphite); }
.g-count { margin-top: -12px; }

/* Even grid; each tile shows a 4:3 crop, the viewer shows the whole photo */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 20px; }
.g-item { min-width: 0; }
.g-item[hidden] { display: none; }
.g-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: zoom-in;
  overflow: hidden;
}
.g-open img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.4s ease; }
.g-open:hover { border-color: var(--white); }
.g-open:hover img { transform: scale(1.03); }
.g-item--video .g-open { cursor: pointer; }
.g-play {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  background: var(--accent);
  color: var(--corbeau);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.g-cap { margin-top: 10px; font-size: 15px; line-height: 1.45; }
.g-meta { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.gallery-cta__body { display: flex; flex-direction: column; gap: 22px; padding: 56px 32px; max-width: 760px; }

/* Viewer */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(17, 17, 34, 0.97);
  color: var(--white);
}
.lightbox::backdrop { background: rgba(17, 17, 34, 0.9); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
.lb-count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.lb-stage { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 72px; touch-action: pan-y; }
.lb-media { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.lb-media img, .lb-media video { max-width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; }
.lb-media img { animation: lb-in 0.35s ease both; }
@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--white);
  background: rgba(58, 56, 63, 0.7);
  border: 1px solid var(--line);
  cursor: pointer;
}
.lb-btn:hover { background: var(--graphite); border-color: var(--white); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-caption { padding: 14px 20px 22px; text-align: center; }
.lb-title { font-size: 17px; font-weight: 600; }
.lb-meta { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .lb-media img { animation: none; }
  .g-open img { transition: none; }
}

@media (max-width: 640px) {
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .g-open { padding: 5px; }
  .g-cap { font-size: 13px; }
  .g-meta { display: none; }
  .g-play { left: 10px; bottom: 10px; padding: 5px 8px; font-size: 11px; }
  .g-filter { min-height: 40px; padding: 6px 12px; font-size: 14px; }
  .lb-stage { padding: 0 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-media img, .lb-media video { max-height: calc(100dvh - 210px); }
  .gallery-cta__body { padding: 36px 18px; }
}

/* ---------- Tablets and phones ---------- */

@media (max-width: 1080px) {
  /* Collapsible menu (only when JavaScript is on; otherwise the links stay visible) */
  .js .menu-toggle { display: inline-flex; }
  .js .main-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--line);
  }
  .js .site-header.is-open .main-nav { display: flex; }
  .main-nav a {
    padding: 14px 0;
    font-size: 17px;
    border-bottom: 1px solid var(--graphite);
  }
  .main-nav a:last-child { border-bottom: 0; }

  .logo-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-wall li { height: 140px; padding: 16px; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .brand__sub { display: none; }
  .brand__name { font-size: 22px; }
  .header-actions { gap: 10px; }
  .site-header .container { gap: 10px 12px; }
  .brand__logo { width: 38px; height: 33px; }

  .contact-cells { grid-template-columns: minmax(0, 1fr); }

  /* Project schedule becomes a stack of cards */
  .table-wrap { border-top: 0; }
  .schedule table { min-width: 0; }
  .schedule table, .schedule tbody, .schedule tr, .schedule td, .schedule tbody th { display: block; width: auto !important; }
  .schedule thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .schedule tr { border: 1px solid var(--line); padding: 16px 16px 6px; margin-bottom: 12px; }
  .schedule td, .schedule tbody th { padding: 0 0 10px !important; }
  .schedule tbody th { font-size: 20px; }
  .schedule td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
  }

  .sheet { padding: 10px; }
  .hero__body, .contact__body { padding: 36px 18px; }
  .stages li { padding: 20px 18px 24px; border-right: 0; border-bottom: 1px solid var(--sheet-line); }
  .stages li:last-child { border-bottom: 0; }
  .section__inner { padding-block: 64px; gap: 40px; }
  .divisions > div { padding: 22px 18px; }
  .enquiry__send { flex: 1 1 100%; justify-content: center; }
  .plate img { height: 240px; }
  .logo-wall li { height: 120px; opacity: 0.9; }
  .logo-wall img { height: calc(var(--h, 60px) * 0.78); }
  .lockup__name { font-size: 16px; }
}
