/* ==========================================================================
   PREMIUM DESIGN SYSTEM (Apple / Linear Inspired)
   Optimized for Glassmorphism, Deep Dark Mode & High Conversions
   ========================================================================== */

/* ===== Design Tokens (LIGHT defaults) ===== */
:root {
  /* Palette (LIGHT) */
  --bg: #ffffff;
  --bg-contrast: #f8fafc;
  --surface: rgba(250, 250, 252, 0.6); /* Translucent for glass */
  --elev-1: rgba(255, 255, 255, 0.7);
  --elev-2: rgba(255, 255, 255, 0.9);
  --ink: #09090b;
  --muted: #52525b;
  --line: rgba(0, 0, 0, 0.08);
  --glass: rgba(0, 0, 0, 0.03);
  
  /* Elegant Purple Accents */
  --accent: #7c3aed;
  --accent-strong: #5b21b6;
  /* Matches --accent-strong — the lighter #a78bfa only reached ~2.7:1 on
     white, below the 3:1 WCAG minimum for focus-ring visibility. */
  --focus: #5b21b6;

  /* Premium Apple-Style Soft Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);

  /* Radii & Rhythm */
  --radius-s: 10px; 
  --radius-m: 16px; 
  --radius-l: 24px;
  
  /* Type & Animation */
  --font-sans: "Inter", system-ui, -apple-system, "SF Pro Text", Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "SF Pro Display", -apple-system, ui-serif, Georgia, serif;
  --gutter: 24px; 
  --grid-gap: 1.2rem; 
  --card-padding: 1.5rem; 
  --ease: cubic-bezier(0.16, 1, 0.3, 1); /* Buttery smooth Apple ease */
}

/* ===== Dark Tokens (DEEP PREMIUM DARK MODE) ===== */
:root[data-theme="dark"] {
  --bg: #09090b; /* Deep, neutral dark */
  --bg-contrast: #000000;
  --surface: rgba(24, 24, 27, 0.4); /* Glass base */
  --elev-1: rgba(39, 39, 42, 0.4);
  --elev-2: rgba(63, 63, 70, 0.4);
  --ink: #fafafa;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.04);
  
  /* Vibrant Purple for Dark Mode */
  --accent: #8b5cf6;
  --accent-strong: #a78bfa;
  --focus: #c4b5fd;

  /* Dark layered shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.2);
}

/* Respect system preferences */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { color-scheme: light; } }

/* ===== Base & Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; 
  font-family: var(--font-sans);
  background: var(--bg); 
  color: var(--ink);
  -webkit-font-smoothing: antialiased; 
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Ambient dark mode glow */
  background-image: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
.container { container-type: inline-size; max-width: 1100px; margin-inline: auto; padding-inline: var(--gutter); }
a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }

/* ===== Typography ===== */
h1, h2, h3 { 
  font-family: var(--font-serif); 
  letter-spacing: -0.02em; 
  margin: 0 0 0.3em; 
  line-height: 1.15; 
  font-weight: 600;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 0.65em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); margin-bottom: 0.38em; font-weight: 500; }
p { color: var(--muted); line-height: 1.7; margin: 0 0 0.8rem; font-size: 1.05rem; }

section { padding: 56px var(--gutter); }
section + section { margin-top: 0; }

/* Skip-link */
.skip-link { position: absolute; inset-inline-start: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; inset-inline-start: 1rem; top: 1rem; padding: 0.6rem 1rem; background: var(--elev-2); color: var(--ink); border-radius: 10px; z-index: 9999; box-shadow: var(--shadow-md); }

/* RTL: Persian pages set dir="rtl" on <html> — swap in a Persian-friendly body font */
html[dir="rtl"] body { font-family: "Vazirmatn", Tahoma, Arial, var(--font-sans); }

/* Hide the GTM noscript fallback iframe without an inline style */
.gtm-noscript-frame { display: none; visibility: hidden; }

/* Visually hidden (accessible labels) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== Header / Glass Nav ===== */
.site-nav {
  background: var(--surface);
  position: sticky; 
  top: 10px; 
  z-index: 50; 
  padding: 10px var(--gutter);
  border: 1px solid var(--line);
  border-radius: 100px; /* Floating pill effect */
  max-width: 1100px;
  margin: 10px auto;
  box-shadow: var(--shadow-sm);
}
@supports(backdrop-filter: blur(12px)) { 
  .site-nav { 
    backdrop-filter: saturate(180%) blur(16px); 
    -webkit-backdrop-filter: saturate(180%) blur(16px); 
  } 
}

