/* Perkel theme: shared styles for the HTML designs.
   Design system source: design-system/perkel/MASTER.md (ui-ux-pro-max), adapted in designs/DESIGN-PLAN.md */

:root {
  --paper: #f3f5f4;
  --paper-2: #e6ebea;
  --ink: #15222b;
  --ink-2: #213139;
  --steel: #55646d;
  --rule: #cdd6d7;
  --orange: #ef6633;
  --orange-text: #b2431b;
  --on-dark: #e9eeed;
  --on-dark-muted: #a9b6b9;
  --error: #b42318;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(2.5rem, 1.4rem + 3.8vw, 4.75rem);
  --fs-h2: clamp(1.9rem, 1.3rem + 2vw, 3rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-lead: clamp(1.125rem, 1.05rem + .35vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: .875rem;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 40px; --space-5: 64px; --space-6: 112px;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-body)/1.6 var(--font);
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; max-width: 64ch; }
h1, h2, h3 { margin: 0; line-height: 1.05; font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--fs-display); font-variation-settings: "wdth" 125; font-weight: 760; letter-spacing: -.025em; line-height: .98; }
h2 { font-size: var(--fs-h2); font-variation-settings: "wdth" 118; letter-spacing: -.015em; }
h3 { font-size: var(--fs-h3); font-variation-settings: "wdth" 104; font-weight: 650; line-height: 1.2; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--steel); max-width: 52ch; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; }
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  font: 600 1rem/1 var(--font); font-variation-settings: "wdth" 108;
  text-decoration: none; border: 2px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: #ff7a48; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.on-dark .btn-ghost { border-color: var(--on-dark); color: var(--on-dark); }
.on-dark .btn-ghost:hover { background: var(--on-dark); color: var(--ink); }
.text-link { color: var(--orange-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.text-link:hover { text-decoration-thickness: 2px; }
.on-dark .text-link { color: var(--orange); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: var(--space-3); height: var(--header-h); }
.brand { display: block; width: 132px; flex: none; }
.brand svg { width: 100%; height: auto; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 10px 12px; text-decoration: none; font-weight: 500;
  font-variation-settings: "wdth" 96; color: var(--ink); border-radius: 2px;
}
.nav a:hover { background: var(--paper-2); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--orange); }
.header-cta { flex: none; }
.menu-toggle { display: none; }

@media (max-width: 1080px) {
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; margin-left: auto;
    min-height: 44px; padding: 0 14px; background: none; border: 1.5px solid var(--ink); border-radius: 2px;
    font: 600 .95rem var(--font); color: var(--ink); cursor: pointer;
  }
  .menu-toggle span { display: block; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: var(--space-2) var(--gutter) var(--space-4);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 14px 4px; font-size: 1.25rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .header-cta { display: none; }
  .nav .nav-cta { display: block; margin-top: var(--space-3); }
}
@media (min-width: 1081px) { .nav .nav-cta { display: none; } }

/* Sections */
.section { padding-block: var(--space-6); }
.section-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); max-width: 760px; }
.section-head p { color: var(--steel); }
.on-dark { background: var(--ink); color: var(--on-dark); }
.on-dark .section-head p, .on-dark .lead { color: var(--on-dark-muted); }

