/* ===========================================================================
   SHIFAT Architectures — Design System
   Industrial / editorial: dense grid, structural rules, one signal accent.
   =========================================================================== */

:root {
  /* Palette */
  --ink:        #14161a;   /* near-black charcoal, primary text on light */
  --ink-soft:   #4b4f57;   /* secondary text on light */
  --concrete:   #ece9e2;   /* warm off-white section bg */
  --concrete-2: #ddd8cd;   /* slightly deeper warm neutral, borders on light */
  --steel:      #1c1f26;   /* dark section bg */
  --steel-2:    #262a33;   /* dark section bg, raised */
  --line-dark:  #3a3f4a;   /* rule lines on dark */
  --paper:      #ffffff;
  --signal:     #d5601a;   /* safety-orange accent — used sparingly */
  --signal-2:   #f2f0eb;   /* signal tint background */
  --on-dark:    #eceae4;   /* body text on dark sections */
  --on-dark-soft: #9a9fab;

  --font-head: 'Big Shoulders Display', 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* Fixed grain layer — a faint texture over every section so flat digital
   color reads a little more like printed/industrial material. Same overlay
   works on light and dark sections because `overlay` blend adapts to what's
   underneath. Disabled for users who've asked for less motion/visual noise. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
@media (prefers-reduced-motion: reduce) { body::after { display: none; } }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  margin: 0 0 0.5em;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 700;
}
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
li { list-style: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 1em;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--signal);
  display: inline-block;
}

/* ---- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.95em 1.6em;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.25s var(--ease-out-expo);
  background: transparent;
  color: var(--ink);
  will-change: transform;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.btn-signal:hover { background: var(--ink); border-color: var(--ink); }
.btn-on-dark { border-color: var(--on-dark); color: var(--on-dark); }
.btn-on-dark:hover { background: var(--on-dark); color: var(--steel); }

/* ---- Header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--concrete-2);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.logo small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}
.main-nav ul { display: flex; gap: 2.1rem; align-items: center; }
.main-nav a {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  padding: 6px 0;
}
.main-nav a.active {
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.main-nav a.active::before { content: '['; margin-right: 0.3em; }
.main-nav a.active::after { content: ']'; margin-left: 0.3em; }
.main-nav a:hover { color: var(--signal); }
.nav-cta {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  border: 1.5px solid var(--ink);
  padding: 0.6em 1.2em;
  border-radius: 2px;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ---- Mobile navigation ------------------------------------------------------
   Below 860px the inline nav becomes a full-screen overlay panel driven by
   the hamburger button. The button must exist in the markup (header.php) —
   without it the nav would simply vanish on phones. */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;          /* >=44px: iOS minimum touch target */
  padding: 0;
  background: transparent;
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  z-index: 120;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  margin: 4px auto;
  background: var(--ink);
  transition: transform 0.28s var(--ease-out-expo), opacity 0.2s ease;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: fixed;
    inset: 0;
    background: var(--steel);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-out-expo), visibility 0.3s;
    /* Respect notches / home indicators on iPhone */
    padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  body.nav-open .main-nav { opacity: 1; visibility: visible; }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 340px;
    text-align: center;
  }
  .main-nav li { border-bottom: 1px solid var(--line-dark); }
  .main-nav li:last-child { border-bottom: 0; margin-top: 1.4rem; }
  .main-nav a {
    display: block;
    padding: 1.05rem 0.5rem;          /* generous tap target */
    font-family: var(--font-head);
    font-size: 1.35rem;
    text-transform: uppercase;
    color: var(--on-dark);
  }
  .main-nav a.active { color: var(--signal); font-size: 1.35rem; }
  .main-nav .nav-cta {
    display: inline-block;
    border-color: var(--on-dark);
    color: var(--on-dark);
    font-size: 0.95rem;
    padding: 0.8em 1.6em;
  }
  /* Lock background scroll while the overlay is open */
  body.nav-open { overflow: hidden; }
}

/* ---- Hero --------------------------------------------------------------- */
.hero {
  background: var(--steel);
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
  padding: clamp(70px, 12vw, 140px) 0 clamp(90px, 11vw, 140px);
}
/* Soften the hard dark->light seam: fade the steel down toward the
   concrete tone that the next section now uses, instead of cutting
   straight to white. */
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: clamp(60px, 10vw, 140px);
  background: linear-gradient(to bottom, transparent, var(--concrete));
  pointer-events: none;
}
.hero-grid {
  display: grid;
  /* Even split -- the massing viewer reads as co-equal with the headline,
     not a small illustration beside it. */
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  color: var(--paper);
}
.hero h1 em { color: var(--signal); font-style: normal; }
.hero p.lede {
  font-size: 1.15rem;
  color: var(--on-dark-soft);
  max-width: 46ch;
  margin-bottom: 2em;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-diagram { width: 100%; }

/* ---- Aerial fly-over gallery -----------------------------------------------
   Animated camera moves across real aerial photographs (pan + zoom), with a
   survey-style HUD. Not a 3D reconstruction — a moving crop of a real plate. */
.flyover {
  position: relative;
  background: var(--steel);
  overflow: hidden;
  height: clamp(340px, 52vw, 620px);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.flyover-plate {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease-out-expo);
  pointer-events: none;
}
.flyover-plate.is-active { opacity: 1; }
.flyover-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  filter: contrast(1.08) saturate(0.95) brightness(0.86);
  will-change: transform;
}
.flyover-plate.is-active img { animation: flyover-pass 13s linear both; }
.flyover-plate[data-move="push-in"].is-active img { animation-name: flyover-push-in; }
.flyover-plate[data-move="pull-back"].is-active img { animation-name: flyover-pull-back; }
.flyover-plate[data-move="track-right"].is-active img { animation-name: flyover-track-right; }

