/* =========================================================
   Studio — corporate website
   Modern, elegant, with an artistic touch (RTL)
   ========================================================= */

:root {
  /* Palette */
  --bg: #FAF7F2;
  --bg-soft: #F2EDE3;
  --ink: #1A1A1A;
  --ink-2: #4A4744;
  --muted: #6B645C;            /* darkened from #8C857D for WCAG AA contrast on cream bg */
  --line: #E5DED1;
  --accent: #1E2A4A;       /* Editorial Navy — צבע מבטא */
  --accent-deep: #152038;
  --accent-light: #A8B4D4; /* Navy-tint לטקסט על רקע כהה */
  --white: #FFFFFF;

  /* Type */
  --font-serif: 'Frank Ruhl Libre', Georgia, serif;
  --font-sans: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(96px, 14vw, 168px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 200ms;
  --t-med: 450ms;

  --shadow-soft: 0 20px 60px rgba(26, 26, 26, 0.08);
  --shadow-strong: 0 30px 80px rgba(26, 26, 26, 0.18);
}

/* Base */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px; /* keep anchor targets clear of the sticky header */
}

/* Initial page fade-in (set by JS once DOM is ready) */
/* Body fade-in is opt-in via .is-loading. Default state is visible so that
   if JS fails to load, crawlers and JS-less browsers still see the page. */
body { transition: opacity 600ms var(--ease); }
body.is-loading { opacity: 0; }
body.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  body.is-loading { opacity: 1 !important; transition: none !important; }
}

/* Scroll progress indicator — thin navy line at top */
.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  background: transparent;
}
.scroll-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, var(--accent), var(--accent-deep));
  transform-origin: left;
  transition: width 80ms linear;
}
/* RTL — grow from right edge (avoids FOUC on lang toggle) */
[dir="rtl"] .scroll-progress-bar { transform-origin: right; }

/* Cursor accent — small navy dot that follows the pointer on desktop.
   Hidden on touch devices and when reduced motion is preferred. */
.cursor-accent {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 300ms var(--ease), width 200ms var(--ease), height 200ms var(--ease), background 200ms var(--ease);
  mix-blend-mode: multiply;
}
.cursor-accent.is-active { opacity: 0.6; }
.cursor-accent.is-hover {
  /* Expands and lightens when over an interactive element */
  width: 36px;
  height: 36px;
  background: var(--accent);
  opacity: 0.18;
}
/* On project images: expand further and switch to cream — reads as a "zoom" hint */
.cursor-accent.is-zoom {
  width: 56px;
  height: 56px;
  background: var(--bg);
  opacity: 0.85;
  mix-blend-mode: difference;
}
/* On primary buttons: shrink to a small dot — the magnetic CTA gets attention; cursor recedes */
.cursor-accent.is-cta {
  width: 4px;
  height: 4px;
  opacity: 0.9;
}
/* Hide on touch / coarse pointer / reduced motion */
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-accent { display: none; }
}

/* Back-to-top floating button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 10px 28px rgba(26, 26, 26, 0.22);
  z-index: 90;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), background var(--t-fast) var(--ease);
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}
.back-to-top-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-inline-start: 1.5px solid var(--bg);
  border-top: 1.5px solid var(--bg);
  transform: rotate(45deg);
  margin-top: 4px;
}
@media (max-width: 768px) {
  .back-to-top {
    bottom: 16px;
    inset-inline-start: 16px;
    width: 42px;
    height: 42px;
  }
}

/* WhatsApp floating action button — primary contact CTA on desktop/tablet.
   Sits opposite the back-to-top button (inline-end vs inline-start) to avoid collision. */