/* BIM model (shared by home hero and services page) */
.model { width: 100%; height: auto; overflow: visible; }
.model .lod { opacity: 0; transition: opacity .45s var(--ease); }
.model .lod.on { opacity: 1; }
.model polygon { stroke-linejoin: round; transition: fill-opacity .45s var(--ease), stroke-opacity .45s var(--ease); }
.model .mass { fill: var(--ink); fill-opacity: .07; stroke: var(--ink); stroke-width: 1.4; }
.model .mass.top { fill-opacity: .03; }
.model[data-level] .mass { fill-opacity: .02; stroke-opacity: .25; }
.model[data-level="100"] .mass { fill-opacity: .1; stroke-opacity: 1; }
.model .slab { fill: var(--orange); stroke: #c94d22; stroke-width: .7; }
.model .slab.top { fill-opacity: .16; }
.model .slab.side-x, .model .slab.side-y { fill-opacity: .95; }
.model .plant { fill: var(--paper-2); stroke: var(--ink); stroke-width: .8; }
.model .grid { stroke: var(--steel); stroke-width: .6; stroke-dasharray: 6 3 1 3; }
.model .bubble { fill: var(--paper); stroke: var(--ink); stroke-width: .9; }
.model .bubble-t { font: 600 9px var(--font); text-anchor: middle; fill: var(--ink); }
.model .col { stroke: var(--ink); stroke-width: 1.6; }
.model .mull { stroke: var(--ink); stroke-width: .45; stroke-opacity: .55; }
.model .duct { fill: var(--steel); stroke: var(--ink); stroke-width: .4; }
.model .duct.top { fill: #8797a0; }
.model .pipe { stroke: #1d7f8c; stroke-width: 2.2; stroke-linecap: round; }
.model .clash { fill: none; stroke: #d33b2c; stroke-width: 2; }
.model .cloud circle { fill: #1d7f8c; fill-opacity: .7; }
.model[data-level="500"] .slab.top { fill-opacity: .3; }

.lod-control { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.lod-control legend { width: 100%; font-weight: 600; font-size: var(--fs-small); color: var(--steel); margin-bottom: 8px; padding: 0; }
.lod-control button {
  min-width: 64px; min-height: 44px; padding: 0 12px; cursor: pointer;
  font: 600 .95rem var(--font); font-variation-settings: "wdth" 90; font-variant-numeric: tabular-nums;
  background: transparent; color: var(--ink); border: 1.5px solid var(--rule); border-radius: 2px;
  transition: border-color .2s, background-color .2s, color .2s;
}
.lod-control button:hover { border-color: var(--ink); }
.lod-control button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lod-caption { min-height: 4.8em; margin-top: var(--space-2); font-size: var(--fs-small); color: var(--steel); }
.lod-caption strong { display: block; color: var(--ink); font-size: 1rem; }

/* Home hero */
.hero { padding-block: clamp(40px, 6vw, 88px) var(--space-5); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.hero h1 { margin-bottom: var(--space-3); }
.hero .lead { margin-bottom: var(--space-4); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-model { position: relative; }
.hero-model .model { margin-bottom: var(--space-3); }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: var(--space-4); }
}

.facts { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.facts div { padding: var(--space-3) var(--space-3) var(--space-3) 0; }
.facts div + div { padding-left: var(--space-3); border-left: 1px solid var(--rule); }
.facts dt { font-size: var(--fs-small); color: var(--steel); }
.facts dd { margin: 4px 0 0; font-weight: 650; font-size: 1.125rem; font-variation-settings: "wdth" 108; }
@media (max-width: 820px) {
  .facts dl { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* Services list (home) */
.services-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.services-list li { border-bottom: 1px solid var(--rule); }
.services-list a {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) minmax(0, 3fr); gap: var(--space-4); align-items: baseline;
  padding: var(--space-4) 0; text-decoration: none;
}
.services-list h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); font-variation-settings: "wdth" 115; transition: color .2s; }
.services-list p { margin: 0; color: var(--steel); }
.services-list .more { justify-self: end; font-weight: 600; color: var(--orange-text); white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.services-list a:hover h3 { color: var(--orange-text); }
.model-sheets { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--space-3); margin-top: var(--space-5); }
.model-sheets figure { margin: 0; background: #fff; border: 1px solid var(--rule); padding: var(--space-3); display: flex; flex-direction: column; }
.model-sheets img { width: 100%; height: 100%; max-height: 460px; object-fit: contain; flex: 1; }
.model-sheets figcaption { margin-top: var(--space-2); padding-top: 12px; border-top: 1px solid var(--rule); font-size: var(--fs-small); color: var(--steel); }
@media (max-width: 820px) {
  .model-sheets { grid-template-columns: 1fr; }
  .services-list .more { justify-self: start; }
  .services-list a { grid-template-columns: 1fr; gap: var(--space-2); padding: var(--space-3) 0; }
}

/* Projects */
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-4); }
.filter button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px; cursor: pointer; border-radius: 2px;
  font: 600 .95rem var(--font); background: transparent; color: var(--ink); border: 1.5px solid var(--rule);
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter button:hover { border-color: var(--ink); }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter .count { font-weight: 500; font-variant-numeric: tabular-nums; opacity: .7; }
.on-dark .filter button { color: var(--on-dark); border-color: #46575f; }
.on-dark .filter button:hover { border-color: var(--on-dark); }
.on-dark .filter button[aria-pressed="true"] { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }
.project-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.project { grid-column: span 2; }
.project:first-child { grid-column: span 4; grid-row: span 2; }
.project:nth-child(2) { grid-column: span 2; }
.project[hidden] { display: none; }
.project a { display: block; height: 100%; text-decoration: none; }
.project figure { margin: 0; display: flex; flex-direction: column; height: 100%; }
.project .ph { position: relative; overflow: hidden; background: var(--ink-2); aspect-ratio: 4 / 3; flex: 1; }
.project:first-child .ph { aspect-ratio: auto; min-height: 320px; }
.project img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project a:hover img { transform: scale(1.035); }
.project figcaption { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; }
.project h3 { font-size: 1.125rem; font-variation-settings: "wdth" 104; }
.project a:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.project .cat { color: var(--steel); font-size: var(--fs-small); white-space: nowrap; }
.on-dark .project .cat { color: var(--on-dark-muted); }
.projects-foot { margin-top: var(--space-5); display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.projects-foot p { margin: 0; color: var(--on-dark-muted); }
@media (max-width: 900px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
  .project, .project:nth-child(2) { grid-column: span 1; }
  .project:first-child { grid-column: span 2; grid-row: auto; }
  .project:first-child .ph { aspect-ratio: 16 / 10; min-height: 0; }
}
@media (max-width: 560px) {
  .project-grid { grid-template-columns: 1fr; }
  .project, .project:first-child { grid-column: auto; }
}

/* Why Perkel */
.why .wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-5); }
.why .section-head { margin: 0; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.benefits { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-4); margin: 0; }
.benefits h3 { margin-bottom: 12px; padding-top: 18px; border-top: 3px solid var(--ink); }
.benefits p { color: var(--steel); margin: 0; }
@media (max-width: 900px) {
  .why .wrap { grid-template-columns: 1fr; gap: var(--space-4); }
  .why .section-head { position: static; }
}
@media (max-width: 600px) { .benefits { grid-template-columns: 1fr; gap: var(--space-4); } }

/* Call to action band */
.cta-band { background: var(--orange); color: var(--ink); padding-block: var(--space-5); }
.cta-band .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-4); align-items: end; }
.cta-band h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.75rem); font-variation-settings: "wdth" 125; letter-spacing: -.02em; }
.cta-band p { margin: var(--space-2) 0 0; }
.cta-band .btn-primary { background: var(--ink); color: var(--paper); }
.cta-band .btn-primary:hover { background: var(--ink-2); }
.cta-band .contact-lines { display: grid; gap: 6px; margin-top: var(--space-3); font-weight: 600; }
.cta-band .contact-lines a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 820px) { .cta-band .wrap { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--ink); color: var(--on-dark-muted); padding-block: var(--space-5) var(--space-3); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: var(--space-4); padding-bottom: var(--space-5); }
.footer-grid h2 { font-size: 1rem; font-variation-settings: "wdth" 100; color: var(--on-dark); margin-bottom: 14px; letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; }
.footer-grid address { font-style: normal; display: grid; gap: 10px; }
.footer-brand .brand { width: 150px; margin-bottom: var(--space-3); }
.footer-brand p { max-width: 34ch; }
.socials { display: flex; gap: 8px; margin-top: var(--space-3); }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #3a4b54; border-radius: 2px; color: var(--on-dark); }
.socials a:hover { border-color: var(--on-dark); }
.socials svg { width: 18px; height: 18px; }
.footer-base { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-3); border-top: 1px solid #2e3e47; font-size: var(--fs-small); }
.footer-base a { color: var(--on-dark); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Services page */
.page-head { padding-block: clamp(40px, 6vw, 80px) var(--space-5); border-bottom: 1px solid var(--rule); }
.crumbs { display: flex; gap: 8px; list-style: none; margin: 0 0 var(--space-3); padding: 0; font-size: var(--fs-small); color: var(--steel); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule); }
.crumbs a { color: var(--steel); }
.page-head .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-5); align-items: end; }
.page-head .lead { margin: 0; }
@media (max-width: 900px) { .page-head .wrap { grid-template-columns: 1fr; gap: var(--space-3); } }