.nav-content { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 600; flex: 0 0 auto; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: var(--shadow-sm); }

/* Primary nav: link list + utility cluster (theme toggle / language) */
.primary-nav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-item__row { display: flex; align-items: center; }
.nav-link {
  display: inline-block; padding: 8px 14px; border-radius: 100px; color: var(--muted);
  font-size: 0.95rem; font-weight: 500; white-space: nowrap;
  transition: all 0.25s var(--ease);
}
.nav-link:hover { color: var(--ink); background: var(--glass); }
.nav-link[aria-current="page"] { color: var(--ink); background: var(--glass); font-weight: 600; }

.nav-utility {
  display: flex; align-items: center; gap: 8px;
  margin-inline-start: 8px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line);
}
/* Compact icon-only variant — .btn.lang-switch beats the plain .btn rule
   below on specificity, since .btn sets padding later in the cascade */
.btn.lang-switch {
  margin-inline-start: 0; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; gap: 0;
}
.lang-switch span { display: none; }

/* Dropdown / submenu (e.g. Services -> individual offerings) */
.submenu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-inline-start: -4px; padding: 0;
  border: none; border-radius: 50%; background: transparent; color: var(--muted);
  cursor: pointer; transition: transform 0.25s var(--ease), color 0.2s var(--ease);
}
.submenu-toggle:hover { color: var(--accent); background: var(--glass); }
.submenu-toggle svg { width: 14px; height: 14px; stroke: currentColor; pointer-events: none; }
.submenu-toggle[aria-expanded="true"] { color: var(--accent); transform: rotate(180deg); }

.submenu {
  list-style: none; margin: 0; padding: 0;
  max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
  transition: max-height 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-item.submenu-open .submenu { max-height: 320px; opacity: 1; visibility: visible; }
.submenu a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s var(--ease); }
.submenu a:hover { color: var(--accent); }

@media (min-width: 901px) {
  .submenu {
    position: absolute; top: calc(100% + 10px); inset-inline-start: 0; z-index: 60;
    min-width: 230px; padding: 6px; background: var(--elev-2); border: 1px solid var(--line);
    border-radius: var(--radius-m); box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .submenu li + li { margin-top: 2px; }
  .submenu a { display: block; padding: 10px 14px; border-radius: 8px; }
  .submenu a:hover { background: var(--glass); }
}

/* Hamburger trigger + stable actions (résumé always visible) */
.nav-cta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nav-cta .btn { width: auto; margin-bottom: 0; white-space: nowrap; }
.hamburger {
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--elev-1); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.hamburger:hover { background: var(--glass); box-shadow: var(--shadow-md); }
.hamburger__bar { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--accent); transition: transform 0.25s var(--ease), opacity 0.2s var(--ease); }
.site-nav.nav-open .hamburger__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-nav.nav-open .hamburger__bar:nth-child(2) { opacity: 0; }
.site-nav.nav-open .hamburger__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media(max-width: 600px) {
  .site-nav { border-radius: 0; margin: 0; top: 0; border-top: none; border-left: none; border-right: none; }
  /* Keep the name visible at every width — tighten instead of hiding it */
  .brand { gap: 8px; }
  .brand span { font-size: 0.9rem; }
  .brand img { width: 26px; height: 26px; }
  .nav-cta { gap: 6px; }
  .nav-cta .btn { padding: 8px 14px; font-size: 0.9rem; }
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--elev-1); color: var(--ink); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--glass); }
.theme-toggle__icon { width: 18px; height: 18px; color: var(--accent); }
.theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: block; }

/* Language switcher: icon-only, sized to match .theme-toggle */
.lang-switch svg { width: 18px; height: 18px; flex: 0 0 auto; }
/* Active Navigation Link */
.nav-link[aria-current="page"],
.submenu a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  border-radius: var(--radius-s);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 12px 24px; border-radius: 100px; border: 1px solid var(--line);
  color: var(--ink); background: var(--elev-1); font-weight: 500; font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: color-mix(in oklab, var(--line), var(--accent) 30%); }
.btn:active { transform: translateY(0); }

/* Premium Primary Button (Purple Glow) */
.btn.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: var(--shadow-glow), var(--shadow-sm);
}
.btn.primary:hover {
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4), var(--shadow-md);
  transform: translateY(-2px) scale(1.02);
}
:where(a, button, .btn):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus) 35%, transparent);
}

