/* ==========================================================
   Evacify — style.css
   Direction: safety-signage clarity. Exit-sign green, emergency red,
   deep navy, lots of white space, strict symmetrical grids.
   Mobile-first.
   ========================================================== */

:root {
  --ink: #0b1624;
  --navy: #0f2038;
  --navy-2: #172f4f;
  --bg: #f3f6fa;
  --white: #ffffff;
  --line: #dbe3ec;
  --text: #1c2b3d;
  --muted: #55667b;
  --green: #00c389;        /* brand emerald */
  --green-d: #007f5c;      /* emerald for text on light backgrounds (passes contrast) */
  --green-tint: #e2f8f0;
  --red: #e0192d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 22, 36, .09);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .35);
  --max: 1160px;
  --head: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", Arial, Helvetica, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .005em;
  margin: 0;
}

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--green); color: var(--ink); padding: 10px 16px; z-index: 1000; font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  font: 700 1rem/1 var(--body); letter-spacing: .02em;
  padding: 15px 28px; border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--green-d); }
.btn-primary { background: var(--green); color: var(--ink); }
.btn-primary:hover { background: #12dba0; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 195, 137, .35); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-sm { padding: 11px 20px; font-size: .95rem; }
.btn-block { width: 100%; padding: 17px; font-size: 1.05rem; }
.btn[disabled] { opacity: .7; cursor: wait; transform: none; }

/* ---------- Eyebrow label ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 .82rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--green);
}
.eyebrow::before { content: ""; width: 26px; height: 3px; border-radius: 2px; background: currentColor; }
.eyebrow-dark { color: var(--green-d); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 22, 36, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand-logo { display: inline-flex; line-height: 0; }
.logo-img, .logo-svg-fallback { width: 96px; height: auto; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.menu-toggle {
  background: none; border: 0; padding: 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; width: 42px;
}
.hamburger-line { display: block; height: 3px; width: 100%; background: var(--green); border-radius: 2px; transition: transform .25s, opacity .25s; }
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.primary-nav { flex-basis: 100%; order: 3; }
.js .primary-nav { display: none; }
.js .primary-nav.is-open { display: block; }
.nav-list { display: flex; flex-direction: column; padding: 6px 0 14px; }
.nav-link {
  display: block; padding: 13px 4px; text-decoration: none; font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--green); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 480px at 85% 10%, rgba(0, 195, 137, .16), transparent 60%),
    linear-gradient(180deg, var(--ink), var(--navy));
  padding: 44px 0 64px;
}
/* faint blueprint grid */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
  mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
}
.hero-grid { position: relative; display: grid; gap: 40px; align-items: center; }
.hero-copy { max-width: 600px; }
.hero h1 {
  font-size: clamp(2.3rem, 7.4vw, 3.2rem);
  text-transform: uppercase; font-weight: 800; line-height: .98;
  margin: 18px 0 20px;
}
.hero h1 .accent { color: var(--green); display: block; }
.hero-lead { font-size: 1.15rem; color: #c8d4e3; margin: 0 0 28px; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.trust-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.trust-chips li {
  font-size: .9rem; font-weight: 600; color: #e6edf6;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
}
.trust-chips li::before { content: "\2713"; color: var(--green); font-weight: 800; margin-right: 8px; }