.svc-index { position: sticky; top: var(--header-h); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); }
.svc-index ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.svc-index a {
  display: block; padding: 16px 14px; white-space: nowrap; text-decoration: none; font-weight: 600;
  font-variation-settings: "wdth" 96; color: var(--steel); box-shadow: inset 0 -3px 0 transparent; transition: color .2s, box-shadow .2s;
}
.svc-index a:hover { color: var(--ink); }
.svc-index a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--orange); }

.svc { padding-block: var(--space-6); border-bottom: 1px solid var(--rule); }
.svc-intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-5); margin-bottom: var(--space-5); }
.svc-intro h2 { position: sticky; top: calc(var(--header-h) + 80px); align-self: start; }
.svc-intro p:first-child { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink); }
.svc-intro p { color: var(--steel); }
@media (max-width: 900px) {
  .svc-intro { grid-template-columns: 1fr; gap: var(--space-3); }
  .svc-intro h2 { position: static; }
}

.lod-explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-5); align-items: start; }
.lod-steps { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.lod-step { padding: var(--space-4) 0 var(--space-4) var(--space-4); border-left: 2px solid var(--rule); transition: border-color .3s; }
.lod-step.is-active { border-left-color: var(--orange); }
.lod-step button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit;
}
.lod-step .lvl { display: block; font-weight: 750; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1; font-variation-settings: "wdth" 125; font-variant-numeric: tabular-nums; color: #8a979d; transition: color .3s; }
.lod-step.is-active .lvl { color: var(--ink); }
.lod-step h3 { margin: 8px 0 12px; }
.lod-step p { margin: 0; color: var(--steel); }
.lod-stage { position: sticky; top: calc(var(--header-h) + 90px); margin: 0; }
.lod-stage figcaption { margin-top: var(--space-2); font-size: var(--fs-small); color: var(--steel); }
@media (max-width: 900px) {
  .lod-explorer { grid-template-columns: 1fr; gap: var(--space-3); }
  .lod-stage { order: -1; top: calc(var(--header-h) + 56px); background: var(--paper); z-index: 5; margin-inline: calc(-1 * var(--gutter)); padding: 8px var(--gutter); border-bottom: 1px solid var(--rule); }
  .lod-stage figcaption { margin-top: 4px; }
  .lod-stage .model { max-height: 34vh; margin-inline: auto; }
  .lod-step { padding: var(--space-3) 0 var(--space-3) var(--space-3); }
}

.svc-media { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--space-4); align-items: end; }
.svc-media.flip { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.svc-media.flip figure { order: 2; }
.svc-media figure { margin: 0; }
.svc-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--paper-2); }
.svc-media figcaption { margin-top: 10px; font-size: var(--fs-small); color: var(--steel); }
.outcomes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.outcomes li { padding: 16px 0 16px 28px; border-bottom: 1px solid var(--rule); position: relative; }
.outcomes li::before { content: ""; position: absolute; left: 2px; top: 1.45em; width: 12px; height: 2px; background: var(--orange); }
@media (max-width: 900px) {
  .svc-media, .svc-media.flip { grid-template-columns: 1fr; }
  .svc-media.flip figure { order: 0; }
}