.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.34), 0 4px 10px rgba(26, 26, 26, 0.16);
  z-index: 90;
  text-decoration: none;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.whatsapp-fab.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.whatsapp-fab:hover {
  background: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(37, 211, 102, 0.42), 0 6px 14px rgba(26, 26, 26, 0.18);
}
.whatsapp-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.whatsapp-fab svg {
  display: block;
}
/* Soft attention pulse — runs 3 times after appearing, then settles */
.whatsapp-fab.is-visible::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0;
  animation: waPulse 2.4s var(--ease) 0.6s 3;
  pointer-events: none;
}
@keyframes waPulse {
  0%   { transform: scale(1);    opacity: 0.55; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab.is-visible::after { animation: none; display: none; }
  .whatsapp-fab { transition: opacity 0s; }
}

/* Sticky mobile CTA bar — navy-glass bottom bar with 2 actions (WhatsApp + Email) */
.mobile-cta-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 91;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(30, 42, 74, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--bg);
  padding: 10px max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(110%);
  transition: transform var(--t-med) var(--ease);
  pointer-events: none;
}
.mobile-cta-bar.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-cta-bar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  color: var(--bg);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-height: 56px;
  border-radius: 8px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.mobile-cta-bar-link:active {
  background: rgba(255, 255, 255, 0.10);
  transform: scale(0.98);
}
.mobile-cta-bar-wa { color: #4cd986; }
.mobile-cta-bar-wa svg path { color: #4cd986; }
.mobile-cta-bar-link svg { opacity: 0.95; }

/* Contact-info: inline WhatsApp icon styling */
.contact-icon-wa {
  color: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  /* Show the bar on mobile */
  .mobile-cta-bar { display: grid; }
  /* When bar is visible, hide the WhatsApp FAB (avoids duplication on mobile) */
  body.has-mobile-bar .whatsapp-fab { opacity: 0 !important; pointer-events: none !important; }
  /* Push back-to-top above the bar when bar is visible */
  body.has-mobile-bar .back-to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* Slightly shrink WhatsApp FAB on tablet (still shown 481-768px when bar not visible) */
  .whatsapp-fab {
    width: 52px;
    height: 52px;
    bottom: 18px;
    inset-inline-end: 18px;
  }
}

/* Skip link — visible only on focus */
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -100px;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  font-weight: 500;
  transition: top 200ms var(--ease);
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Focus-visible — applied globally for keyboard users only */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.btn:focus-visible,
.nav-cta:focus-visible,
.lang-toggle:focus-visible,
.project-tag:focus-visible,
.lightbox-close:focus-visible {
  outline-offset: 4px;
}
.project-card:focus-visible {
  outline-offset: -2px; /* inset for buttons that contain images */
}

/* Hidden filter cards — both visually and from AT */
.project-card[hidden] { display: none !important; }

/* Body scroll-lock (used by mobile nav and lightbox; reference-counted in JS) */
body.is-locked {
  overflow: hidden;
  /* Prevent iOS rubber-band scroll under fixed overlays */
  overscroll-behavior: contain;
  /* Lock touch scrolling on the body when a modal is open (mobile Safari) */
  touch-action: none;
}
html { overscroll-behavior-y: none; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  overflow-x: hidden;
  max-width: 100vw;
  /* Cream base color layered with a subtle SVG noise grain for paper/print feel.
     Inline SVG (no extra request); the alpha matrix keeps the noise to ~10% intensity
     so it textures the canvas without affecting readability. */
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.045 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  background-attachment: fixed;
  direction: rtl;
  /* Prevent horizontal overscroll bounce on iOS for the marquee/wide content */
  overscroll-behavior-x: contain;
}

/* When language is English (LTR), use Playfair Display for serifs (replaces Frank Ruhl Libre's Hebrew-first design) */
body.lang-en {
  direction: ltr;
}
body.lang-en .section-title,
body.lang-en .service-title,
body.lang-en .process-title,
body.lang-en .project-title,
body.lang-en .callout-title,
body.lang-en .hero-title,
body.lang-en .hero-line {
  font-family: 'Playfair Display', Georgia, serif;
}
body.lang-en .hero-line-italic em,
body.lang-en .section-title em {
  font-style: italic;
}
body.lang-en .stat-num {
  font-family: 'Playfair Display', serif;
}

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

/* Reveal (scroll fade-in) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Hero line-by-line reveal (i18n-friendly: animates whole lines, not words) */
.hero-title-animated .hero-line {
  display: block;
  opacity: 0;
  transform: translateY(40%);
  transition: opacity 900ms var(--ease), transform 1000ms var(--ease);
}
.hero-title-animated .hero-line:nth-child(1) { transition-delay: 250ms; }
.hero-title-animated .hero-line:nth-child(2) { transition-delay: 480ms; }
.hero-title-animated.is-visible .hero-line {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger for project cards */
.project-card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.project-card.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-title-animated .hero-line,
  .project-card,
  .hero-scroll span,
  .hero-overlay,
  .hero-video,
  .scroll-progress-bar,
  .back-to-top,
  .cursor-accent,
  .project-tag::after {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .hero-video { display: none !important; }
  .hero-overlay { display: none !important; }
  .image-frame img { transform: none !important; }
  .project-image img { transform: none !important; }
  /* The scroll-progress bar is informational only; keep it visible but instant */
  .scroll-progress-bar { transition: width 0ms !important; }
  .cursor-accent { display: none !important; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    /* As a safety net, dramatically reduce any remaining animations */
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  /* JS sets --header-opacity from 0 → 1 as the page scrolls.
     Background + blur live on the ::before pseudo so the header itself
     doesn't create a containing block that would trap the mobile nav-menu
     (which uses position: fixed + inset: 0 to fill the viewport). */
  --header-opacity: 0;
  box-shadow: 0 1px 0 rgba(229, 222, 209, calc(1 * var(--header-opacity)));
  transition: box-shadow 200ms linear;
  padding-block: 18px;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 247, 242, calc(0.92 * var(--header-opacity)));
  backdrop-filter: saturate(140%) blur(calc(10px * var(--header-opacity)));
  -webkit-backdrop-filter: saturate(140%) blur(calc(10px * var(--header-opacity)));
  transition: background 200ms linear, backdrop-filter 200ms linear, -webkit-backdrop-filter 200ms linear;
  pointer-events: none;
}
/* Fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .site-header::before {
    background: rgba(250, 247, 242, calc(0.98 * var(--header-opacity)));
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
}
/* Three direct children (logo, nav, lang) flow naturally:
   - RTL: logo (right) → nav (middle) → lang-toggle (far left)
   - LTR: logo (left) → nav (middle) → lang-toggle (far right) */
/* Legacy .header-actions class kept for safety; behaves as a no-op if present */
.header-actions { display: contents; }

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  direction: ltr;
  line-height: 1;
  gap: 4px;
}
.logo-text {
  position: relative;
  display: inline-block;
  font-weight: 600;
  font-size: 60px;
  letter-spacing: -0.5px;
  padding-bottom: 8px;
  line-height: 0.95;
}
.logo-text::after {
  /* Navy underline beneath wordmark — clearly visible, matches Berko width */
  content: '';
  position: absolute;
  inset-inline: 4%;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
}
.logo-slogan {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 15.5px;
  letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
  line-height: 1.2;
  /* Tuned so the slogan visually spans the Berko wordmark width at desktop sizes */
  transform: scaleX(0.62);
  transform-origin: center;
  margin-top: 2px;
}
@media (max-width: 768px) {
  /* Mobile logo — kept compact so it stays vertically centered next to
     the hamburger and language toggle on a single header row. */
  .logo-text { font-size: 34px; padding-bottom: 5px; }
  .logo-slogan { display: none; }
}
@media (max-width: 380px) {
  .logo-text { font-size: 28px; padding-bottom: 4px; }
}

/* Close row is mobile-only; hidden on desktop where the menu is inline */
.nav-menu-close-row { display: none; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
}
.nav-menu a {
  color: var(--ink-2);
  position: relative;
  transition: color var(--t-fast) var(--ease);
}
.nav-menu a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-med) var(--ease);
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a:hover::after { transform: scaleX(1); }

.nav-cta {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink) !important;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--ink); color: var(--bg) !important; }