/* Process video (YouTube facade: nothing loads from YouTube until the visitor clicks play) */
.video-figure { position: relative; min-width: 0; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .18); box-shadow: var(--shadow-lg);
  background:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(135deg, #1b3a5e, #0b1624);
  background-size: 32px 32px, 32px 32px, auto;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer;
  background: transparent; display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.video-play:focus-visible { outline: 3px solid #fff; outline-offset: -8px; }
.video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-poster-text {
  display: none; position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #fff;
  font: 700 1.1rem/1 var(--head); letter-spacing: .1em; text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.video-play-icon {
  position: relative; width: 76px; height: 76px; border-radius: 50%;
  background: var(--green); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px rgba(0, 195, 137, .25), 0 12px 30px rgba(0, 0, 0, .4);
  transition: transform .2s, box-shadow .2s;
}
.video-play:hover .video-play-icon { transform: scale(1.07); box-shadow: 0 0 0 14px rgba(0, 195, 137, .22), 0 12px 30px rgba(0, 0, 0, .4); }
.video-soon {
  position: absolute; inset: 0; margin: 0; padding: 20px; z-index: 2;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(11, 22, 36, .9); color: #fff; font-weight: 600; font-size: 1.05rem;
}
.video-soon[hidden] { display: none; }
.video-caption { margin-top: 12px; text-align: center; font-size: .88rem; color: #9fb0c6; }

/* Before / after section */
.slider-section { padding-bottom: 56px; }
.slider-figure { width: min(100%, 900px, calc(80vh * 1.6)); margin: 0 auto; }
.slider-figure .ba-slider {
  border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(11, 22, 36, .2);
}

/* ---------- Before / After slider ---------- */
.ba-slider {
  --pos: 50%;
  position: relative; width: 100%; aspect-ratio: 1200 / 750;
  overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
  cursor: ew-resize; background: #1b2638;
}
.ba-layer { position: absolute; inset: 0; }
.ba-layer img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

/* fallback fills if the photos are not uploaded yet */
.ba-before { background: linear-gradient(135deg, #4b5160, #2a2f3a); }
.ba-after  { background: linear-gradient(135deg, #1d6f5a, #0e3d33); clip-path: inset(0 0 0 var(--pos)); }

.ba-label {
  position: absolute; top: 12px; padding: 6px 12px; border-radius: 999px;
  background: rgba(11, 22, 36, .78); color: #fff; font: 700 .74rem/1 var(--body);
  letter-spacing: .12em; text-transform: uppercase; pointer-events: none; z-index: 2;
}
.ba-label-before { left: 12px; }
.ba-label-after  { right: 12px; background: var(--green); color: var(--ink); }

.ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 44px; margin-left: -22px;
  display: flex; justify-content: center; z-index: 3; cursor: ew-resize; outline: none;
}
.ba-handle::before {
  content: ""; width: 3px; height: 100%; background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, .5);
}
.ba-knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); border: 3px solid #fff; color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
}
.ba-handle:focus-visible .ba-knob { outline: 3px solid #fff; outline-offset: 3px; }
.ba-slider.is-dragging .ba-knob { transform: translate(-50%, -50%) scale(1.08); }

/* ---------- Stats strip (same compact blocks the old standards strip used) ---------- */
.stats-strip { background: var(--white); border-bottom: 1px solid var(--line); }
.stats-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 32px 0; }
.stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 104px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.stat-num {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font: 700 1.9rem/1.1 var(--head); color: var(--ink); letter-spacing: .02em;
}
.stat-star { color: #f5a623; width: .8em; height: .8em; }
.stat-label { margin-top: 4px; font-size: .88rem; line-height: 1.3; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-light { background: var(--bg); }
.section-white { background: var(--white); }
.section-dark { background: var(--navy); color: #fff; }

.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2, .split-copy h2, .contact-copy h2 {
  font-size: clamp(2.1rem, 6vw, 3.2rem); text-transform: uppercase; font-weight: 800; color: var(--ink);
}
.section-dark h2, .section-head-light h2 { color: #fff; }
.section-lead { margin: 16px 0 0; font-size: 1.1rem; color: var(--muted); }
.section-dark .section-lead, .section-head-light .section-lead { color: #bccadc; }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 24px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card-grid { display: grid; gap: 18px; }

.service-card:hover { transform: translateY(-5px); border-color: var(--green); box-shadow: 0 18px 40px rgba(11, 22, 36, .14); }
.service-card h3 { font-size: 1.6rem; color: var(--ink); margin: 18px 0 8px; }
.service-card p { margin: 0; color: var(--muted); }

.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px; background: var(--green-tint); color: var(--green-d);
}
.more-note { text-align: center; margin: 28px 0 0; color: var(--muted); }
.more-note a { color: var(--green-d); font-weight: 700; }

/* ---------- Process ---------- */
.steps { display: grid; gap: 18px; counter-reset: step; }
.step {
  position: relative; text-align: center; padding: 34px 24px 28px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.step-num {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--green); color: var(--ink); font: 800 1.5rem/1 var(--head);
  box-shadow: 0 0 0 6px var(--white);
}
.step-title { font-size: 1.6rem; color: var(--ink); margin: 10px 0 8px; }
.step-desc { margin: 0; color: var(--muted); }
.steps { margin-top: 28px; }

/* ---------- Our work: 2 cards per row on every screen ---------- */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 auto; }
.project-card {
  display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 14px 34px rgba(0, 0, 0, .25);
  transition: transform .25s, border-color .25s;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--green); }
.project-card:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.project-card-figure { position: relative; display: block; flex: none; width: 100%; aspect-ratio: 600 / 420; overflow: hidden; background: #e8edf3; }
.project-img { width: 100%; height: 100%; object-fit: cover; }
.project-card-header {
  flex: none; display: flex; align-items: center; height: 70px; padding: 0 12px; overflow: hidden;
  font: 700 clamp(.95rem, 4.3vw, 1.1rem)/1.1 var(--head); letter-spacing: .01em; text-transform: uppercase; color: #fff;
  border-top: 3px solid var(--green);
}
.project-badge {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: var(--ink); font: 700 .72rem/1 var(--body);
  padding: 7px 10px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.project-placeholder, .gallery-placeholder {
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; color: #3a4b61; padding: 12px;
  background:
    linear-gradient(rgba(15, 32, 56, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 32, 56, .07) 1px, transparent 1px), #e8edf3;
  background-size: 22px 22px;
}
.project-placeholder { position: absolute; inset: 0; }
.gallery-placeholder { aspect-ratio: 1200 / 850; border-radius: 10px; border: 1px solid var(--line); }
.placeholder-dim { font: 700 1.1rem/1.1 var(--head); text-transform: uppercase; letter-spacing: .04em; }
.placeholder-path { font-size: .74rem; opacity: .75; word-break: break-all; }

/* ---------- Popup gallery (native <dialog>) ---------- */
html.modal-open { overflow: hidden; }
.gallery-dialog {
  width: min(920px, calc(100% - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: var(--white); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.gallery-dialog[open] { display: flex; flex-direction: column; }
.gallery-dialog::backdrop { background: rgba(7, 14, 24, .8); backdrop-filter: blur(3px); }
.gallery-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 20px; background: var(--white); border-bottom: 1px solid var(--line);
}
.gallery-head h3 { font-size: 1.5rem; text-transform: uppercase; color: var(--ink); }
.gallery-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--bg); color: var(--ink); display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, transform .2s;
}
.gallery-close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }
.gallery-close:focus-visible { outline: 3px solid var(--green-d); outline-offset: 2px; }
.gallery-scroll {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: grid; gap: 16px; padding: 16px; background: var(--bg);
}
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--white); }

/* ---------- Split (flexible work) ---------- */
.split { display: grid; gap: 36px; align-items: center; }
.split-copy .eyebrow { margin-bottom: 14px; }
.split-copy p { margin: 18px 0 0; color: var(--muted); font-size: 1.08rem; }
.split-copy .btn { margin-top: 28px; }
.split-panel { display: grid; gap: 16px; }
.mini-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; box-shadow: var(--shadow);
}
.mini-card h3 { font-size: 1.65rem; color: var(--ink); margin-bottom: 8px; }
.mini-card p { margin: 0; color: var(--muted); }
.mini-card-accent { background: var(--navy); border-color: var(--navy); }
.mini-card-accent h3 { color: #fff; }
.mini-card-accent p { color: #bccadc; }

/* ---------- Why Evacify ---------- */
.backend-info-card { padding: 0; overflow: hidden; border-top: 4px solid var(--green); }
.backend-card-header {
  font: 800 1.5rem/1.1 var(--head); text-transform: uppercase; color: var(--ink);
  padding: 24px 24px 0;
}
.backend-card-body { padding: 16px 24px 26px; }
.tick-list li { position: relative; padding: 8px 0 8px 30px; color: var(--muted); }
.tick-list li::before {
  content: "\2713"; position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-tint); color: var(--green-d); font-size: .75rem; font-weight: 800;
}

/* ---------- Contact ---------- */
.contact-section { background: linear-gradient(180deg, var(--navy), var(--ink)); }
.contact-grid { display: grid; gap: 40px; align-items: start; }
.contact-copy .eyebrow { margin-bottom: 14px; }
.contact-copy h2 { color: #fff; }

.next-steps { margin: 28px 0; counter-reset: ns; display: grid; gap: 14px; }
.next-steps li {
  counter-increment: ns; position: relative; padding-left: 52px; color: #bccadc; line-height: 1.4;
}
.next-steps li::before {
  content: counter(ns); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 195, 137, .15); border: 1px solid var(--green); color: var(--green);
  font: 800 1.15rem/1 var(--head);
}
.next-steps strong { color: #fff; display: block; }

.social-links-row { display: flex; flex-wrap: wrap; gap: 10px; }
.social-circle {
  width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: var(--ink);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  transition: transform .2s, background .2s;
}
.social-circle:hover { background: #fff; transform: translateY(-2px); }
.social-circle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.inquiry-form {
  background: var(--white); color: var(--text); border-radius: 18px;
  padding: 28px 22px; box-shadow: var(--shadow-lg); border-top: 5px solid var(--green);
}
.form-title { font-size: 1.9rem; text-transform: uppercase; color: var(--ink); }
.form-notice { margin: 8px 0 22px; color: var(--muted); font-size: .98rem; }
.form-grid { display: grid; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group label { font-size: .92rem; font-weight: 700; color: var(--ink); }
.required-marker { color: var(--red); }
.optional-marker { font-weight: 500; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea {
  font: inherit; font-size: 1rem; padding: 13px 14px; width: 100%;
  border: 1.5px solid #c5d0dd; border-radius: 10px; background: #fff; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--green-d); box-shadow: 0 0 0 4px rgba(0, 195, 137, .2);
}
.form-group.has-error input, .form-group.has-error textarea { border-color: var(--red); }
.field-error { color: #b0121f; font-size: .85rem; font-weight: 600; }
.form-status { margin: 14px 0; font-weight: 700; font-size: .98rem; }
.form-status:empty { margin: 0; }
.form-status.is-success { color: #006b4c; background: var(--green-tint); padding: 12px 14px; border-radius: 10px; }
.form-status.is-error { color: #8d0f1a; background: #fde8ea; padding: 12px 14px; border-radius: 10px; }

/* honeypot: off-screen, not display:none (some bots skip display:none fields) */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #aab9cc; position: relative; }
.footer-inner { padding-top: 26px; padding-bottom: 26px; text-align: center; }
.copyright-line { margin: 0; font-size: .95rem; }
.copyright-line strong { color: #fff; }
.footer-link { text-decoration: none; border-bottom: 2px solid var(--green); }
.footer-link:hover { color: var(--green); }

.back-to-top {
  position: fixed; right: 16px; bottom: 16px; width: 46px; height: 46px; z-index: 90;
  background: var(--green); color: var(--ink); display: flex; align-items: center; justify-content: center;
  border-radius: 12px; text-decoration: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s, transform .2s;
}
.back-to-top:hover { transform: translateY(-3px); }
.back-to-top.is-visible { opacity: 1; visibility: visible; }
.no-js .back-to-top { opacity: 1; visibility: visible; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .stats-list { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .stat { min-height: 92px; }
  .project-card-header { font-size: 1.4rem; height: 72px; padding: 0 18px; }
  .project-badge { right: 12px; bottom: 12px; font-size: .8rem; padding: 8px 12px; }
  .gallery-head h3 { font-size: 1.9rem; }
  .gallery-scroll { padding: 24px; gap: 24px; }
  .card-grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-group-full { grid-column: 1 / -1; }
  .inquiry-form { padding: 36px 34px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .container { padding-left: 32px; padding-right: 32px; }
  .logo-img, .logo-svg-fallback { width: 112px; }

  .menu-toggle { display: none; }
  .primary-nav, .js .primary-nav { display: block; flex-basis: auto; order: 2; }
  .header-actions { order: 3; }
  .brand-logo { order: 1; }
  .nav-list { flex-direction: row; gap: 26px; padding: 0; }
  .nav-link { border: 0; padding: 8px 0; font-size: .98rem; position: relative; }
  .nav-link::after {
    content: ""; position: absolute; left: 0; bottom: 2px; width: 0; height: 2px; background: var(--green); transition: width .2s;
  }
  .nav-link:hover::after, .nav-link:focus-visible::after { width: 100%; }

  .hero { padding: 80px 0 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 44px; }
  .projects-grid { gap: 24px; }

  .section { padding: 96px 0; }
  .section-head { margin-bottom: 52px; }

  .card-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
  .step { padding: 40px 28px 32px; }

  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .contact-grid { grid-template-columns: 1fr 1.1fr; gap: 64px; }
  .contact-copy { position: sticky; top: 110px; }
}

/* ---------- Phones (under 640px): bigger slider and bigger work cards ---------- */
@media (max-width: 639px) {
  /* Slider runs edge to edge (about 11% wider than before) and is taller (4:3) so the diagram is larger. */
  .slider-figure { width: auto; max-width: none; margin: 0 -20px; }
  .slider-figure .ba-slider { aspect-ratio: 4 / 3; border-radius: 0; border-left: 0; border-right: 0; }

  /* Work cards: use more of the screen width and show a taller picture. */
  .projects-grid { margin: 0 -8px; gap: 10px; }
  .project-card-figure { aspect-ratio: 4 / 3; }
  .project-badge { font-size: .78rem; padding: 8px 11px; }
}

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