@keyframes flyover-pass {
  from { transform: scale(1.16) translate3d(-2.5%, 1.5%, 0); }
  to   { transform: scale(1.24) translate3d(2.5%, -1.5%, 0); }
}
@keyframes flyover-push-in {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.28) translate3d(-1.5%, -2%, 0); }
}
@keyframes flyover-pull-back {
  from { transform: scale(1.3) translate3d(2%, -2%, 0); }
  to   { transform: scale(1.03) translate3d(0, 0, 0); }
}
@keyframes flyover-track-right {
  from { transform: scale(1.2) translate3d(-5%, 0, 0); }
  to   { transform: scale(1.2) translate3d(5%, 0, 0); }
}

.flyover::before {
  /* vignette + legibility scrim */
  content: '';
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to top, rgba(12,13,16,0.88) 0%, rgba(12,13,16,0.18) 42%, rgba(12,13,16,0.42) 100%);
}
/* Survey crosshair / frame ticks, drawn in CSS so there's no extra request */
.flyover-hud {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
}
.flyover-hud span {
  position: absolute;
  width: 16px; height: 16px;
  border: 1px solid rgba(236, 233, 225, 0.5);
}
.flyover-hud span:nth-child(1) { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.flyover-hud span:nth-child(2) { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.flyover-hud span:nth-child(3) { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.flyover-hud span:nth-child(4) { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

.flyover-meta {
  position: absolute; z-index: 4;
  left: clamp(1rem, 3vw, 2.4rem);
  bottom: clamp(1.2rem, 3vw, 2.4rem);
  max-width: 70%;
}
.flyover-eyebrow {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--signal); display: block; margin-bottom: 0.5rem;
}
.flyover-caption {
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.3rem, 2.6vw, 2rem); color: var(--paper); line-height: 1.05;
}
.flyover-readout {
  position: absolute; z-index: 4;
  right: clamp(1rem, 3vw, 2.4rem); top: clamp(1rem, 3vw, 2.2rem);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--on-dark-soft); text-align: right; white-space: pre-line;
}
.flyover-nav {
  position: absolute; z-index: 5; top: 50%; transform: translateY(-50%);
  width: 38px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: rgba(20,22,26,0.55); border: 1px solid var(--line-dark);
  color: var(--on-dark); font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 2px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.flyover-nav:hover, .flyover-nav:focus-visible { background: var(--signal); border-color: var(--signal); color: #fff; outline: none; }
.flyover-prev { left: 0.7rem; }
.flyover-next { right: 0.7rem; }
.flyover-dots {
  position: absolute; z-index: 5;
  right: clamp(1rem, 3vw, 2.4rem); bottom: clamp(1.2rem, 3vw, 2.4rem);
  display: flex; gap: 0.42rem;
}
.flyover-dots button {
  width: 8px; height: 8px; padding: 0; border-radius: 50%;
  border: 1px solid var(--on-dark-soft); background: transparent; cursor: pointer;
}
.flyover-dots button.is-active { background: var(--signal); border-color: var(--signal); }

@media (prefers-reduced-motion: reduce) {
  .flyover-plate.is-active img { animation: none !important; transform: scale(1.04); }
  .flyover-plate { transition: none; }
}

/* ---- Long-exposure light-trail band ---------------------------------------
   A real dusk site photograph with an animated light-streak layer drawn
   over it in canvas — the long-exposure look, without altering the photo. */
.light-trail-band {
  position: relative;
  overflow: hidden;
  background: var(--steel);
  min-height: clamp(320px, 46vw, 560px);
  display: flex;
  align-items: flex-end;
}
.light-trail-band > img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.52) contrast(1.18) saturate(0.9);
}
.light-trail-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.light-trail-band::before {
  /* keeps the copy legible over the brighter parts of the plate */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,13,16,0.92) 0%, rgba(12,13,16,0.35) 45%, rgba(12,13,16,0.1) 100%);
}
.light-trail-content {
  position: relative;
  z-index: 2;
  padding: clamp(2rem, 5vw, 4rem) 0;
  width: 100%;
}
.light-trail-content h2 { color: var(--paper); max-width: 24ch; }
.light-trail-content p { color: var(--on-dark-soft); max-width: 52ch; }

/* ---- 3D massing viewer -------------------------------------------------- */
.massing-viewer {
  position: relative;
  width: 100%;
  /* Fallback for browsers without aspect-ratio: a definite height, so the
     container never depends on its (absolutely positioned) canvas child.
     Sized to roughly half the viewport on the hero, now that its column
     is co-equal width with the headline. */
  height: clamp(340px, 42vw, 620px);
  max-height: 720px;
  border: 1px solid var(--line-dark);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(213,96,26,0.08), transparent 60%),
    var(--steel);
  cursor: grab;
  overflow: hidden;
}
.massing-viewer:active { cursor: grabbing; }
/* The canvas MUST be out of normal flow. If it participates in layout, the
   renderer sizing the canvas grows the container, which re-fires the
   ResizeObserver, which grows it again — an infinite height feedback loop. */
.massing-viewer canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.massing-hint {
  position: absolute;
  left: 1rem; bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  pointer-events: none;
  opacity: 0.85;
}
.massing-viewer-label {
  position: absolute;
  left: 1rem; top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  pointer-events: none;
  z-index: 3;
}
.massing-viewer:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }

/* Carousel arrows */
.massing-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 22, 26, 0.6);
  border: 1px solid var(--line-dark);
  color: var(--on-dark);
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.massing-nav:hover, .massing-nav:focus-visible {
  background: var(--signal); border-color: var(--signal); color: #fff; outline: none;
}
.massing-nav-prev { left: 0.6rem; }
.massing-nav-next { right: 0.6rem; }

/* Scene dots */
.massing-dots {
  position: absolute;
  right: 1rem; bottom: 0.95rem;
  display: flex; gap: 0.4rem; z-index: 4;
}
.massing-dots button {
  width: 8px; height: 8px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--on-dark-soft);
  background: transparent;
  cursor: pointer;
}
.massing-dots button.is-active { background: var(--signal); border-color: var(--signal); }

/* Build-sequence phase caption + progress bar */
.massing-caption {
  position: absolute;
  left: 1rem; bottom: 2.4rem;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark);
  pointer-events: none;
  max-width: 70%;
}
.massing-caption:not(:empty)::after {
  content: '';
  display: block;
  margin-top: 0.4rem;
  height: 2px;
  width: var(--phase-progress, 0%);
  background: var(--signal);
  transition: width 0.2s linear;
}
@media (max-width: 600px) {
  .massing-nav { width: 30px; height: 42px; font-size: 1.2rem; }
  .massing-caption { font-size: 0.62rem; bottom: 2.2rem; }
}
@supports (aspect-ratio: 4/3) {
  .massing-viewer { height: auto; aspect-ratio: 4/3; }
}
/* Static SVG shown when WebGL/Three.js is unavailable. */
.massing-viewer.massing-fallback { cursor: default; }
.massing-viewer.massing-fallback svg {
  position: absolute;
  inset: 0;
  width: 82%;
  height: 82%;
  margin: auto;
}
@media (max-width: 760px) {
  .massing-viewer { height: clamp(280px, 74vw, 420px); }
  @supports (aspect-ratio: 1/1) { .massing-viewer { height: auto; aspect-ratio: 1/1; } }
}
.hero-stats {
  margin-top: clamp(50px, 7vw, 90px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-dark);
  border-top: 1px solid var(--line-dark);
}
.hero-stats div {
  background: var(--steel);
  padding: 1.4rem 1.2rem;
}
.hero-stats .num {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  display: block;
}
.hero-stats .label {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Section scaffolding ------------------------------------------------- */
section { padding: clamp(60px, 9vw, 120px) 0; }
.section-light { background: var(--paper); }
.section-concrete {
  background: var(--concrete);
  /* Faint blueprint grid — drafting-paper texture, not decoration for its
     own sake; it's the one section style that gets it since it's used for
     the more "reference material" sections (portfolio, services grid). */
  background-image:
    linear-gradient(rgba(20,22,26,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,22,26,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}
.section-dark { background: var(--steel); color: var(--on-dark); }
.section-dark h2, .section-dark h3 { color: var(--paper); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: clamp(2.4rem, 5vw, 4rem);
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); max-width: 22ch; }
.section-head .desc { max-width: 42ch; color: var(--ink-soft); }
.section-dark .section-head .desc { color: var(--on-dark-soft); }

/* ---- Focus-area / service cards ------------------------------------------ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--concrete-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--concrete-2); }
.card {
  background: var(--paper);
  padding: 2.4rem 2rem;
  position: relative;
}
.card .idx {
  font-family: var(--font-mono);
  color: var(--signal);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}
.card h3 { margin-top: 0.8em; font-size: 1.25rem; }
.card p { color: var(--ink-soft); font-size: 0.96rem; }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Services: core specialism cards + full range list -------------------- */
.card-core {
  background: var(--steel-2);
  border-left: 3px solid var(--signal);
}
.card-core h3 { color: var(--paper); font-size: 1.3rem; }
.card-core p { color: var(--on-dark-soft); }

.service-group { margin-bottom: clamp(2.4rem, 4vw, 3.6rem); }
.service-group-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  padding-bottom: 0.7rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--concrete-2);
}
.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem 2rem;
}
.service-item { position: relative; padding-left: 1rem; }
.service-item::before {
  content: '';
  position: absolute; left: 0; top: 0.45em;
  width: 4px; height: 4px;
  background: var(--signal);
}
.service-item h4 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  margin-bottom: 0.35em;
  letter-spacing: 0;
}
.service-item p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* ---- Philosophy / quote --------------------------------------------------- */
.quote-block {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.quote-block blockquote {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 1.4rem;
}
.quote-block cite {
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}

/* ---- Portfolio grid -------------------------------------------------------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 1.6vw, 24px);
}
.pf-card {
  background: var(--paper);
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
  transition: border-color 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
}
.pf-card:hover { border-color: var(--signal); transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) {
  .pf-card { transition: none; }
  .pf-card:hover { transform: none; }
}
.pf-thumb {
  aspect-ratio: 16/10;
  background: var(--steel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pf-thumb svg { width: 60%; opacity: 0.85; }
.pf-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.55) contrast(1.05);
  transition: filter 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.pf-card:hover .pf-thumb img { filter: grayscale(0); transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .pf-thumb img { transition: none; }
  .pf-card:hover .pf-thumb img { transform: none; }
}
.pf-body { padding: 1.8rem 1.9rem 2.1rem; }
.pf-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
  font-weight: 600;
}
.pf-body h3 { margin-top: 0.5em; font-size: 1.3rem; }
.pf-meta {
  display: flex; gap: 0.6rem; margin-top: 1.1rem;
  flex-wrap: wrap;
}
.pf-meta span {
  display: block;
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
  padding: 0.45em 0.7em;
  font-size: 0.76rem;
  color: var(--ink-soft);
}
.pf-meta strong {
  color: var(--ink);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) { .portfolio-grid { grid-template-columns: 1fr; } }

/* ---- Portfolio: category filter bar + sectioned groups ------------------- */
.portfolio-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.portfolio-view-toggle {
  display: flex;
  gap: 0.3rem;
  padding: 0.25rem;
  background: var(--concrete-2);
  border-radius: 999px;
  flex: 0 0 auto;
}
.portfolio-view-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5em 1em;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.portfolio-view-btn.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
:lang(he) .portfolio-view-btn { letter-spacing: normal; }

#portfolio-map {
  width: 100%;
  height: clamp(360px, 48vw, 560px);
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
  background: var(--concrete);
}
/* Leaflet's own control positioning is physical (left/right), not
   direction-aware -- mirror it explicitly for RTL rather than leave the
   zoom control stranded on the visually-wrong side. */