/* Language toggle button (EN/HE) */
.lang-toggle {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 8px 12px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  min-width: 44px;
  min-height: 36px; /* desktop OK; mobile inflated below */
  text-align: center;
}
.lang-toggle:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span {
  display: block;
  width: 26px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 80px;
  overflow: hidden;
}
/* Video — sits behind the typography, low opacity to support but not compete. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity 1400ms var(--ease);
}
.hero-video.is-playing { opacity: 0.32; }
/* Overlay above video — heavy cream wash for typography legibility */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(250,247,242,0.55) 0%,
    rgba(250,247,242,0.78) 50%,
    rgba(250,247,242,0.95) 100%);
  opacity: 0;
  transition: opacity 1400ms var(--ease);
}
.hero-video.is-playing ~ .hero-overlay { opacity: 1; }
/* Fallback gradient — one tasteful radial, no template-y dot pattern */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 50% at 75% 35%, rgba(30, 42, 74, 0.08), transparent 75%),
    var(--bg);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
  /* Explicit start-edge alignment so hero text reads from the right in RTL, left in LTR */
  text-align: start;
}
.hero-scroll { z-index: 2; }
/* In RTL: every block in hero content aligns to the right (start-edge) */
[dir="rtl"] .hero-content,
[dir="rtl"] .hero-eyebrow,
[dir="rtl"] .hero-title,
[dir="rtl"] .hero-line,
[dir="rtl"] .hero-subtitle { text-align: right; }
[dir="ltr"] .hero-content,
[dir="ltr"] .hero-eyebrow,
[dir="ltr"] .hero-title,
[dir="ltr"] .hero-line,
[dir="ltr"] .hero-subtitle { text-align: left; }

/* Honor reduced motion: don't autoplay video */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero-overlay { display: none; }
}

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 36px;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: 36px;
  color: var(--ink);
}
.hero-line { display: block; }
.hero-line-italic {
  font-style: italic;
  color: var(--accent-deep);
  position: relative;
  display: inline-block;
}
.hero-line-text { display: inline; }
/* Hand-drawn underline that animates beneath the italic line on reveal. */
.hero-line-underline {
  position: absolute;
  bottom: -0.18em;
  inset-inline-start: 4%;
  width: 92%;
  height: 0.22em;
  color: var(--accent);
  opacity: 0.85;
  pointer-events: none;
}
.hero-line-underline path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transition: stroke-dashoffset 1100ms var(--ease) 900ms;
}
.hero-title-animated.is-visible .hero-line-underline path {
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .hero-line-underline path { stroke-dashoffset: 0 !important; transition: none; }
}

.hero-subtitle {
  font-size: clamp(17px, 1.6vw, 22px);
  color: var(--ink-2);
  max-width: 680px;
  margin-bottom: 56px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--ink-2);
  border-radius: 14px;
  z-index: 2;
}
.hero-scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: var(--ink-2);
  border-radius: 2px;
  animation: scrollPulse 1.6s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: translate(-50%, 0); opacity: 1; }
  50%      { transform: translate(-50%, 14px); opacity: 0.2; }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 42px rgba(30, 42, 74, 0.28);
}
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(30, 42, 74, 0.18);
}
.btn-block { width: 100%; }

/* Loading state — appended spinner */
.btn[aria-busy="true"],
.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.btn.is-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  margin-inline-start: 8px;
  animation: btnSpin 700ms linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after { animation: none; }
}

/* Magnetic effect — JS sets translate via inline style on mousemove */
.magnetic {
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
@media (hover: none) {
  .magnetic { transition: transform var(--t-fast) var(--ease); }
}

/* =========================================================
   Section base
   ========================================================= */
.section {
  padding-block: var(--section-y);
}
.section-about { background: var(--bg); }
.section-services { background: var(--bg-soft); }
.section-contact { background: var(--ink); color: var(--bg); }

.section-eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  vertical-align: middle;
}
/* Small editorial flourish before each section eyebrow — a thin horizontal line. */
.section-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}
/* In centered section headers, the flourish appears on both sides for symmetry. */
.section-header .section-eyebrow::after {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}
.section-contact .section-eyebrow { color: #A8B4D4; }

.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin-bottom: 24px;
}
.section-title em { font-style: italic; color: var(--accent-deep); }
.section-contact .section-title em { color: #A8B4D4; }

.section-lead, .section-lead-center {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 60ch;
  line-height: 1.8;
}
.section-lead + .section-lead { margin-top: 22px; }
.section-lead-center {
  margin-inline: auto;
  text-align: center;
}
.section-contact .section-lead { color: rgba(250, 247, 242, 0.78); }

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

/* =========================================================
   About
   ========================================================= */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}