/* ===== Hero ===== */
.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 44px var(--gutter) 20px;
  position: relative; overflow: hidden; isolation: isolate;
}
/* Signature accent: an ascending line — the one deliberate visual flourish on the page */
.hero__signature {
  position: absolute; top: 6%; inset-inline-end: -6%;
  width: min(42vw, 520px); height: auto;
  opacity: 0.14; z-index: 0; pointer-events: none;
}
:root[data-theme="dark"] .hero__signature { opacity: 0.22; }
@media (max-width: 900px) { .hero__signature { display: none; } }
.hero .profile-photo { position: relative; z-index: 1; }
/* Centering lived only on the outer .hero wrapper and relied on inheritance
   to reach every child — declared again here, directly on the text
   container, so it can't silently break if that chain is ever disrupted. */
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero__trust { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.kicker {
  color: var(--accent); font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.75rem;
}
/* Quieter variant — descriptive line rather than an accent-colored eyebrow tag */
.kicker--muted { color: var(--muted); font-weight: 500; margin-bottom: 0.5rem; }
.heading-hero {
  background: linear-gradient(135deg, var(--ink) 20%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="dark"] .heading-hero {
  background: linear-gradient(135deg, #ffffff 30%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Balance the two-line wrap on the home/fa hero headline specifically —
   other pages reuse .heading-hero with different (often shorter) text.
   Sized down from the global h1 clamp so the hero stays compact enough
   for the proof stats to land in the first view. */
.hero .heading-hero { text-wrap: balance; font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
.hero .profile-photo {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid color-mix(in oklab, var(--line), var(--accent) 40%);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  margin-bottom: 0.85rem;
}
.hero .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1rem; }
.hero-cta { margin-top: 0.75rem; margin-bottom: 0.5rem; }
.hero-chips { justify-content: center; margin-top: 0.75rem; }
/* margin-inline: auto — .hero-content shrinks to its widest child (flex
   align-items: center), so a narrower max-width child without auto margins
   sits flush at the start edge instead of centering within it */
.hero .lede { font-size: 1.1rem; line-height: 1.55; margin-bottom: 0.85rem; max-width: 760px; margin-inline: auto; }



/* Lighter-weight section variant — for supporting/lower-priority content, creates rhythm contrast */
.section--tight { padding-top: 36px; padding-bottom: 36px; }

/* ===== Mid-page CTA banner ===== */
.cta-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.75rem 2rem; border-radius: var(--radius-l);
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, transparent), color-mix(in oklab, var(--accent-strong) 6%, transparent));
  border: 1px solid color-mix(in oklab, var(--line), var(--accent) 25%);
}
.cta-banner__text { margin: 0; color: var(--ink); font-size: 1.1rem; font-weight: 500; }
@media (max-width: 600px) {
  .cta-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
/* Section wrapper for a standalone mid-page CTA banner */
.cta-block { padding-top: 2rem; padding-bottom: 2rem; }

/* ===== Proof / Stats Strip ===== */
.stats { padding: 8px var(--gutter) 56px; }
.stats__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  max-width: 980px; margin: 0 auto;
}
.stat { position: relative; text-align: center; padding: 0 1rem; }
.stat:not(:first-child)::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 6px; bottom: 6px; width: 1px; background: var(--line);
}
.stat__value {
  display: block; font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; color: var(--ink);
}
.stat__label { display: block; margin-top: 0.35rem; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 700px) {
  .stats__grid { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .stat::before { display: none; }
}
/* ===== Chip (Tags) ===== */
.chip {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 100px;
  background: var(--glass); border: 1px solid var(--line);
  color: var(--muted); font-size: 0.85rem; font-weight: 500;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s var(--ease);
}
.chip:hover {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--line), var(--accent) 50%);
  background: color-mix(in oklab, var(--glass), var(--accent) 10%);
}

/* ===== Glass Cards (Core Component) ===== */
.card {
  background: var(--surface); 
  border: 1px solid var(--line); 
  border-radius: var(--radius-l); 
  padding: var(--card-padding);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: all 0.4s var(--ease);
  width: 100%;
  position: relative;
  overflow: hidden;
}
/* Subtle top inner highlight for true glass edge */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  opacity: 0.5;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--line), var(--accent) 35%);
  background: var(--elev-1);
}