[dir="rtl"] #portfolio-map .leaflet-left { right: 0; left: auto; }
[dir="rtl"] #portfolio-map .leaflet-control { margin-left: 0; margin-right: 10px; }

.portfolio-filter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.6em 1.2em;
  border: 1.5px solid var(--concrete-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.portfolio-filter:hover { border-color: var(--signal); color: var(--ink); }
.portfolio-filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.portfolio-category { margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.portfolio-category:last-child { margin-bottom: 0; }
.portfolio-category[hidden] { display: none; }
.portfolio-category-heading {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  margin-bottom: 1.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--concrete-2);
}
:lang(he) .portfolio-filter { letter-spacing: normal; }

.placeholder-flag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--signal-2);
  color: var(--signal);
  border: 1px solid var(--signal);
  padding: 0.25em 0.6em;
  border-radius: 2px;
  margin-bottom: 0.8em;
}

/* ---- Process steps: industrial production-line ----------------------------
   A vertical "rail" runs the length of the sequence with a fill that
   advances as the section scrolls (driven by main.js), and each numbered
   node "locks in" — lit, then dimmed once passed — like a station on a
   line rather than a plain fade-up card. */
.process-line { position: relative; }
.process-line-rail {
  position: absolute;
  left: 39px;
  top: 0; bottom: 0;
  width: 4px;
  background:
    repeating-linear-gradient(180deg, var(--concrete-2) 0 10px, var(--paper) 10px 14px);
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}
.process-line-fill {
  position: absolute;
  top: 0; left: 0; width: 100%;
  height: 0%;
  background: var(--signal);
  box-shadow: 0 0 10px 1px rgba(213, 96, 26, 0.55);
  transition: height 0.1s linear;
}
.process-list { position: relative; padding-left: 88px; }
.process-row {
  position: relative;
  display: flex;
  gap: 1.6rem;
  padding: 1.8rem 0;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.process-row.is-visible { opacity: 1; transform: none; }
.process-node-marker {
  position: absolute;
  left: -88px;
  top: 1.8rem;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--concrete-2);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  z-index: 2;
}
.process-node-marker::before {
  /* bolt-head ticks around the rim, like a stamped steel plate */
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed var(--concrete-2);
}
.process-row.is-active .process-node-marker {
  border-color: var(--signal);
  background: var(--signal);
  box-shadow: 0 0 0 5px rgba(213, 96, 26, 0.15);
}
.process-row.is-active .step-num { color: var(--paper); }
.process-node-marker .step-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}
.process-panel {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--concrete-2);
  border-left: 3px solid var(--concrete-2);
  padding: 1.5rem 1.6rem;
  transition: border-left-color 0.3s ease;
}
.process-row.is-active .process-panel { border-left-color: var(--signal); }
.process-panel h3 { font-size: 1.15rem; margin-bottom: 0.3em; }
.process-panel p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

@media (max-width: 760px) {
  .process-line-rail { left: 27px; }
  .process-list { padding-left: 60px; }
  .process-node-marker { left: -60px; width: 56px; height: 56px; }
  .process-node-marker .step-num { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .process-row { opacity: 1; transform: none; transition: none; }
  .process-line-fill { transition: none; }
}

/* ---- Forms -------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1.6rem; }
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--ink-soft);
}
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85em 1em;
  border: 1.5px solid var(--concrete-2);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--signal);
}
textarea { resize: vertical; min-height: 130px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.alert {
  padding: 1em 1.3em;
  border-radius: 2px;
  margin-bottom: 1.6rem;
  font-size: 0.94rem;
}
.alert-success { background: #e9f3ea; color: #2c5c33; border: 1px solid #bcdcc0; }
.alert-error { background: #fbeae7; color: #9c2b1a; border: 1px solid #f2c3ba; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--steel);
  color: var(--on-dark-soft);
  padding: clamp(50px, 7vw, 90px) 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line-dark);
}
.footer-grid h4 {
  color: var(--paper);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.1em;
}
.footer-grid li { margin-bottom: 0.6em; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--signal); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.6rem; font-size: 0.8rem; flex-wrap: wrap; gap: 0.6rem;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Shared team photo (About page) ---------------------------------------- */
.team-shared-photo {
  margin-bottom: 2.5rem;
  border-radius: 2px;
  overflow: hidden;
}
.team-shared-photo img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* ---- Team cards (About page) ----------------------------------------------- */
.team-card { display: flex; flex-direction: column; }
.team-photo {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.2rem;
  filter: grayscale(0.3) contrast(1.05);
  transition: filter 0.4s var(--ease-out-expo);
}
.card:hover .team-photo { filter: grayscale(0); }

/* ---- Notable clients strip -------------------------------------------------- */
.clients-marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  padding: 1.6rem 0;
}
.clients-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee-scroll 38s linear infinite;
}
.clients-track span {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-soft);
  white-space: nowrap;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .clients-track { animation: none; }
  .clients-marquee { overflow-x: auto; }
}