.image-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
}
.image-frame::before {
  content: '';
  position: absolute;
  inset: -14px -14px auto auto;
  width: 110px;
  height: 110px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  z-index: -1;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.image-frame:hover img { transform: scale(1.04); }

.image-caption {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================
   Stats (about section)
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.stat {
  position: relative;
}
/* Thin vertical divider between stats on desktop — editorial pacing.
   Logical-property variant for inset-inline-end (RTL/LTR aware). */
.stat:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 8px;
  inset-inline-end: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line) 25%, var(--line) 75%, transparent);
  opacity: 0.9;
}
@media (max-width: 768px) {
  .stat:not(:last-child)::after { display: none; }
}
.stat-num {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  color: var(--accent-deep);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  display: inline-block;
  transition: text-shadow 700ms var(--ease), transform 700ms var(--ease);
}
.stat-num.is-counter-done {
  text-shadow: 0 0 24px rgba(30, 42, 74, 0.32);
}
.stat-label {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================
   Services
   ========================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.services-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.service-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 22px;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Navy accent bar that grows along the top edge on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 0;
  background: var(--accent);
  transition: height var(--t-med) var(--ease);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
  border-color: transparent;
}
.service-card:hover::before { height: 3px; }
.service-card:hover .service-num { color: var(--accent-deep); }

.service-icon {
  color: var(--accent);
  margin-bottom: 14px;
  opacity: 0.92;
  transition: transform var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
.service-card:hover .service-icon {
  transform: translateY(-2px);
  color: var(--accent-deep);
}

.service-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 16px;
}

.service-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.service-desc {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.service-bullets { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.service-bullets li {
  position: relative;
  padding-inline-start: 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.service-bullets li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

/* Burko Shop callout */
.services-callout {
  margin-top: 48px;
  padding: 36px clamp(28px, 4vw, 48px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 6px;
}
.callout-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.callout-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 28px);
  margin-bottom: 12px;
  color: var(--ink);
}
.callout-text {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 820px;
}
.callout-text a {
  color: var(--accent-deep);
  border-bottom: 1px solid currentColor;
  transition: color var(--t-fast) var(--ease);
}
.callout-text a:hover { color: var(--ink); }
.callout-text strong { color: var(--ink); font-weight: 700; }

/* =========================================================
   Process — 4-step stepper
   ========================================================= */
.section-process { background: var(--bg); }

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  padding: 0;
  margin: 0;
}
/* connecting line that runs through all steps */
.process-steps::before {
  content: '';
  position: absolute;
  top: 30px;
  inset-inline-start: calc(100% / 8);
  inset-inline-end: calc(100% / 8);
  height: 1px;
  background: var(--line);
  z-index: 0;
}

.process-step {
  position: relative;
  padding: 60px 22px 0;
  text-align: center;
  z-index: 1;
}
/* Process step icon — sits ON the connecting line, replaces the simple dot.
   The icon is wrapped in a circle so it visually "lands" on the timeline. */
.process-icon {
  position: absolute;
  top: 16px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  z-index: 2;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease), border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.process-step:hover .process-icon {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: translateX(-50%) translateY(-2px);
}

.process-num {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 18px;
  position: relative;
  display: inline-block;
}

.process-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 12px;
}

.process-desc {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 240px;
  margin: 0 auto;
}

/* =========================================================
   Projects — filter tabs
   ========================================================= */
.section-projects { background: var(--bg); }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 56px;
}
.project-tag {
  position: relative;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-2);
  background: var(--bg);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  /* Smooth visual transition between active states (animated background fill) */
}
.project-tag::after {
  /* Sliding navy underline beneath the active tag */
  content: '';
  position: absolute;
  inset-inline: 30%;
  bottom: -7px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--t-med) var(--ease);
  pointer-events: none;
}
.project-tag:hover { border-color: var(--ink); color: var(--ink); }
.project-tag.is-active,
.project-tag[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.project-tag.is-active::after,
.project-tag[aria-pressed="true"]::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .project-tag::after { transition: none; }
}

.gallery-note {
  display: block;
  margin: 36px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  background: transparent;
  border: 0;
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 999px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.gallery-note:hover {
  color: var(--ink);
  background: rgba(30, 42, 74, 0.06);
}
.gallery-note:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* When the "Selected" filter is active, extras are hidden — only 9 cards visible */
.projects-grid.is-collapsed .project-card.is-extra { display: none !important; }

/* Mobile-only hide for specific cards (currently: merch-lego-popup) — TOP becomes 8 */
@media (max-width: 768px) {
  .projects-grid.is-collapsed .project-card.is-hide-mobile { display: none !important; }
}

/* =========================================================
   Project cards
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

.project-card {
  position: relative;
  display: block;
  text-align: right;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
  transition: transform var(--t-med) var(--ease), opacity 400ms var(--ease);
}
/* Filter-hidden cards use the [hidden] attribute (handled at top of file with !important) */

.project-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-soft);
  margin-bottom: 18px;
}

/* Per-category placeholder gradients — visible when image is missing/loading.
   Image sits on top via object-fit:cover; if image fails (onerror), gradient shows. */
