/* ============================================================
   kaka-d — Corporate one-page template
   Stylesheet: tokens, base, components, layout, responsive
   Static fonts only (no CDN). Drop Vazirmatn .woff2 into /fonts.
   ============================================================ */

/* ---------- Static font hook (works offline; falls back to system) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn"), local("Vazirmatn Regular"),
       url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn Medium"),
       url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn SemiBold"),
       url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn Bold"),
       url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn Black"),
       url("../fonts/Vazirmatn-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette — organic agriculture */
  --green-950: #0f2a1a;
  --green-900: #15351f;
  --green-800: #1c4429;
  --green-700: #225235;
  --green-600: #2c6b43;
  --green-500: #3a8557;
  --green-300: #8fc0a0;
  --green-100: #dceadf;

  --gold-600: #b08433;
  --gold-500: #c39a4e;
  --gold-300: #e4cf9a;

  --cream:  #f6f2e8;
  --paper:  #fbf9f3;
  --sand:   #efe9da;

  --ink:    #16211a;
  --ink-soft:#33433a;
  --muted:  #6a7a6e;
  --line:   #e3ddcd;

  --white:  #ffffff;

  /* Semantic */
  --bg: var(--paper);
  --bg-alt: var(--cream);
  --surface: var(--white);
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--gold-500);
  --primary: var(--green-700);

  /* Type */
  --font: "Vazirmatn", Tahoma, "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", sans-serif;

  /* Spacing & shape */
  --container: 1180px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 10px rgba(18, 40, 25, .06);
  --shadow:    0 14px 40px -18px rgba(18, 40, 25, .28);
  --shadow-lg: 0 40px 80px -40px rgba(18, 40, 25, .45);

  --section-y: clamp(64px, 9vw, 130px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--green-300); outline-offset: 3px; border-radius: 6px; }

/* ---------- Bilingual visibility ---------- */
/* Default = Persian. JS toggles [data-lang] on <html>. */
[data-lang="fa"] .en-only { display: none !important; }
[data-lang="en"] .fa-only { display: none !important; }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--green-900); color: #eef3ec; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-600);
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px;
}
.section--dark .eyebrow { color: var(--gold-300); }