.iso-note { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); background: var(--paper-2); margin-top: var(--space-5); }
.iso-note strong { font-variation-settings: "wdth" 115; font-size: 1.25rem; flex: none; }
.iso-note p { margin: 0; color: var(--steel); }
@media (max-width: 600px) { .iso-note { flex-direction: column; align-items: flex-start; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 480px) {
  .lod-control { flex-wrap: nowrap; }
  .lod-control button { flex: 1 1 0; min-width: 0; padding: 0 4px; }
}

/* Projects archive */
.archive-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.archive-bar .filter { margin: 0; }
.view-toggle { display: flex; gap: 0; }
.view-toggle button {
  min-height: 44px; padding: 0 14px; cursor: pointer; font: 600 .9rem var(--font); color: var(--steel);
  background: transparent; border: 1.5px solid var(--rule); border-radius: 0;
}
.view-toggle button + button { border-left: 0; }
.view-toggle button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--orange); }
.view-toggle button + button[aria-pressed="true"] { border-left: 1.5px solid var(--ink); margin-left: -1.5px; }
.project-grid.is-archive { grid-template-columns: repeat(3, 1fr); gap: var(--space-5) var(--space-3); }
.project-grid.is-archive .project { grid-column: auto; grid-row: auto; }
.project-grid.is-archive .ph { aspect-ratio: 2 / 1; min-height: 0; background: var(--paper-2); }
.project-grid.is-archive .project:first-child .ph { aspect-ratio: 2 / 1; min-height: 0; }
.project-grid.is-archive figcaption { border-top: 1px solid var(--rule); margin-top: 14px; }
@media (max-width: 1000px) { .project-grid.is-archive { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .project-grid.is-archive { grid-template-columns: 1fr; gap: var(--space-4); } }

/* List view: a project register */
.project-grid.is-archive[data-view="list"] { grid-template-columns: 1fr; gap: 0; border-top: 1.5px solid var(--ink); }
.project-grid[data-view="list"] .project { border-bottom: 1px solid var(--rule); }
.project-grid[data-view="list"] figure { flex-direction: row; align-items: center; gap: var(--space-3); padding: 12px 0; }
.project-grid[data-view="list"] .ph { flex: none; width: 120px; aspect-ratio: 2 / 1; }
.project-grid[data-view="list"] .project:first-child .ph { aspect-ratio: 2 / 1; }
.project-grid[data-view="list"] figcaption { flex: 1; border: 0; margin: 0; padding: 0; align-items: baseline; }
.project-grid[data-view="list"] h3 { font-size: 1.25rem; }
.project-grid[data-view="list"] a:hover img { transform: none; }
@media (max-width: 560px) { .project-grid[data-view="list"] .ph { width: 88px; } }
.empty-state { padding: var(--space-5) 0; color: var(--steel); }

/* Single project */
.project-head { padding-block: clamp(32px, 5vw, 72px) var(--space-4); }
.project-head h1 { max-width: 16ch; }
.project-hero { margin: 0; }
.project-hero img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; background: var(--paper-2); }
.project-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-5); padding-block: var(--space-5) var(--space-6); }
.project-body .overview p:first-child { font-size: var(--fs-lead); line-height: 1.5; }
.project-body .overview p { color: var(--steel); }
.project-body .overview p:first-child { color: var(--ink); }
.project-body h2 { font-size: var(--fs-h3); font-variation-settings: "wdth" 110; margin: var(--space-4) 0 var(--space-2); }
@media (max-width: 900px) { .project-body { grid-template-columns: 1fr; gap: var(--space-4); } }