.project-card[data-cat="art"]   .project-image { background: linear-gradient(135deg, #C7B299 0%, #4A4744 100%); }
.project-card[data-cat="kids"]  .project-image { background: linear-gradient(135deg, #F2EDE3 0%, #A87C30 100%); }
.project-card[data-cat="merch"] .project-image { background: linear-gradient(135deg, #4A4744 0%, #1A1A1A 100%); }
.project-card[data-cat="shows"] .project-image { background: linear-gradient(135deg, #3E4A6A 0%, #152038 100%); }

/* Subtle texture overlay so empty cards don't look "flat" */
.project-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 60%),
                    radial-gradient(circle at 70% 70%, rgba(0,0,0,0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.project-image img { position: relative; z-index: 1; }
.project-image::after {
  /* Hover overlay — navy-tinted gradient covering the full image, with a
     stronger color near the bottom where text/meta sits. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30, 42, 74, 0.55) 0%, rgba(30, 42, 74, 0.15) 55%, rgba(30, 42, 74, 0) 100%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
  z-index: 2;
}
.project-card:hover .project-image::after,
.project-card:focus-visible .project-image::after { opacity: 1; }

/* "+" zoom indicator — appears in the upper inline-end corner on hover.
   Communicates the lightbox affordance without text. */
.project-image .project-image-zoom {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(250, 247, 242, 0.95);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.6) translateY(-6px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  z-index: 3;
  pointer-events: none;
}
.project-card:hover .project-image-zoom,
.project-card:focus-visible .project-image-zoom {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Unified color grading — balances 22 covers across warm/cool sources into one editorial album */
  filter: saturate(0.94) brightness(1.02) contrast(1.04);
  transition: transform 1.4s var(--ease), filter var(--t-med) var(--ease);
}
.project-card:hover .project-image img,
.project-card:focus-visible .project-image img {
  transform: scale(1.06);
  filter: saturate(1.06) brightness(1.05) contrast(1.05);
}

.project-meta { padding: 0 4px; }

.project-cat {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 8px;
}

.project-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.project-title::after {
  content: '';
  position: absolute;
  inset-inline: 0 auto;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--ink);
  transition: width var(--t-med) var(--ease);
}
.project-card:hover .project-title::after { width: 100%; }

/* Inline metadata under title: "2022 · תל אביב" — visible by default
   (populated from data-year / data-location on the button; rendered by JS) */
.project-info {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  opacity: 0.85;
}
.project-info-sep { opacity: 0.5; padding: 0 6px; }

/* Card lift on hover — premium depth */
.project-card {
  border-radius: 6px;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease), box-shadow var(--t-med) var(--ease);
}
.project-card:hover {
  transform: translateY(-4px);
}
.project-card:hover .project-image {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 16px 38px rgba(30,42,74,0.14);
}
.project-image {
  transition: box-shadow var(--t-med) var(--ease);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 4vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 100%;
  max-height: 100%;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  border-radius: 4px;
  box-shadow: var(--shadow-strong);
  display: block;
}
.lightbox-caption {
  text-align: center;
  color: var(--bg);
  max-width: 640px;
  padding: 20px 16px 8px;
  border-top: 1px solid rgba(250,247,242,0.16);
  margin-top: 18px;
}
.lightbox-cat {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(250,247,242,0.7);
  margin-bottom: 8px;
}
.lightbox-cat:empty { display: none; }
.lightbox-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--bg);
  margin: 0;
}
.lightbox-title:empty { display: none; }
.lightbox-meta {
  font-size: 14px;
  color: rgba(250,247,242,0.7);
  margin: 10px 0 0;
  letter-spacing: 0.04em;
}
.lightbox-meta:empty { display: none; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  inset-inline-end: 24px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(250,247,242,0.5);
  letter-spacing: 0.04em;
}
/* Prev / Next arrows — visible only when the project has 2+ images. */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(250, 247, 242, 0.10);
  color: var(--bg);
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  z-index: 210;
}
.lightbox-nav:hover {
  background: rgba(250, 247, 242, 0.22);
}
.lightbox-nav:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}
.lightbox-nav-prev { inset-inline-start: 18px; }
.lightbox-nav-next { inset-inline-end:   18px; }
/* In RTL the visual direction of the chevrons should match the reading flow */
[dir="rtl"] .lightbox-nav-prev svg { transform: scaleX(-1); }
[dir="rtl"] .lightbox-nav-next svg { transform: scaleX(-1); }
.lightbox.has-gallery .lightbox-nav {
  opacity: 0.85;
  pointer-events: auto;
}
.lightbox.has-gallery .lightbox-nav:hover { opacity: 1; }
@media (max-width: 768px) {
  .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-nav-prev { inset-inline-start: 8px; }
  .lightbox-nav-next { inset-inline-end:   8px; }
}
@media (max-width: 768px) {
  .lightbox-img { max-height: calc(100vh - 240px); }
  .lightbox-counter { bottom: 14px; inset-inline-end: 14px; font-size: 12px; }
}
.lightbox-close {
  position: absolute;
  top: 24px;
  inset-inline-start: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(250,247,242,0.12);
  color: var(--bg);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background var(--t-fast) var(--ease);
}
.lightbox-close:hover { background: rgba(250,247,242,0.25); }

/* =========================================================
   Partners — logo wall (workers committees)
   ========================================================= */
.section-partners { background: var(--bg-soft); }

.partners-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}

.partner {
  position: relative;
  background: var(--bg);
  min-height: 110px;
  padding: 24px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease);
}
.partner:hover { background: var(--bg-soft); }

/* Name shows by default — visible while logo loads or if logo is missing */
/* Partner name kept in DOM for screen readers — visually hidden so the
   wall reads as logos only. (Img has alt="" so the name is the SR label.) */
.partner-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Logo overlays the name when it loads. If load fails, img is removed (onerror), name stays visible.
   max-width/height clamp the rendering so small source logos (e.g. 177×79) don't get
   upscaled past their native pixels — keeps them crisp on retina displays. */
.partner-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: min(75%, 220px);
  max-height: min(60%, 90px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  filter: grayscale(1);
  transition: opacity 400ms var(--ease), filter var(--t-med) var(--ease);
  background: var(--bg);
}
.partner-logo.loaded { opacity: 1; }
.partner:hover .partner-logo.loaded { filter: grayscale(0); }

.partners-note {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.04em;
}

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}

.contact-info {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}
.contact-info li { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.contact-info a { color: var(--bg); transition: color var(--t-fast) var(--ease); }
.contact-info a:hover { color: #A8B4D4; }
.contact-icon {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(250,247,242,0.3);
  border-radius: 50%;
  font-size: 14px;
  color: #A8B4D4;
}

/* Form */
.contact-form {
  background: rgba(250,247,242,0.04);
  border: 1px solid rgba(250,247,242,0.12);
  padding: 36px;
  border-radius: 6px;
  display: grid;
  gap: 20px;
}

.form-row { display: grid; gap: 20px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }

.form-field { display: grid; gap: 8px; position: relative; }
.form-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250,247,242,0.7);
}
.form-field input,
.form-field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(250,247,242,0.25);
  padding: 10px 0;
  color: var(--bg);
  font-size: 16px;
  font-family: inherit;
  transition: border-color var(--t-fast) var(--ease);
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: #A8B4D4;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(250,247,242,0.6); opacity: 1; }

.form-select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(250,247,242,0.25);
  padding: 10px 0;
  color: var(--bg);
  font-size: 16px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(250,247,242,0.6) 50%),
                    linear-gradient(135deg, rgba(250,247,242,0.6) 50%, transparent 50%);
  background-position: calc(0% + 8px) 50%, calc(0% + 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-inline-start: 28px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}