.section-head { max-width: 660px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { }

h1, h2, h3, h4 { line-height: 1.18; font-weight: 800; color: inherit; letter-spacing: -.01em; }
.section--dark h2, .section--dark h3 { color: #fff; }

.h-title { font-size: clamp(1.9rem, 3.6vw, 3rem); margin-top: 14px; font-weight: 800; }
.lead { color: var(--text-muted); font-size: clamp(1rem, 1.4vw, 1.15rem); margin-top: 18px; }
.section--dark .lead { color: #c4d4c8; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 700; font-size: .98rem;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--green-800); transform: translateY(-2px); }
.btn-gold { background: var(--accent); color: var(--green-950); }
.btn-gold:hover { background: var(--gold-600); color: #fff; transform: translateY(-2px); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--green-600); color: var(--green-700); transform: translateY(-2px); }
.btn-outline-light { border: 1.5px solid rgba(255,255,255,.35); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }

/* flip arrow direction for RTL */
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(34,82,53,.05) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, var(--green-100), var(--sand));
  display: grid; place-items: center;
  color: var(--green-700); border-radius: var(--radius);
}
.ph::after {
  content: attr(data-label);
  font-size: .82rem; font-weight: 600; letter-spacing: .04em;
  opacity: .65; padding: 6px 12px; border: 1px dashed rgba(34,82,53,.35);
  border-radius: 999px; background: rgba(255,255,255,.4);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
  padding-block: 18px;
}
.header.scrolled {
  background: rgba(251, 249, 243, .9);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line), var(--shadow-sm);
  padding-block: 10px;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(150deg, var(--green-600), var(--green-800));
  display: grid; place-items: center; color: var(--gold-300); flex: none;
  box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 22px; height: 22px; }
.brand b { color: var(--green-800); }
.brand .dot { color: var(--accent); }
.header.scrolled .brand, .nav-open .brand { color: var(--ink); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: .96rem;
  color: var(--ink-soft); transition: background .2s ease, color .2s ease;
}
.nav-links a:hover { background: var(--green-100); color: var(--green-800); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px; background: var(--surface);
}
.lang-toggle button {
  padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem;
  color: var(--muted); transition: all .2s ease;
}
.lang-toggle button.active { background: var(--green-700); color: #fff; }
.lang-toggle-mobile { display: none; }

.burger {
  display: none; width: 46px; height: 46px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface);
  position: relative; flex: none;
}
.burger span, .burger::before, .burger::after {
  content: ""; position: absolute; inset-inline: 12px; height: 2px; border-radius: 2px;
  background: var(--ink); transition: transform .3s ease, opacity .25s ease, top .3s ease;
}
.burger span { top: 22px; }
.burger::before { top: 16px; }
.burger::after { top: 28px; }
.nav-open .burger span { opacity: 0; }
.nav-open .burger::before { top: 22px; transform: rotate(45deg); }
.nav-open .burger::after { top: 22px; transform: rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; padding-top: clamp(120px, 16vh, 180px); padding-bottom: var(--section-y);
  background:
    radial-gradient(60% 80% at 85% 0%, rgba(195,154,78,.14), transparent 60%),
    radial-gradient(50% 60% at 0% 30%, rgba(58,133,87,.12), transparent 55%),
    var(--bg);
  overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(30px, 5vw, 70px);
  align-items: center;
}
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); font-weight: 900; letter-spacing: -.025em; }
.hero h1 .accent { color: var(--green-600); position: relative; white-space: nowrap; }
.hero h1 .accent::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .06em; height: .22em;
  background: var(--gold-300); border-radius: 4px; z-index: -1; opacity: .8;
}
.hero p.lead { max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-mini {
  display: flex; gap: clamp(20px, 4vw, 44px); margin-top: 44px;
  padding-top: 28px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.hero-mini .num { font-size: 1.7rem; font-weight: 800; color: var(--green-800); }
.hero-mini .lbl { font-size: .85rem; color: var(--muted); }

.hero-art { position: relative; }
.hero-art .ph { aspect-ratio: 4/5; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.hero-badge {
  position: absolute; inset-block-end: -22px; inset-inline-start: -22px;
  background: var(--surface); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line);
}
.hero-badge .ico {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: var(--green-100); display: grid; place-items: center; color: var(--green-700);
}
.hero-badge .ico svg { width: 24px; height: 24px; }
.hero-badge b { display: block; font-size: 1.05rem; }
.hero-badge span { font-size: .82rem; color: var(--muted); }
.hero-badge2 {
  position: absolute; inset-block-start: 24px; inset-inline-end: -18px;
  background: var(--green-800); color: #fff; border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; gap: 8px;
}
.hero-badge2 svg { width: 18px; height: 18px; color: var(--gold-300); }

/* marquee strip */
.trust {
  margin-top: clamp(40px, 6vw, 70px); border-block: 1px solid var(--line);
  padding-block: 18px; display: flex; align-items: center; gap: 40px;
  flex-wrap: wrap; justify-content: center; color: var(--muted);
  font-weight: 600; font-size: .92rem;
}
.trust .t-item { display: flex; align-items: center; gap: 10px; }
.trust .t-item svg { width: 20px; height: 20px; color: var(--green-500); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(34px, 5vw, 70px); align-items: center; }
.about-art { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about-art .ph { border-radius: var(--radius); }
.about-art .ph:nth-child(1) { aspect-ratio: 3/4; }
.about-art .ph:nth-child(2) { aspect-ratio: 3/4; margin-top: 36px; }
.about-stamp {
  position: absolute; inset-block-end: -18px; inset-inline-end: -10px;
  background: var(--accent); color: var(--green-950); border-radius: 50%;
  width: 110px; height: 110px; display: grid; place-items: center; text-align: center;
  font-weight: 800; line-height: 1.2; box-shadow: var(--shadow); padding: 10px;
  font-size: .82rem;
}
.about-stamp b { display: block; font-size: 1.7rem; }

.values { display: grid; gap: 18px; margin-top: 30px; }
.value { display: flex; gap: 16px; align-items: flex-start; }
.value .v-ico {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: var(--green-100); color: var(--green-700); display: grid; place-items: center;
}
.value .v-ico svg { width: 24px; height: 24px; }
.value h4 { font-size: 1.12rem; }
.value p { color: var(--text-muted); font-size: .98rem; margin-top: 2px; }

/* ============================================================
   CATEGORIES
   ============================================================ */
.cat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; position: relative; overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  display: flex; flex-direction: column;
}
.cat-card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--green-600), var(--accent));
  transform: scaleX(0); transform-origin: inline-start; transition: transform .35s ease;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.cat-card:hover::before { transform: scaleX(1); }