/* ===== Card content variants (used by service/skill cards) ===== */
.card__title { color: var(--accent); }
.card__list { color: var(--muted); padding-inline-start: 1.2rem; margin-top: 1rem; line-height: 1.7; }
.card__outcome { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
/* Link to a card's dedicated page (services cards linking out to /services/*.html) */
.card__cta { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem; color: var(--accent); font-weight: 600; }
.card__cta:hover { text-decoration: underline; }
/* Row of chips inside a card (skills/toolkit cards) */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
/* Small icon tile above a card heading (deliverables/process-step cards) */
.card__icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; border-radius: var(--radius-s); background: var(--glass); color: var(--accent); }
.card__icon svg { width: 22px; height: 22px; }

/* ===== Services Section ===== */
.svc__wrap { max-width: 1100px; margin: 0 auto; position: relative; }
.svc__head { text-align: center; max-width: 600px; margin: 0 auto 3rem; }
.svc__eyebrow { color: var(--accent); font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.svc__subtitle { color: var(--muted); font-size: 1.15rem; margin-top: 0.5rem; }
.svc__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.svc__grid {
  display: grid; gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

/* ===== Horizontally scrollable card row (home: Case Studies) =====
   Three cards fit the container exactly on desktop; a fourth (or more)
   overflows and becomes swipe/scroll-able instead of wrapping to a new row.
   The scrollbar itself is hidden — native scrollbar rendering (track/thumb/
   step-arrows) is inconsistent across browsers and reads as a stray UI
   element under the row. The partial next card + scroll-snap are the
   affordance instead; touch, trackpad, and shift+wheel all still scroll it. */
.scroll-row {
  display: flex; gap: var(--grid-gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none; -ms-overflow-style: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * {
  flex: 0 0 min(85vw, 320px);
  scroll-snap-align: start;
}
@media (min-width: 700px) {
  .scroll-row > * { flex-basis: calc((100% - 2 * var(--grid-gap)) / 3); }
}

/* ===== Experience Timeline ===== */
.experience-timeline { margin-top: 2.5rem; max-width: 800px; }
.experience-item {
  position: relative; padding-inline-start: 28px; border-inline-start: 2px solid var(--line); margin-bottom: 2rem;
}
.experience-item::before {
  content: ""; position: absolute; inset-inline-start: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 0 4px var(--bg);
}
.experience-item--last { border-inline-start-color: transparent; margin-bottom: 0; }
.experience-item h3 { color: var(--ink); margin-bottom: 0.28rem; font-size: 1.25rem; }
.experience-item__date { font-size: 0.85rem; color: var(--muted); font-weight: 400; margin-inline-start: 0.5rem; }
.experience-item ul { margin: 0.5rem 0 0 1rem; color: var(--muted); line-height: 1.7; }
.experience-item li { margin: 0.4rem 0; }

/* ===== Grid Layouts ===== */
.skills-grid {
  display: grid; gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  margin-top: 2rem;
}

/* ===== Testimonials ===== */
.testimonial-card { display: flex; flex-direction: column; justify-content: space-between; }
.testimonial-quote { font-size: 1.05rem; font-style: italic; line-height: 1.6; color: var(--ink); }
.testimonial-footer { margin-top: 1.5rem; font-weight: 600; }
.testimonial-cite { font-style: normal; font-weight: 600; color: var(--accent); }

/* ===== Certificates ===== */
.cert-container {
  display: grid; gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  margin-top: 2rem;
}
.cert-card {
  background: var(--elev-1); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 1.25rem; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: all 0.3s var(--ease);
  display: flex; align-items: center; gap: 1rem;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.cert-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in oklab, var(--line), var(--accent) 40%);
}
.cert-card h3 { font-size: 1rem; margin: 0 0 0.2rem 0; font-weight: 600; }
.cert-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ===== FAQ Accordion ===== */
/* Narrow, single-column, all collapsed by default — avoids CSS Grid stretching
   a closed card to match an open sibling's height in the same row. */
#faq .svc__grid, .faq-list {
  display: flex; flex-direction: column; gap: 0.75rem;
  max-width: 720px; margin-left: auto; margin-right: auto;
}
#faq details.card { padding: 0; overflow: hidden; cursor: pointer; }
#faq details.card > summary {
  display: flex; align-items: center; justify-content: space-between; 
  padding: 1.5rem; list-style: none; outline: none; color: var(--ink);
}
#faq details.card > summary h3 { font-family: var(--font-sans); font-size: 1.1rem; font-weight: 500; margin: 0; }
#faq details.card > summary::-webkit-details-marker { display: none; }
#faq details.card > summary::after {
  content: "+"; color: var(--accent); font-size: 1.5rem; transition: transform 0.3s var(--ease);
}
#faq details[open].card > summary::after { transform: rotate(45deg); }
#faq details.card > summary:hover { background: var(--glass); }
#faq details.card > div { padding: 0 1.5rem 1.5rem; border-top: 1px solid transparent; }
#faq details[open].card > div { border-top-color: var(--line); padding-top: 1.5rem; }