.form-select:focus {
  outline: none;
  border-bottom-color: #A8B4D4;
}
.form-select option {
  background: var(--ink);
  color: var(--bg);
}

.form-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.form-error {
  font-size: 13px;
  color: #D4B27A;
  display: none;
}
.form-field.has-error .form-error { display: block; }
.form-field.has-error input,
.form-field.has-error textarea { border-bottom-color: #D4B27A; }

/* Valid state — subtle green border-bottom signals "good to go" */
.form-field.is-valid input,
.form-field.is-valid textarea { border-bottom-color: #A8D5A0; }

.form-status { font-size: 14px; color: #A8B4D4; min-height: 20px; margin-top: 4px; }
.form-status.is-success { color: #A8D5A0; }
.form-status.is-error { color: #D4B27A; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding-block: 48px 22px;
  border-top: 1px solid rgba(250,247,242,0.08);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
/* Single row: brand · CTA · nav · social — all on one line, top-aligned so vertical stacks don't push others */
.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: 'Playfair Display', serif;
  letter-spacing: -0.5px;
  direction: ltr;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.footer-brand .logo-text {
  font-weight: 600;
  font-size: 32px;
  padding-bottom: 5px;
  letter-spacing: 0.04em;
}
.footer-brand .logo-text::after {
  height: 1.5px;
  inset-inline: 4%;
  background: var(--accent-light);
}
.footer-slogan {
  color: var(--accent-light) !important;
  font-size: 9.5px !important;
  display: inline-block !important;
}
.footer-cta {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--bg);
  border: 1px solid rgba(250,247,242,0.25);
  padding: 11px 20px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.footer-cta:hover {
  background: rgba(250,247,242,0.08);
  border-color: rgba(250,247,242,0.6);
  transform: translateY(-2px);
}

/* Vertical stacks for nav + social */
.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.footer-nav a {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(250,247,242,0.8);
  transition: color var(--t-fast) var(--ease);
}
.footer-nav a:hover { color: var(--bg); }

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}
.footer-social a { color: rgba(250,247,242,0.7); transition: color var(--t-fast) var(--ease); }
.footer-social a:hover { color: var(--bg); }

/* Bottom: copy + legal */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid rgba(250,247,242,0.08);
}
.footer-copy { font-size: 13px; color: rgba(250,247,242,0.5); }
.footer-legal {
  display: flex;
  gap: 24px;
  font-size: 12px;
}
.footer-legal a {
  color: rgba(250,247,242,0.5);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--t-fast) var(--ease);
}
.footer-legal a:hover { color: rgba(250,247,242,0.85); }

/* Cookie banner — minimal bottom banner, dismissed once accepted (localStorage) */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  inset-inline: 16px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(26, 26, 26, 0.32), 0 6px 14px rgba(26, 26, 26, 0.18);
  max-width: 720px;
  margin-inline: auto;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  flex-wrap: wrap;
}
.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cookie-text {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(250,247,242,0.86);
  flex: 1 1 280px;
}
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cookie-more {
  color: var(--accent-light);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease);
}
.cookie-more:hover { color: var(--bg); }
.cookie-accept {
  appearance: none;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 8px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  min-height: 36px;
}
.cookie-accept:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}
.cookie-accept:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .cookie-banner {
    bottom: 12px;
    inset-inline: 12px;
    padding: 12px 14px;
    gap: 10px;
  }
  .cookie-text { font-size: 12.5px; flex-basis: 100%; }
  .cookie-actions { width: 100%; justify-content: space-between; }
}
/* When the mobile bar is visible, lift the cookie banner above it */
body.has-mobile-bar .cookie-banner {
  bottom: calc(78px + env(safe-area-inset-bottom));
}
/* When the cookie banner is visible, lift the WhatsApp FAB above it
   to avoid visual collision on desktop / tablet. */