/* ---- Detail "more views" strip + lightbox ---------------------------------
   Small chips under the hero image; clicking one opens a lightbox drill-in
   rather than repeating the same project as a second full-width image. */
.detail-strip { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.detail-chip {
  padding: 0; border: 1px solid var(--line-dark); background: none;
  cursor: pointer; border-radius: 2px; overflow: hidden;
  width: 132px; height: 84px; flex: 0 0 auto;
  transition: border-color 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
}
.detail-chip img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4); transition: filter 0.3s ease; }
.detail-chip:hover, .detail-chip:focus-visible { border-color: var(--signal); transform: translateY(-2px); outline: none; }
.detail-chip:hover img, .detail-chip:focus-visible img { filter: grayscale(0); }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12, 13, 16, 0.94);
  display: none; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 2px; }
.lightbox-caption {
  position: absolute; bottom: 1.4rem; left: 0; right: 0; text-align: center;
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--on-dark-soft);
}
.lightbox-close {
  position: absolute; top: 1.1rem; right: 1.3rem;
  background: none; border: 1px solid var(--on-dark-soft); color: var(--on-dark);
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em;
  padding: 0.45em 0.9em; border-radius: 2px; cursor: pointer;
}
.lightbox-close:hover { border-color: var(--signal); color: var(--signal); }

@media (max-width: 600px) { .detail-chip { width: 104px; height: 68px; } }
@media (prefers-reduced-motion: reduce) {
  .detail-chip, .detail-chip img { transition: none; }
  .detail-chip:hover, .detail-chip:focus-visible { transform: none; }
}

/* ---- Studio interior mini-grid --------------------------------------------- */
.studio-interior-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Real separation between plates, not a hairline — images butting
     directly together read as one confusing composite. */
  gap: clamp(10px, 1.4vw, 20px);
  margin-top: clamp(10px, 1.4vw, 20px);
}
.studio-interior-grid a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
}
.studio-interior-grid img {
  width: 100%;
  height: clamp(220px, 26vw, 340px);
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.05);
  transition: filter 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.studio-interior-grid a:hover img { filter: grayscale(0); transform: scale(1.02); }
@media (max-width: 760px) { .studio-interior-grid { grid-template-columns: 1fr; } }

/* ---- Studio visit band (About page) --------------------------------------- */
.studio-visit-band {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}
.studio-visit-band img {
  width: 100%;
  height: clamp(260px, 42vw, 460px);
  object-fit: cover;
  filter: grayscale(0.35) brightness(0.72) contrast(1.08);
  transition: filter 0.6s var(--ease-out-expo);
}
.studio-visit-band:hover img { filter: grayscale(0) brightness(0.8) contrast(1.05); }
.studio-visit-caption {
  position: absolute;
  left: clamp(1.5rem, 4vw, 3.5rem);
  bottom: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 420px;
}
.studio-visit-caption .eyebrow { color: var(--paper); }
.studio-visit-caption .eyebrow::before { background: var(--paper); }
@media (prefers-reduced-motion: reduce) { .studio-visit-band img { transition: none; } }

/* ---- Portal -------------------------------------------------------------- */
.portal-shell { background: var(--concrete); min-height: 100vh; }
.portal-topbar {
  background: var(--steel); color: var(--on-dark);
  padding: 1.1rem 0;
}
.portal-topbar .wrap { display: flex; justify-content: space-between; align-items: center; }
.portal-card {
  background: var(--paper);
  border: 1px solid var(--concrete-2);
  border-radius: 3px;
  padding: 2rem;
}
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--steel); padding: 2rem;
}
.login-box { width: 100%; max-width: 420px; background: var(--paper); padding: 2.6rem; border-radius: 3px; }
.progress-track { height: 8px; background: var(--concrete-2); border-radius: 6px; overflow: hidden; margin: 0.6em 0; }
.progress-fill { height: 100%; background: var(--signal); }

.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.3em 0.7em; border-radius: 2px;
  background: var(--concrete); color: var(--ink-soft);
}

.small-print { font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Scroll-triggered reveals -------------------------------------------
   Applied automatically by assets/js/main.js — no template edits needed.
   Ease-out-expo reads as decisive/confident rather than bouncy, which fits
   the industrial tone better than a spring easing would. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }

.kinetic-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}
.kinetic-word.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .kinetic-word { opacity: 1; transform: none; transition: none; }
}


/* ===========================================================================
   MOBILE / SMALL-SCREEN HARDENING
   Phones get the full content and design language, with the heaviest
   interactive pieces scaled back — deliberately "reduced functionality,
   fully legible" rather than a cut-down site.
   =========================================================================== */

/* Never allow sideways scroll on a phone, whatever a child element does. */
html, body { max-width: 100%; overflow-x: hidden; }

/* Tables / code / wide blocks scroll inside themselves, not the page. */
.wrap table, .service-list, .portfolio-grid { max-width: 100%; }