/* ===== Reusable Content Utilities ===== */
.lede { font-size: 1.15rem; color: var(--muted); max-width: 650px; }
.section-lede { color: var(--muted); max-width: 720px; }
.section-lede--spaced { margin-bottom: 1.5rem; }

/* Contact form */
.form-stack { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; text-align: start; }
.form-field {
  padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--bg-contrast); color: var(--ink); width: 100%;
  font-family: inherit; font-size: 1rem; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent); }
textarea.form-field { resize: vertical; }
/* Compact variant — blog search/sort controls */
.form-field--sm { padding: 0.6rem 0.9rem; border-radius: 10px; background: var(--elev-1); width: auto; }
.contact-card { padding: 3rem 2rem; max-width: 700px; margin: 0 auto; text-align: center; }
.contact-card h2 { color: var(--accent); }
.contact-card__lede { margin-bottom: 1.25rem; }
.contact-proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 2rem; }
.contact-submit { width: 100%; margin-top: 0.5rem; padding: 1rem; }
.contact-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.form-trust { text-align: center; font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0; }

/* Honeypot — kept out of view for humans, still present for simple bots that skip CSS */
.form-honeypot { display: none; }

/* Inline submit feedback (Web3Forms AJAX response) */
.form-status {
  display: none; align-items: center; justify-content: center; gap: 0.5rem;
  margin: 0.75rem 0 0; padding: 0.7rem 1rem; border-radius: var(--radius-s);
  font-size: 0.9rem; font-weight: 500; border: 1px solid var(--line);
}
.form-status:empty { display: none; }
.form-status--success, .form-status--error { display: flex; }
.form-status--success { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); background: color-mix(in oklab, var(--accent) 10%, var(--elev-1)); }
.form-status--error { color: var(--ink); border-color: var(--line); background: var(--elev-1); }
.form-status__icon { width: 18px; height: 18px; flex: 0 0 auto; }
.form-status__icon svg { width: 100%; height: 100%; }
.blog-grid { margin-top: 1.5rem; }

/* Icon buttons (footer socials, back-to-top) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { border-color: color-mix(in oklab, var(--line), var(--accent) 40%); transform: translateY(-2px); }
.icon-btn svg { stroke: var(--accent); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 8px; }
.footer-socials { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-bottom { display: flex; justify-content: center; align-items: center; gap: 0.6rem; }

/* ===== Blog Card (home page preview grid) ===== */
/* .blog-card itself is the flex column so a footer sibling (blog index variant)
   and the clickable link both share the grid-stretched height correctly. */
.blog-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.blog-card__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex: 1 1 auto; }
.blog-card__media { width: 100%; aspect-ratio: 16/9; overflow: hidden; border-bottom: 1px solid var(--line); }
.blog-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease); }
.blog-card__link:hover .blog-card__img { transform: scale(1.04); }
/* Portrait screenshots (phone UI captures) in a 16:9 card: cover() would crop
   away most of the frame. Show the full capture letterboxed instead. */
.blog-card__img--contain { object-fit: contain; background: var(--bg-contrast); }
.blog-card__body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1 1 auto; }
.blog-card__title { font-size: 1.16rem; margin-bottom: 0.5rem; color: var(--ink); }
.blog-card__excerpt { color: var(--muted); margin-bottom: 1.5rem; flex-grow: 1; }
.blog-card__cta { color: var(--accent); font-weight: 600; margin-top: auto; display: flex; align-items: center; gap: 0.4rem; }
/* Blog index variant: separate footer row (Read More + date) below the body */
.blog-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.5rem 1.5rem; }
.blog-card__date { color: var(--muted); font-size: 0.85rem; }

/* Empty state for a visual asset not yet supplied — keeps the grid rhythm
   without a broken image request */
.blog-card__media--placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; height: 100%; color: var(--muted);
  background: var(--glass);
}
.blog-card__media--placeholder span { font-size: 0.8rem; font-weight: 500; }