/* Title block, styled after the information panel on a drawing sheet */
.title-block { align-self: start; position: sticky; top: calc(var(--header-h) + 24px); border: 1.5px solid var(--ink); margin: 0; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.title-block > div { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.title-block > div:nth-child(odd):not(.wide) { border-right: 1px solid var(--rule); }
.title-block .wide { grid-column: 1 / -1; }
.title-block dt { font-size: .8rem; color: var(--steel); }
.title-block dd { margin: 2px 0 0; font-weight: 650; font-variation-settings: "wdth" 104; line-height: 1.35; }
.title-block .stamp { border-bottom: 0; background: var(--ink); color: var(--paper); }
.title-block .stamp dd { display: flex; align-items: center; gap: 14px; margin: 0; }
.title-block .stamp svg { width: 92px; flex: none; }
.title-block .stamp span { font-size: var(--fs-small); color: var(--on-dark-muted); }
@media (max-width: 900px) { .title-block { position: static; } }

.views { padding-block: var(--space-6); }
.views-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.views-grid li { grid-column: span 4; }
.views-grid li:nth-child(1) { grid-column: span 8; grid-row: span 2; }
.views-grid button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--paper-2); cursor: zoom-in; position: relative; }
.views-grid img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: opacity .2s; }
.views-grid li:nth-child(1) img { aspect-ratio: auto; }
.views-grid button:hover img { opacity: .88; }
.views-grid .cap { position: absolute; left: 0; bottom: 0; padding: 6px 10px; background: var(--paper); color: var(--ink); font-size: .8rem; font-weight: 600; }
@media (max-width: 760px) {
  .views-grid { grid-template-columns: 1fr 1fr; }
  .views-grid li { grid-column: span 1; }
  .views-grid li:nth-child(1) { grid-column: 1 / -1; grid-row: auto; }
  .views-grid li:nth-child(1) img { aspect-ratio: 16 / 9; }
  /* First image is full width, so an even count leaves the last one alone: let it span the row */
  .views-grid li:last-child:nth-child(even) { grid-column: 1 / -1; }
}

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(15 24 30 / .96); color: var(--on-dark); }
.lightbox::backdrop { background: rgb(15 24 30 / .9); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox .lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--gutter); font-size: var(--fs-small); color: var(--on-dark-muted); }
.lightbox figure { margin: 0; display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: 12px var(--gutter) 20px; }
.lightbox .lb-bottom p { margin: 0; }
.lb-btn { min-width: 44px; min-height: 44px; padding: 0 16px; cursor: pointer; font: 600 .95rem var(--font); color: var(--on-dark); background: transparent; border: 1.5px solid #46575f; border-radius: 2px; }
.lb-btn:hover { border-color: var(--on-dark); }
.lb-nav { display: flex; gap: 8px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); }
.pager a { display: block; padding: var(--space-4) 0; text-decoration: none; }
.pager a + a { text-align: right; border-left: 1px solid var(--rule); padding-left: var(--space-3); }
.pager span { display: block; font-size: var(--fs-small); color: var(--steel); margin-bottom: 6px; }
.pager strong { font-size: var(--fs-h3); font-variation-settings: "wdth" 112; line-height: 1.2; }
.pager a:hover strong { color: var(--orange-text); }
@media (max-width: 600px) {
  .pager { grid-template-columns: 1fr; }
  .pager a + a { text-align: left; border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
}
.related { padding-block: var(--space-6); }

/* About */
.about-intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-5); }
.about-intro p:first-child { font-size: var(--fs-lead); line-height: 1.5; }
.about-intro p { color: var(--steel); }
.about-intro p:first-child { color: var(--ink); }
.band { margin: 0; }
.band img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; background: var(--paper-2); }
.band figcaption { margin-top: 10px; font-size: var(--fs-small); color: var(--steel); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.pair h2 { margin-bottom: var(--space-3); }
.pair p { color: var(--steel); }
@media (max-width: 900px) { .about-intro, .pair { grid-template-columns: 1fr; gap: var(--space-4); } }

/* Values: the initials spell PERKEL */
.values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid #2e3e47; }
.values li { padding: var(--space-3) var(--space-2) 0 0; }
.values li + li { padding-left: var(--space-2); border-left: 1px solid #2e3e47; }
.values .initial {
  display: block; font-weight: 800; line-height: .9; color: var(--on-dark);
  font-size: clamp(4rem, 2rem + 6vw, 8.5rem); font-variation-settings: "wdth" 125;
}
.values li:nth-child(odd) .initial { color: var(--orange); }
.values .word { display: block; margin-top: var(--space-2); font-weight: 600; color: var(--on-dark); }
@media (max-width: 900px) {
  .values { grid-template-columns: repeat(3, 1fr); }
  .values li:nth-child(4) { padding-left: 0; border-left: 0; }
  .values li:nth-child(n+4) { border-top: 1px solid #2e3e47; margin-top: var(--space-3); }
}
@media (max-width: 480px) { .values .initial { font-size: 3.5rem; } .values .word { font-size: .95rem; } }

.offices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.offices li { border-top: 3px solid var(--ink); padding-top: var(--space-2); }
.offices h3 { margin-bottom: 8px; }
.offices address { font-style: normal; color: var(--steel); margin-bottom: var(--space-2); }
@media (max-width: 760px) { .offices { grid-template-columns: 1fr; } }

/* Contact */
.contact-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--space-6); padding-block: var(--space-5) var(--space-6); }
@media (max-width: 960px) { .contact-layout { grid-template-columns: 1fr; gap: var(--space-5); } }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.form .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.field .req { font-weight: 400; color: var(--steel); font-size: var(--fs-small); }
.field .hint { display: block; font-size: var(--fs-small); color: var(--steel); margin: -4px 0 8px; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font: 400 1rem/1.4 var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid #9aa7ac; border-radius: 2px; transition: border-color .15s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--ink); outline: 3px solid var(--orange); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--error); }
.field .error { display: none; margin-top: 8px; color: var(--error); font-size: var(--fs-small); font-weight: 600; }
.field .error:not(:empty) { display: block; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.form-actions p { margin: 0; font-size: var(--fs-small); color: var(--steel); }
.error-summary { grid-column: 1 / -1; padding: var(--space-3); border: 2px solid var(--error); background: #fff; }
.error-summary h2 { font-size: 1.125rem; font-variation-settings: "wdth" 100; margin-bottom: 8px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); font-weight: 600; }
.form-success { padding: var(--space-4); background: #fff; border: 1.5px solid var(--ink); border-left: 6px solid var(--orange); }
.form-success h2 { font-size: var(--fs-h3); margin-bottom: 8px; }
.form-success p { margin: 0 0 var(--space-2); color: var(--steel); }

.contact-aside { display: grid; gap: var(--space-4); align-content: start; }
.contact-aside h2 { font-size: 1rem; font-variation-settings: "wdth" 100; color: var(--steel); font-weight: 600; margin-bottom: 6px; letter-spacing: 0; }
.contact-aside .big { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); font-weight: 700; font-variation-settings: "wdth" 112; text-decoration: none; line-height: 1.2; overflow-wrap: anywhere; }
.contact-aside .big:hover { color: var(--orange-text); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.contact-aside p { margin: 6px 0 0; color: var(--steel); }
.quote-card { padding: var(--space-3); background: var(--ink); color: var(--on-dark); }
.quote-card h2 { color: var(--on-dark); font-size: 1.25rem; font-variation-settings: "wdth" 112; }
.quote-card p { color: var(--on-dark-muted); margin: 8px 0 var(--space-3); }
.socials.on-light a { border-color: var(--rule); color: var(--ink); }
.socials.on-light a:hover { border-color: var(--ink); }
.socials.on-light { margin-top: 0; }
.section.flush-top { padding-top: 0; }
.form-title { font-size: var(--fs-h3); }

/* Request a quote */
.quote-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--space-5); padding-block: var(--space-5) var(--space-6); }
@media (max-width: 960px) { .quote-layout { grid-template-columns: 1fr; } }
.form-step { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 0 0 var(--space-3); padding: 0 0 var(--space-4); border: 0; border-bottom: 1px solid var(--rule); }
.form-step > legend { display: flex; align-items: baseline; gap: 14px; padding: 0; margin-bottom: var(--space-3); font-size: var(--fs-h3); font-weight: 700; font-variation-settings: "wdth" 112; }
.form-step > legend .n { color: var(--orange-text); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .form-step { grid-template-columns: 1fr; } }

.choices { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; min-width: 0; }
.choices legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.choices .req { font-weight: 400; color: var(--steel); font-size: var(--fs-small); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 12px; border: 1.5px solid #9aa7ac; border-radius: 2px; background: #fff; cursor: pointer; font-weight: 500; transition: border-color .15s, background-color .15s, color .15s; }
.chip:hover { border-color: var(--ink); }
.chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--orange); }
.chip:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.choices[aria-invalid="true"] .chip { border-color: var(--error); }
.choices .error { display: none; margin-top: 8px; color: var(--error); font-size: var(--fs-small); font-weight: 600; }
.choices .error:not(:empty) { display: block; }

.service-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.service-cards .chip { align-items: flex-start; padding: 14px 16px 14px 14px; min-height: 0; }
.service-cards .chip input { margin-top: 3px; flex: none; }
.service-cards strong { display: block; font-weight: 650; }
.service-cards small { display: block; font-size: var(--fs-small); color: var(--steel); font-weight: 400; margin-top: 2px; }
.service-cards .chip:has(input:checked) small { color: var(--on-dark-muted); }
@media (max-width: 600px) { .service-cards { grid-template-columns: 1fr; } }

.unit { position: relative; }
.unit input { padding-right: 52px; }
.unit .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--steel); pointer-events: none; }