@media (max-width: 860px) {
  /* Header: tighten so the logo + burger always fit */
  .site-header .wrap { height: 68px; }
  .logo { font-size: 0.98rem; }

  /* Hero: single column, and don't let the headline get clipped */
  .hero { padding-top: clamp(40px, 12vw, 70px); }
  .hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .hero p.lede { font-size: 1.02rem; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* 3D viewer: keep it, but lighter — no auto-orbit battery drain, and
     arrows sized for thumbs. Pointer-drag still works. */
  .massing-viewer { touch-action: pan-y; }
  .massing-caption { max-width: 60%; }

  /* Fly-over band: shorter so it doesn't dominate a phone screen */
  .flyover { height: clamp(260px, 62vw, 380px); }
  .flyover-caption { font-size: clamp(1.05rem, 5vw, 1.4rem); }
  .flyover-readout { font-size: 0.6rem; }

  /* Light-trail band */
  .light-trail-band { min-height: 300px; }

  /* Process line: pull the rail in so panels get real width */
  .process-panel { padding: 1.1rem 1.1rem; }

  /* Footer: stack cleanly */
  .footer-grid { gap: 1.8rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  /* Single-column everything that's still paired */
  .grid-2, .grid-3, .portfolio-grid,
  .studio-interior-grid, .form-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .service-list { grid-template-columns: 1fr; }

  /* Typography: keep headlines from overflowing narrow screens */
  h1 { font-size: clamp(1.9rem, 9vw, 2.5rem) !important; }
  .section-head h2 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .quote-block blockquote { font-size: clamp(1.15rem, 5.6vw, 1.6rem); }

  /* Cards a touch tighter so more fits per scroll */
  .card { padding: 1.7rem 1.4rem; }

  /* Buttons: full-width, comfortable tap height */
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { padding: 1em 1.4em; min-height: 48px; }

  /* Portal + forms */
  .portal-card, .login-box { padding: 1.5rem 1.2rem; }
  .portal-topbar .wrap { flex-direction: column; gap: 0.7rem; align-items: flex-start; }

  /* Any inline lightbox/nav chrome scaled for thumbs */
  .massing-nav, .flyover-nav { width: 34px; height: 46px; }

  /* iOS: stop form focus from zooming the page (needs >=16px) */
  input, select, textarea { font-size: 16px; }
}

/* Coarse pointers (touch): hover-only affordances shouldn't hide content,
   and hover-driven image treatments should rest in their "on" state. */
@media (hover: none) {
  .pf-thumb img { filter: grayscale(0.2) contrast(1.03); }
  .studio-visit-band img { filter: grayscale(0.15) brightness(0.78) contrast(1.05); }
  .team-photo { filter: none; }
}

/* Very short landscape (phone rotated): don't let full-height blocks
   swallow the whole screen. */
@media (max-height: 480px) and (orientation: landscape) {
  .login-shell { min-height: auto; padding: 2rem 1rem; }
  .flyover { height: 78vh; }
  .massing-viewer { height: 70vh; }
}


/* ===========================================================================
   VALUES SECTION
   Four numbered tests, each with a slow accent light-sweep travelling the
   top edge — the same long-exposure language as the dusk band, applied as
   structure rather than decoration.
   =========================================================================== */
.values-section { position: relative; overflow: hidden; }

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--concrete-2);
  border-top: 1px solid var(--concrete-2);
  border-bottom: 1px solid var(--concrete-2);
}
.value-card {
  position: relative;
  background: var(--paper);
  padding: 2.4rem 1.7rem 2.6rem;
  overflow: hidden;
}
/* Travelling light sweep along the card's top edge */
.value-card::before {
  content: '';
  position: absolute;
  top: 0; left: -40%;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(213, 96, 26, 0.15) 25%,
    var(--signal) 55%,
    rgba(213, 96, 26, 0.5) 72%,
    transparent);
  animation: value-sweep 7s linear infinite;
  animation-delay: var(--sweep-delay, 0s);
}
@keyframes value-sweep {
  0%   { left: -40%; opacity: 0; }
  12%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.value-index {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--signal);
  display: block;
  margin-bottom: 1.5rem;
}
.value-card h3 {
  font-size: 1.45rem;
  margin-bottom: 0.7em;
}
.value-card p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  margin: 0;
}
/* A faint vertical hairline echoing a drafting column, revealed on hover */
.value-card::after {
  content: '';
  position: absolute;
  left: 1.7rem; bottom: 0;
  width: 1px; height: 0;
  background: var(--signal);
  transition: height 0.5s var(--ease-out-expo);
}
.value-card:hover::after { height: 34px; }

@media (max-width: 980px) { .values-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .values-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .value-card::before { animation: none; opacity: 1; left: 0; width: 100%; }
  .value-card::after { transition: none; }
}

/* ===========================================================================
   SHARED DYNAMIC ACCENTS
   Reusing the light-beam idea in a few more places, kept subtle so it reads
   as the site having a pulse rather than as decoration.
   =========================================================================== */

/* 1. A single accent beam crossing the top of every dark section. */
.section-dark { position: relative; overflow: hidden; }
.section-dark::before {
  content: '';
  position: absolute;
  top: 0; left: -30%;
  width: 30%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  animation: beam-cross 11s linear infinite;
  opacity: 0.75;
  pointer-events: none;
}
@keyframes beam-cross {
  0%   { left: -30%; }
  100% { left: 100%; }
}

/* 2. Section eyebrow rule "charges up" when it scrolls into view. */
.eyebrow::before { transition: width 0.7s var(--ease-out-expo); }
.reveal .eyebrow::before { width: 0; }
.reveal.is-visible .eyebrow::before { width: 22px; }

/* 3. Stat figures get a thin accent underscore that draws in. */
.hero-stats div { position: relative; overflow: hidden; }
.hero-stats div::after {
  content: '';
  position: absolute;
  left: 1.2rem; bottom: 0;
  height: 2px; width: 0;
  background: var(--signal);
  transition: width 0.8s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}
.hero-stats div.is-visible::after { width: 28px; }