body.has-cookie-banner .whatsapp-fab.is-visible {
  transform: translateY(-80px);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .services-grid,
  .services-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 18px; }
  .partners-grid { grid-template-columns: repeat(3, 1fr); }

  .process-steps { grid-template-columns: repeat(2, 1fr); gap: 56px 0; }
  .process-steps::before {
    /* split line per row */
    top: 30px;
    inset-inline-start: 25%;
    inset-inline-end: 25%;
    background: linear-gradient(to right, var(--line) 50%, transparent 50%, transparent 100%);
  }
}

@media (max-width: 768px) {
  :root {
    --section-y: clamp(56px, 13vw, 88px);
    --gutter: clamp(16px, 4vw, 28px);
  }

  /* Header on mobile: 3-column grid — single row, logo centered.
     Three flat children (logo, nav, lang-toggle) → predictable placement. */
  .header-inner {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto;
    grid-auto-flow: column;
    gap: 12px;
    align-items: center;
  }
  .logo        { grid-column: 2; grid-row: 1; justify-self: center; }
  .nav         { grid-row: 1; }
  .lang-toggle { grid-row: 1; }
  /* In RTL: column 1 is visual right (nav side), column 3 is visual left (lang side) */
  [dir="rtl"] .nav         { grid-column: 1; justify-self: start; }
  [dir="rtl"] .lang-toggle { grid-column: 3; justify-self: end; }
  /* In LTR: mirrored */
  [dir="ltr"] .nav         { grid-column: 3; justify-self: end; }
  [dir="ltr"] .lang-toggle { grid-column: 1; justify-self: start; }

  .lang-toggle { font-size: 12px; min-height: 40px; padding: 8px 12px; min-width: 44px; }

  .nav-toggle { display: flex; z-index: 110; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-menu {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-family: var(--font-serif);
    transform: translateY(-100%);
    transition: transform var(--t-med) var(--ease);
    /* Above the site-header (z-index 100); the menu is portaled out of the
       header at runtime so this z-index applies globally. */
    z-index: 120;
    padding: 24px;
  }
  .nav-menu li { width: 100%; max-width: 320px; text-align: center; }
  .nav-menu a {
    /* Generous tap target for mobile (Apple HIG: ≥44px) */
    display: block;
    padding: 14px 12px;
    min-height: 48px;
  }
  .nav-menu.is-open { transform: translateY(0); }
  /* Close button (X) — appears inside the open mobile menu, top inline-end corner.
     Provides a clear way to dismiss the menu without finding the hamburger. */
  .nav-menu-close-row {
    display: block;
    position: absolute;
    top: 20px;
    inset-inline-end: 20px;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .nav-menu-close {
    appearance: none;
    background: transparent;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink);
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
    position: relative;
  }
  .nav-menu-close span {
    position: absolute;
    inset-inline: 12px;
    height: 1.8px;
    background: currentColor;
    border-radius: 2px;
  }
  .nav-menu-close span:nth-child(1) { transform: rotate(45deg); }
  .nav-menu-close span:nth-child(2) { transform: rotate(-45deg); }
  .nav-menu-close:hover {
    background: rgba(26, 26, 26, 0.06);
  }
  .nav-menu-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
  .nav-menu a::after { display: none; }
  .nav-cta { font-size: 16px; padding: 14px 28px !important; margin-top: 12px; }

  /* Tighter section headers — more content, less air */
  .section-header { margin-bottom: 40px; }

  .section-grid { grid-template-columns: 1fr; gap: 32px; }
  .section-grid .section-image { order: -1; }

  /* Hero — more compact, better balance */
  .hero { padding-top: 96px; padding-bottom: 72px; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.16em; margin-bottom: 20px; }
  .hero-title { line-height: 1.08; margin-bottom: 22px; }
  .hero-subtitle { font-size: 16px; margin-bottom: 32px; line-height: 1.7; }
  /* Hide the scroll indicator on mobile — keyboard scrolling is universal there */
  .hero-scroll { display: none; }

  /* About */
  .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; padding-top: 28px; }
  .stat-num { font-size: 30px; }
  .stat-label { font-size: 11px; letter-spacing: 0.08em; }
  .image-frame { aspect-ratio: 1 / 1; }
  .image-frame::before { width: 80px; height: 80px; inset: -10px -10px auto auto; }

  /* Services — tighter cards */
  .services-grid,
  .services-grid-4 { grid-template-columns: 1fr; gap: 14px; }
  .service-card { padding: 32px 24px; }
  .service-num { margin-bottom: 18px; }
  .service-title { font-size: 22px; }
  .service-bullets { padding-top: 16px; }

  /* B2B Callout */
  .services-callout { margin-top: 36px; padding: 28px 22px; }
  .callout-title { font-size: 20px; }
  .callout-text { font-size: 14px; }

  /* Process — vertical timeline aligned to side, less wasted space */
  .process-steps { grid-template-columns: 1fr; gap: 28px; padding-inline-start: 36px; }
  .process-steps::before {
    top: 8px;
    bottom: 8px;
    inset-inline-start: 16px;
    inset-inline-end: auto;
    width: 1px;
    height: auto;
    background: var(--line);
  }
  .process-step { padding: 0; text-align: start; }
  /* Mobile: icon sits on the vertical line on the start side, not centered above */
  .process-icon {
    top: 4px;
    inset-inline-start: -36px;
    transform: none;
    width: 24px;
    height: 24px;
  }
  .process-step:hover .process-icon {
    transform: translateY(-2px);
  }
  .process-num { margin-bottom: 8px; font-size: 36px; }
  .process-title { font-size: 19px; }
  .process-desc { max-width: 100%; font-size: 14px; }

  /* Projects: 2 columns on mobile */
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .project-image { aspect-ratio: 1 / 1; margin-bottom: 12px; }
  .project-cat { font-size: 10px; letter-spacing: 0.14em; margin-bottom: 4px; }
  .project-title { font-size: 16px; line-height: 1.2; }

  /* Filter tags — scrollable horizontal strip prevents wrapping on narrow screens */
  .project-tags {
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 4px 12px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    justify-content: flex-start;
  }
  .project-tags::-webkit-scrollbar { display: none; }
  .project-tag {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
  }


  /* Partners — tighter cells */
  .partners-grid { grid-template-columns: repeat(2, 1fr); }
  .partner { min-height: 80px; padding: 16px 10px; }
  .partner-name { font-size: 14px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-info { gap: 14px; margin-top: 28px; }
  .contact-info li { font-size: 15px; gap: 12px; min-height: 44px; align-items: center; }
  .contact-info a { padding: 4px 0; min-height: 44px; display: inline-flex; align-items: center; }
  .contact-icon { width: 36px; height: 36px; font-size: 13px; flex-shrink: 0; }
  .contact-form { padding: 24px 18px; gap: 16px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-label { font-size: 12px; }
  /* iOS auto-zooms inputs <16px — keep at 16px to prevent zoom */
  .form-field input,
  .form-field textarea,
  .form-select { font-size: 16px; padding: 14px 0; }

  /* Footer */
  .site-footer { padding-block: 40px 20px; }
  .footer-inner { gap: 24px; }
  .footer-row { flex-direction: column; align-items: center; text-align: center; gap: 22px; }
  .footer-brand { align-items: center; }
  .footer-nav ul { flex-wrap: wrap; justify-content: center; gap: 18px; }
  .footer-social { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; padding-top: 18px; }

  /* Lightbox — close button positioning needs to clear iOS safe areas */
  .lightbox-close {
    top: max(16px, env(safe-area-inset-top));
    inset-inline-start: max(16px, env(safe-area-inset-left));
    width: 48px;
    height: 48px;
  }

  /* Back-to-top — slight bump for touch */
  .back-to-top {
    width: 46px;
    height: 46px;
    bottom: max(16px, env(safe-area-inset-bottom));
    inset-inline-start: max(16px, env(safe-area-inset-left));
  }

  /* Footer social links — tap-friendly */
  .footer-social a { padding: 8px 4px; display: inline-block; }
}

@media (max-width: 480px) {
  .hero { padding-top: 88px; padding-bottom: 56px; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn { width: 100%; min-height: 52px; }
  .stat-num { font-size: 26px; letter-spacing: -0.02em; }
  .image-frame { aspect-ratio: 1 / 1; }

  /* About — tighter on tiny screens */
  .stats { gap: 8px; }
  .stat-label { font-size: 10px; letter-spacing: 0.06em; }

  /* Services callout on tiny screens */
  .services-callout { padding: 24px 18px; }
  .callout-title { font-size: 18px; line-height: 1.3; }

  /* Section spacing — less air between sections */
  :root { --section-y: clamp(48px, 10vw, 72px); }
}

@media (max-width: 360px) {
  /* Smallest phones: drop projects to single column */
  .projects-grid { grid-template-columns: 1fr; gap: 24px; }
  .project-image { aspect-ratio: 4 / 3; }
}

/* =========================================================
   Print stylesheet — hides chrome (nav, FABs, modals, video)
   and reflows the content for paper / PDF export.
   ========================================================= */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }
  body::before, body::after { display: none !important; }

  /* Hide interactive chrome and decorative elements */
  .site-header,
  .scroll-progress,
  .cursor-accent,
  .back-to-top,
  .whatsapp-fab,
  .mobile-cta-bar,
  .cookie-banner,
  .lightbox,
  .hero-scroll,
  .hero-video,
  .hero-overlay,
  .project-tags,
  .project-image-zoom,
  .contact-form,
  .nav,
  .lang-toggle,
  #showMoreProjects {
    display: none !important;
  }

  /* Reveal any filter-hidden cards so the print version is complete */
  .project-card[hidden] { display: block !important; }
  .projects-grid.is-collapsed .project-card.is-extra { display: block !important; }

  /* Flatten sections — no large vertical padding on paper */
  .section { padding-block: 24pt !important; }
  .hero {
    min-height: auto !important;
    padding-top: 0 !important;
    padding-bottom: 24pt !important;
  }
  .hero-bg, .hero-bg-grain { display: none !important; }

  /* Disable animations and transforms */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  /* Page-break hints */
  section { break-inside: avoid-page; }
  h1, h2, h3 { break-after: avoid-page; }

  /* Show full URL after links for print legibility */
  a[href^="http"]::after,
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #555;
    word-break: break-all;
  }
  a[href^="#"]::after { content: ""; } /* skip internal anchors */

  /* Color-safe palette for print */
  .section-eyebrow { color: #444 !important; }
  .hero-title, .section-title { color: #000 !important; }
  .stat-num { color: #1E2A4A !important; }
  .section-contact { background: #fff !important; color: #000 !important; }
  .section-contact a, .section-contact .section-title { color: #000 !important; }
  .site-footer { background: #fff !important; color: #000 !important; border-top: 1px solid #ccc; }
  .footer-copy, .footer-social a { color: #444 !important; }
}