.dropzone { display: grid; place-items: center; gap: 6px; padding: var(--space-4) var(--space-3); border: 1.5px dashed #9aa7ac; background: #fff; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--ink); background: var(--paper-2); }
.dropzone:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { font-weight: 650; }
.dropzone strong u { color: var(--orange-text); text-underline-offset: 3px; }
.dropzone span { font-size: var(--fs-small); color: var(--steel); }
.field [aria-invalid="true"] ~ .dropzone, .dropzone:has([aria-invalid="true"]) { border-color: var(--error); }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-small); }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--paper-2); }
.file-list li span { color: var(--steel); white-space: nowrap; }

.quote-aside { align-self: start; position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--space-3); }
.quote-aside .title-block { position: static; }
.title-block dd.empty { color: #8a979d; font-weight: 500; }
.quote-aside .help { font-size: var(--fs-small); color: var(--steel); }
.quote-aside .help p { margin: 0 0 6px; }
@media (max-width: 960px) { .quote-aside { position: static; order: -1; } .quote-aside .title-block { display: none; } }

/* Careers */
.benefits.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .benefits.three { grid-template-columns: 1fr; gap: var(--space-4); } }
.openings-empty { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; padding: var(--space-4); background: #fff; border: 1px solid var(--rule); border-left: 6px solid var(--ink); }
.openings-empty h3 { margin-bottom: 6px; }
.openings-empty p { margin: 0; color: var(--steel); }
.openings-empty svg { width: 40px; height: 40px; color: var(--steel); }
@media (max-width: 600px) { .openings-empty { grid-template-columns: 1fr; } }
.apply { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-5); }
.apply .big { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); font-weight: 700; font-variation-settings: "wdth" 112; overflow-wrap: anywhere; }
.apply-text p { color: var(--steel); }
@media (max-width: 900px) { .apply { grid-template-columns: 1fr; } }
.form.single { grid-template-columns: 1fr; }

/* Gallery */
.gallery { columns: 3 300px; column-gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.gallery li { break-inside: avoid; margin-bottom: var(--space-3); }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; text-align: left; color: inherit; font: inherit; }
.gallery img { width: 100%; height: auto; transition: opacity .2s; }
.gallery button:hover img { opacity: .88; }
.gallery .g-cap { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 0; background: var(--paper); font-size: var(--fs-small); }
.gallery .g-cap strong { font-weight: 600; }
.gallery .g-cap span { color: var(--steel); white-space: nowrap; }
.gallery button:hover .g-cap strong { text-decoration: underline; text-underline-offset: 3px; }
.field .label { display: block; margin-bottom: 8px; }
.on-dark .benefits h3 { border-top-color: var(--orange); }
.on-dark .benefits p { color: var(--on-dark-muted); }
.field .dropzone { display: grid; position: relative; margin: 0; font-weight: 400; }
.apply-text h2 { margin-bottom: var(--space-3); }