/* 4. Process-line stations pulse once as they become active. */
.process-row.is-active .process-node-marker {
  animation: station-lock 0.55s var(--ease-out-expo);
}
@keyframes station-lock {
  0%   { box-shadow: 0 0 0 0 rgba(213, 96, 26, 0.5); }
  60%  { box-shadow: 0 0 0 12px rgba(213, 96, 26, 0); }
  100% { box-shadow: 0 0 0 5px rgba(213, 96, 26, 0.15); }
}

@media (prefers-reduced-motion: reduce) {
  .section-dark::before { animation: none; opacity: 0; }
  .hero-stats div::after { transition: none; width: 28px; }
  .process-row.is-active .process-node-marker { animation: none; }
  .eyebrow::before, .reveal.is-visible .eyebrow::before { transition: none; width: 22px; }
}

/* ===========================================================================
   HEBREW / RTL
   Purely additive — nothing above this line is touched, so English (the
   default, `dir="ltr"`) is byte-for-byte unaffected by anything below.

   Most of the site needs zero overrides here: flexbox and CSS Grid both
   mirror automatically once `dir="rtl"` sets the inherited `direction`
   property (main-axis order for flex, column order for grid — this is
   standard behavior, not a hack). What's left is everything the CSS spec
   doesn't mirror for you: physical `left`/`right` positioning, `text-align`,
   one-sided borders/padding used as a visual accent, and transform-based
   animation directions.
   =========================================================================== */

/* ---- Typography: Big Shoulders Display, IBM Plex Mono and (in practice)
   the tracked-out uppercase letter-spacing they're used with are all
   Latin-only / Latin-tuned. Heebo (loaded conditionally in header.php)
   covers Hebrew with a similarly industrial, geometric weight range, and
   swapping it in via the same custom properties every rule already
   references means zero per-rule font-family edits below. */
:lang(he) {
  --font-head: 'Heebo', 'Arial Hebrew', Arial, sans-serif;
  --font-body: 'Heebo', 'Arial Hebrew', Arial, sans-serif;
  --font-mono: 'Heebo', 'Arial Hebrew', Arial, sans-serif;
}
/* Wide Latin-style tracking reads as broken spacing on Hebrew glyphs
   (no case to track, and the letterforms sit closer together by design).
   Reset every tracked-out label at once rather than per-rule. */
:lang(he) .logo,
:lang(he) .logo small,
:lang(he) .eyebrow,
:lang(he) .main-nav a,
:lang(he) .main-nav a.active,
:lang(he) .footer-grid h4,
:lang(he) .value-index,
:lang(he) .pf-tag,
:lang(he) .service-group-title,
:lang(he) .flyover-eyebrow,
:lang(he) .flyover-readout,
:lang(he) .massing-hint,
:lang(he) .massing-viewer-label,
:lang(he) .massing-caption,
:lang(he) label,
:lang(he) .badge,
:lang(he) .quote-block cite,
:lang(he) .lightbox-caption,
:lang(he) .lightbox-close,
:lang(he) .clients-track span,
:lang(he) .placeholder-flag {
  letter-spacing: normal;
}

/* ---- Header: nav bracket accent + language switcher --------------------- */
[dir="rtl"] .main-nav a.active::before { margin-right: 0; margin-left: 0.3em; }
[dir="rtl"] .main-nav a.active::after { margin-left: 0; margin-right: 0.3em; }
.lang-switch {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  opacity: 0.75;
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
  padding: 0.35em 0.7em !important;
}
.lang-switch:hover { opacity: 1; color: var(--signal); }
@media (max-width: 860px) {
  .main-nav .lang-switch {
    display: inline-block;
    border-color: var(--on-dark-soft);
    color: var(--on-dark);
    margin-top: 0.9rem;
  }
}

/* ---- Fly-over gallery HUD: mirror caption/readout/arrows/dots ----------- */
[dir="rtl"] .flyover-meta { left: auto; right: clamp(1rem, 3vw, 2.4rem); }
[dir="rtl"] .flyover-readout { right: auto; left: clamp(1rem, 3vw, 2.4rem); text-align: left; }
[dir="rtl"] .flyover-prev { left: auto; right: 0.7rem; }
[dir="rtl"] .flyover-next { right: auto; left: 0.7rem; }
[dir="rtl"] .flyover-dots { right: auto; left: clamp(1rem, 3vw, 2.4rem); }

/* ---- 3D massing viewer: mirror label/hint/arrows/dots/caption ----------- */
[dir="rtl"] .massing-hint { left: auto; right: 1rem; }
[dir="rtl"] .massing-viewer-label { left: auto; right: 1rem; }
[dir="rtl"] .massing-nav-prev { left: auto; right: 0.6rem; }
[dir="rtl"] .massing-nav-next { right: auto; left: 0.6rem; }
[dir="rtl"] .massing-dots { right: auto; left: 1rem; }
[dir="rtl"] .massing-caption { left: auto; right: 1rem; }

/* ---- Services list: bullet marker sits on the reading-start side -------- */
[dir="rtl"] .service-item { padding-left: 0; padding-right: 1rem; }
[dir="rtl"] .service-item::before { left: auto; right: 0; }