.cat-num { font-size: .8rem; font-weight: 800; color: var(--accent); letter-spacing: .1em; }
.cat-ico {
  width: 56px; height: 56px; border-radius: 16px; margin-top: 10px; margin-bottom: 18px;
  background: var(--green-100); color: var(--green-700); display: grid; place-items: center;
  transition: background .3s ease, color .3s ease;
}
.cat-ico svg { width: 30px; height: 30px; }
.cat-card:hover .cat-ico { background: var(--green-700); color: var(--gold-300); }
.cat-card h3 { font-size: 1.3rem; }
.cat-card > p { color: var(--text-muted); font-size: .97rem; margin-top: 8px; }
.cat-list { margin-top: 18px; display: grid; gap: 9px; }
.cat-list li { display: flex; align-items: flex-start; gap: 9px; font-size: .94rem; color: var(--ink-soft); }
.cat-list li svg { width: 17px; height: 17px; color: var(--green-500); flex: none; margin-top: 5px; }
.cat-link {
  margin-top: auto; padding-top: 20px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--green-700); font-size: .95rem;
}
.cat-link svg { width: 16px; height: 16px; transition: transform .25s ease; }
.cat-card:hover .cat-link svg { transform: translateX(4px); }
[dir="rtl"] .cat-link svg { transform: scaleX(-1); }
[dir="rtl"] .cat-card:hover .cat-link svg { transform: scaleX(-1) translateX(4px); }

/* ============================================================
   PROJECTS SLIDER
   ============================================================ */