/* ===== Blog index: breadcrumb, controls, pagination ===== */
.breadcrumb-nav { margin: 0.6rem 0 0.4rem; }
.breadcrumb-list { list-style: none; display: flex; gap: 0.4rem; padding: 0; margin: 0; color: var(--muted); font-size: 0.92rem; }
.breadcrumb-list a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line); transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.breadcrumb-list a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.breadcrumb-list [aria-current] { color: var(--ink); }

.blog-controls { margin-top: 0.8rem; }
.blog-controls__form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: center; }
.blog-search { min-width: 220px; }

.blog-pager {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 1rem 0;
  visibility: hidden;
}
.blog-pager.is-visible { visibility: visible; }
.blog-pager__status { align-self: center; color: var(--muted); }

.back-link-row { text-align: center; margin: 0.6rem 0; }
.empty-state { color: var(--muted); text-align: center; }

/* ===== Footer ===== */
.footer {
  margin-top: 60px; padding: 40px var(--gutter); color: var(--muted);
  border-top: 1px solid var(--line); background: var(--bg-contrast); text-align: center;
}

/* ===== Responsive Utilities ===== */
@media(max-width: 900px) {
  :root { --gutter: 20px; --grid-gap: 1rem; --card-padding: 1.25rem; }
  .hero { padding: 28px var(--gutter) 16px; }

  .hamburger { display: inline-flex; }
  .nav-content { flex-wrap: wrap; }
  .nav-cta { order: 2; }

  .primary-nav {
    order: 3; flex-basis: 100%;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    max-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
    transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease);
  }
  .site-nav.nav-open .primary-nav {
    max-height: 70vh; overflow-y: auto; visibility: visible; opacity: 1;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
  .nav-link { display: block; }
  .submenu { padding-inline-start: 16px; }
  .submenu a { display: block; padding: 10px 14px; }

  .nav-utility {
    flex-direction: column; align-items: flex-start; width: 100%; gap: 10px;
    margin-inline-start: 0; padding-inline-start: 0; border-inline-start: none;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  }
}

@media(max-width: 600px) {
  :root { --gutter: 16px; --card-padding: 1.1rem; }
  section { padding: 40px var(--gutter); }
  .btn { width: 100%; margin-bottom: 10px; }
  .experience-item { padding-inline-start: 20px; }
}

/* ===== Accessibility / Motion ===== */
@media(prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* ==========================================
   CLIENT LOGO STRIP (Normalized & Themed)
========================================== */
.logo-strip-section {
  padding-top: 1rem;
  padding-bottom: 4rem;
  text-align: center;
}

.logo-strip__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-weight: 600;
}

.logo-strip__track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem; /* Tighter gap for mobile */
}

/* Every logo renders in an identical bounding box regardless of its own
   intrinsic aspect ratio — object-fit: contain shrinks wide wordmarks to
   fit the width and narrow/tall marks to fit the height, so nothing needs
   per-logo optical-scale tweaking as new logos are added. */
.client-logo {
  width: 100px;
  height: 30px;
  object-fit: contain;

  /* Source logos are either dark-on-transparent (most) or white-on-transparent
     (e.g. Wallex, Snapp) — --logo-invert flips per logo tone × active theme
     below, so every mark stays visible against both a light and dark page
     background instead of one specific case going invisible. */
  --logo-invert: 0;
  filter: grayscale(100%) invert(var(--logo-invert)) opacity(0.55);
  transition: filter 0.3s var(--ease), transform 0.3s var(--ease);
  cursor: default;
}

/* Dark mode inverts dark-toned logos (the default) so they read light-on-dark */
:root[data-theme="dark"] .client-logo { --logo-invert: 1; }

/* Logos already white/light-toned in their source file need the opposite:
   invert for light mode (dark bg the graphic assumed becomes readable
   against a white page) and stay as-is in dark mode. */
.client-logo[data-tone="light"] { --logo-invert: 1; }
:root[data-theme="dark"] .client-logo[data-tone="light"] { --logo-invert: 0; }

/* Premium Hover State */
.client-logo:hover {
  filter: grayscale(100%) invert(var(--logo-invert)) opacity(1);
  transform: translateY(-2px);
}

/* Responsive Desktop Scaling */
@media (min-width: 768px) {
  .logo-strip__track {
    gap: 4.5rem; /* Wider spread on desktop */
  }

  .client-logo {
    width: 120px;
    height: 36px;
  }
}