/* ---- Process production-line rail + accent borders ---------------------- */
[dir="rtl"] .process-line-rail { left: auto; right: 39px; }
[dir="rtl"] .process-list { padding-left: 0; padding-right: 88px; }
[dir="rtl"] .process-node-marker { left: auto; right: -88px; }
[dir="rtl"] .process-row { transform: translateX(24px); }
[dir="rtl"] .process-row.is-visible { transform: none; }
[dir="rtl"] .process-panel { border-left: 1px solid var(--concrete-2); border-right: 3px solid var(--concrete-2); }
[dir="rtl"] .process-row.is-active .process-panel { border-left-color: var(--concrete-2); border-right-color: var(--signal); }
@media (max-width: 760px) {
  [dir="rtl"] .process-line-rail { left: auto; right: 27px; }
  [dir="rtl"] .process-list { padding-left: 0; padding-right: 60px; }
  [dir="rtl"] .process-node-marker { left: auto; right: -60px; }
}

/* ---- One-sided accent borders used as a visual marker ------------------- */
[dir="rtl"] .card-core { border-left: 0; border-right: 3px solid var(--signal); }
[dir="rtl"] .value-card::after { left: auto; right: 1.7rem; }
[dir="rtl"] .hero-stats div::after { left: auto; right: 1.2rem; }
[dir="rtl"] .studio-visit-caption { left: auto; right: clamp(1.5rem, 4vw, 3.5rem); }
[dir="rtl"] .lightbox-close { right: auto; left: 1.3rem; }

/* ---- Travelling light-sweep accents: mirror so they still read as
   moving in the reading direction rather than against it ----------------- */
[dir="rtl"] .value-card::before { left: auto; right: -40%; animation-name: value-sweep-rtl; }
@keyframes value-sweep-rtl {
  0%   { right: -40%; opacity: 0; }
  12%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { right: 100%; opacity: 0; }
}
[dir="rtl"] .section-dark::before { left: auto; right: -30%; animation-name: beam-cross-rtl; }
@keyframes beam-cross-rtl {
  0%   { right: -30%; }
  100% { right: 100%; }
}
[dir="rtl"] .clients-track { animation-direction: reverse; }

@media (prefers-reduced-motion: reduce) {
  [dir="rtl"] .value-card::before { animation: none; opacity: 1; right: 0; left: auto; width: 100%; }
  [dir="rtl"] .section-dark::before { animation: none; opacity: 0; }
  [dir="rtl"] .clients-track { animation: none; }
}

/* ---- Band divider ------------------------------------------------------
   The fly-over band and the dusk light-trail band are both full-bleed
   images stacked directly on top of each other. Without a break between
   them they read as one confusing composite image, so this puts a hard
   architectural rule between the two — a thin signal-coloured tick on a
   dark ground, matching the drafting-mark language used elsewhere. */
.band-divider {
  height: clamp(28px, 4vw, 44px);
  background: var(--steel);
  position: relative;
}
.band-divider::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
.band-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 3px;
  background: var(--signal);
}

/* ---- Relief map ---------------------------------------------------------
   Real satellite imagery draped over a real elevation mesh (MapLibre GL,
   see assets/js/relief-map.js) -- a genuine 3D scene the visitor orbits by
   dragging, not an illustration. This is a windowed map viewport rather
   than the earlier version's die-cut country silhouette, so it gets
   coverage-map-style container sizing rather than a centered small SVG. */
.relief-section .section-head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.relief-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.relief-map {
  width: 100%;
  height: clamp(380px, 52vw, 620px);
  border: 1px solid var(--concrete-2);
  border-radius: 2px;
  background: var(--concrete);
  box-shadow: 0 26px 34px rgba(30, 26, 18, 0.18);
}
.relief-noscript {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.relief-hint { margin-top: 1rem; color: var(--ink-soft); text-align: center; }
.relief-count { margin-top: 0.3rem; color: var(--ink-soft); text-align: center; }

/* MapLibre control chrome is physical (left/right), not direction-aware --
   mirror it for RTL rather than leave zoom/compass stranded, same fix
   already applied to the Leaflet controls on the other two maps. */
[dir="rtl"] .relief-map .maplibregl-ctrl-top-right { right: auto; left: 0; }
[dir="rtl"] .relief-map .maplibregl-ctrl-top-left { left: auto; right: 0; }

.relief-reset-ctrl button {
  padding: 0 0.65em;
  line-height: 29px;
  background: #fff;
  border: none;
  font: 600 0.72rem/29px var(--font-mono, monospace);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.relief-reset-ctrl button:hover { background: var(--concrete); }

.relief-map-pin { cursor: pointer; filter: drop-shadow(0 2px 3px rgba(20,22,26,0.4)); }
.relief-map-pin:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 50%; }

@media (max-width: 640px) {
  .relief-map { height: 70vw; }
}

/* Count badge inside each portfolio filter button. dir="ltr" on the span
   keeps the numeral the right way round inside the Hebrew RTL layout. */
.portfolio-filter-count {
  display: inline-block;
  margin-inline-start: 0.45em;
  padding: 0.05em 0.42em;
  border-radius: 999px;
  background: var(--concrete-2);
  color: var(--ink-soft);
  font-size: 0.78em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  transition: background 0.2s, color 0.2s;
}
.portfolio-filter.is-active .portfolio-filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---- Per-project satellite map ------------------------------------------
   The single-pin zoomed map on a project detail page. Sits on a dark
   section, so it gets its own border/radius rather than reusing the
   portfolio coverage map's light-section styling. */
.project-map {
  width: 100%;
  height: clamp(320px, 42vw, 460px);
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  margin-top: 1.4rem;
  background: var(--steel-2);
}
[dir="rtl"] .project-map .leaflet-left { right: 0; left: auto; }
[dir="rtl"] .project-map .leaflet-control { margin-left: 0; margin-right: 10px; }

/* The pin's own <svg> supplies the shape/shadow; this just kills Leaflet's
   default icon chrome (border, background, shadow) so nothing shows through. */
.project-map-pin { background: none; border: none; }