.proj-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.slider-nav { display: flex; gap: 10px; }
.slider-nav button {
  width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--ink);
  transition: all .2s ease;
}
.slider-nav button:hover { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.slider-nav button svg { width: 20px; height: 20px; }
[dir="rtl"] .slider-nav button svg { transform: scaleX(-1); }

.slider-wrap { overflow: hidden; margin-top: 38px; }
.slider-track {
  display: flex; gap: 24px; transition: transform .5s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.proj-card {
  flex: 0 0 calc((100% - 48px) / 3); min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .3s ease, transform .3s ease;
}
.proj-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.proj-card .ph { aspect-ratio: 16/11; border-radius: 0; }
.proj-body { padding: 22px 24px 26px; }
.proj-tag {
  display: inline-block; font-size: .76rem; font-weight: 700; color: var(--green-700);
  background: var(--green-100); padding: 4px 12px; border-radius: 999px; letter-spacing: .03em;
}
.proj-card h3 { font-size: 1.18rem; margin-top: 14px; }
.proj-card p { color: var(--text-muted); font-size: .94rem; margin-top: 8px; }
.slider-dots { display: flex; justify-content: center; gap: 9px; margin-top: 34px; }
.slider-dots button { width: 9px; height: 9px; border-radius: 999px; background: var(--line); transition: all .25s ease; }
.slider-dots button.active { width: 28px; background: var(--green-600); }

/* ============================================================
   STATS (dark)
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.stat { text-align: center; position: relative; }
.stat:not(:last-child)::after {
  content: ""; position: absolute; inset-block: 10% 10%; inset-inline-end: -14px; width: 1px;
  background: rgba(255,255,255,.14);
}
.stat .s-num { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 900; color: #fff; letter-spacing: -.02em; }
.stat .s-num .suffix { color: var(--gold-300); }
.stat .s-lbl { color: #b7c8bc; margin-top: 6px; font-weight: 600; font-size: .98rem; }

/* ============================================================
   TEAM
   ============================================================ */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.member { text-align: center; }
.member .ph { aspect-ratio: 1; border-radius: var(--radius); margin-bottom: 16px; }
.member-photo {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
}
.member .socials {
  position: absolute; inset-block-end: 12px; inset-inline: 0; display: flex; justify-content: center; gap: 8px;
  opacity: 0; transform: translateY(10px); transition: all .3s ease;
}
.member:hover .socials { opacity: 1; transform: translateY(0); }
.member .socials a {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.92);
  display: grid; place-items: center; color: var(--green-800);
}
.member .socials a:hover { background: var(--green-700); color: #fff; }
.member .socials svg { width: 17px; height: 17px; }
.member h4 { font-size: 1.12rem; }
.member .role { color: var(--accent); font-weight: 600; font-size: .9rem; margin-top: 2px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(34px, 5vw, 64px); }
.contact-info { display: grid; gap: 18px; align-content: start; }
.ci-item {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.ci-item .ci-ico {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: var(--green-100); color: var(--green-700); display: grid; place-items: center;
}
.ci-item .ci-ico svg { width: 23px; height: 23px; }
.ci-item .ci-label { font-size: .82rem; color: var(--muted); }
.ci-item b { font-size: 1.02rem; }

.form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 40px); box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.field label .req { color: #c0573f; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--paper);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(58,133,87,.12);
}
.field.invalid input, .field.invalid textarea { border-color: #d2604a; box-shadow: 0 0 0 4px rgba(210,96,74,.1); }
.field .err { color: #c0573f; font-size: .82rem; margin-top: 6px; display: none; }
.field.invalid .err { display: block; }
.form-note {
  margin-top: 14px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--green-100); color: var(--green-800); font-weight: 600; font-size: .92rem;
  display: none;
}
.form-note.show { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--green-950); color: #c3d2c7; padding-block: clamp(50px, 7vw, 80px) 30px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px;
  padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer .brand { color: #fff; margin-bottom: 18px; }
.footer .brand b { color: #fff; }
.footer p.f-desc { font-size: .94rem; max-width: 32ch; color: #a8bbad; }
.footer h5 { color: #fff; font-size: 1rem; margin-bottom: 18px; font-weight: 700; }
.footer-col a { display: block; padding: 6px 0; color: #a8bbad; font-size: .94rem; transition: color .2s ease; }
.footer-col a:hover { color: var(--gold-300); }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.08);
  display: grid; place-items: center; color: #cdd9d0; transition: all .2s ease;
}
.footer-social a:hover { background: var(--green-600); color: #fff; }
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom {
  padding-top: 26px; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; font-size: .88rem; color: #8ba291;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-card { flex-basis: calc((100% - 24px) / 2); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset-block-start: 0; inset-inline-end: 0; height: 100dvh; width: min(82vw, 340px);
    background: var(--paper); flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; padding: 100px 24px 30px; box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1); z-index: 90;
  }
  [dir="rtl"] .nav-links { inset-inline-end: 0; inset-inline-start: auto; transform: translateX(-100%); }
  .nav-open .nav-links { transform: translateX(0); }
  .nav-links a { padding: 14px 16px; font-size: 1.05rem; border-radius: 12px; }
  .burger { display: block; z-index: 95; }
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(15,42,26,.5); z-index: 80;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
  }
  .nav-open .nav-backdrop { opacity: 1; visibility: visible; }

  .brand-name { display: none; }
  .nav-actions .btn { display: none; }
  .nav-actions .lang-toggle { display: none; }
  .lang-toggle-mobile { display: inline-flex; margin-top: 8px; align-self: center; }

  .hero-grid { grid-template-columns: 1fr; gap: 50px; }
  .hero-art { max-width: 460px; margin-inline: auto; width: 100%; }
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 20px; }
  .stat:nth-child(2)::after { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .cat-grid { grid-template-columns: 1fr; }
  .proj-card { flex-basis: 100%; }
  .team-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-mini { gap: 22px; }
  .hero-badge { inset-inline-start: 0; }
  .hero-badge2 { inset-inline-end: 0; }
  .stat:not(:last-child)::after { display: none; }
}

/* hide focus ring for the lang toggle pressed state cleanliness */
.lang-toggle button:focus-visible { outline-offset: 1px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,42,26,.55); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); width: min(600px, 100%);
  max-height: 82vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.97);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal-box { transform: none; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 28px 28px 0; gap: 16px;
}
.modal-head h3 { font-size: 1.25rem; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-100); display: grid; place-items: center;
  color: var(--green-700); flex: none; transition: all .2s ease;
}
.modal-close:hover { background: #fde; color: #c0573f; }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 28px 28px; }
.modal-desc { font-size: .97rem; color: var(--text-muted); line-height: 1.9; margin-bottom: 24px; }
.modal-links-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); margin-bottom: 12px;
}
.modal-links { display: flex; flex-direction: column; gap: 10px; }
.modal-link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  color: var(--green-700); font-size: .92rem; font-weight: 600;
  transition: all .2s ease;
}
.modal-link-item:hover { background: var(--green-100); border-color: var(--green-600); }
.modal-link-item svg { width: 16px; height: 16px; flex: none; }
