/* ── Base ───────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: 1.65;
  background-color: var(--color-bg);
  color: var(--color-text);
  padding-top: var(--nav-height);
  background-image: 
  radial-gradient(rgba(var(--green-rgb), 0.04) 1px, transparent 1px),
  linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
  linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px, 48px 48px, 48px 48px;
  background-position: 0 0, 0 0, 0 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--color-text);
}

p { color: var(--color-text-muted); }

a { transition: color var(--t-fast); }

a:not(.btn):not(.project-link-chip):not(.nav-logo):hover {
  color: var(--color-accent);
}

/* ── Layout ─────────────────────────────────────── */
.container {
  width: 90%;
  max-width: 1180px;
  margin: 0 auto;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-lg); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-lg); }

/* ── Flex helpers ───────────────────────────────── */
.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; justify-content: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.gap-sm         { gap: var(--sp-sm); }
.gap-md         { gap: var(--sp-md); }
.gap-lg         { gap: var(--sp-lg); }

/* ── Spacing utilities ──────────────────────────── */
.mt-xs  { margin-top: var(--sp-xs); }
.mt-sm  { margin-top: var(--sp-sm); }
.mt-md  { margin-top: var(--sp-md); }
.mt-lg  { margin-top: var(--sp-lg); }
.mt-xl  { margin-top: var(--sp-xl); }
.mt-2xl { margin-top: var(--sp-2xl); }

.py-sm  { padding-top: var(--sp-sm);  padding-bottom: var(--sp-sm); }
.py-md  { padding-top: var(--sp-md);  padding-bottom: var(--sp-md); }
.py-lg  { padding-top: var(--sp-lg);  padding-bottom: var(--sp-lg); }
.py-xl  { padding-top: var(--sp-xl);  padding-bottom: var(--sp-xl); }
.py-2xl { padding-top: var(--sp-2xl); padding-bottom: var(--sp-2xl); }
.py-3xl { padding-top: var(--sp-3xl); padding-bottom: var(--sp-3xl); }

.px-sm  { padding-left: var(--sp-sm);  padding-right: var(--sp-sm); }
.px-md  { padding-left: var(--sp-md);  padding-right: var(--sp-md); }
.px-lg  { padding-left: var(--sp-lg);  padding-right: var(--sp-lg); }

.pt-nav { padding-top: var(--nav-height); }

/* ── Text helpers ───────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: var(--color-text); }
.text-sm      { font-size: var(--size-sm); }
.text-lg      { font-size: var(--size-lg); }
.text-xl      { font-size: var(--size-xl); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.uppercase    { text-transform: uppercase; letter-spacing: 0.12em; }

/* ── Section helpers ────────────────────────────── */
.section { padding: var(--sp-3xl) 0; }
.section-sm { padding: var(--sp-2xl) 0; }
/* Modifier: kill the top padding when a .section-sm sits directly
   under another section/CTA and shouldn't double the gap between
   them (e.g. two stacked CTA strips on the portfolio page).
   Combined-selector specificity (0,2,0) so it reliably wins over
   the base .section-sm padding shorthand regardless of source order. */
.section-sm.pt-0 { padding-top: 0; }
.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* ── Accent line decoration ─────────────────────── */
.accent-line {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-sm);
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--size-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  will-change: transform;
  transition:
    background-color 0.2s ease-out,
    color           0.2s ease-out,
    border-color    0.2s ease-out,
    box-shadow      0.2s ease-out,
    transform       0.15s ease-out;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--black);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background-color: var(--color-accent-muted);
  border-color: var(--color-accent-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
  color: var(--black);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn-outline:hover {
  background-color: var(--color-accent);
  color: var(--black);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

/* ── Fade-in scroll animation ───────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Utility ────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Page hero covers (match home .hero presentation) ── */
.about-hero,
.services-hero,
.portfolio-hero,
.contact-hero {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center right;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-3xl);
  overflow: hidden;
}

.about-hero::before,
.services-hero::before,
.portfolio-hero::before,
.contact-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.85) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 1;
}

.about-hero-content,
.services-hero-content,
.portfolio-hero-content,
.contact-hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

/* ── Animation & Delay Utilities ────────────────── */

/* Cinematic cover-image reveal: a solid veil sits over the
   hero (above the darkening gradient, below the text) and
   fades away slowly, so the photo dissolves into view while
   the heading/copy stays readable the whole time. */
@keyframes heroVeilFade {
  0%   { opacity: 1; }
  35%  { opacity: 1; }
  100% { opacity: 0; }
}

.hero-bg-animate {
  position: relative;
}

.hero-bg-animate::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--hero-veil-color, #000);
  animation: heroVeilFade 2.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-animate::after {
    animation: none;
    opacity: 0;
  }
}

/* ── Reveal band ────────────────────────────────
   For background-image bands that sit below the fold
   (e.g. .about-image-band, .contact-image-band). Pairs
   with .fade-in: the solid veil dissolves to reveal the
   photo the moment the band scrolls into view, using the
   same scroll-trigger the JS already applies for .visible. */
.reveal-band {
  position: relative;
  overflow: hidden;
  background-size: cover;
}

.reveal-band::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-bg);
  opacity: 1;
  transition: opacity 1.9s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.reveal-band.visible::after {
  opacity: 0;
}

.delay-100 { transition-delay: 0.1s; }
.delay-150 { transition-delay: 0.15s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

.heb {
  direction: rtl;
  unicode-bidi: isolate;
}