/* ==========================================================================
   SAPNA (Saman Pazhouhan Naam Avar) — Design tokens
   Brand color: #012e4b | Accent: amber | Type: Archivo/Inter/IBM Plex Mono (EN), Vazirmatn (FA)
   ========================================================================== */

:root {
  --ink: #012e4b;
  --navy: #012e4b;
  --steel: #3C6E91;
  --steel-light: #6C93AC;
  --paper: #EEF1F3;
  --paper-alt: #E2E7EA;
  --white: #FFFFFF;
  --amber: #D98E2B;
  --line: #C6D0D6;
  --text: #24333C;
  --text-muted: #5B6B74;

  --brand: 'Archivo', sans-serif;
  --display: 'Inter', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'Inter', sans-serif;

  --display-fa: 'Vazirmatn', sans-serif;
  --body-fa: 'Vazirmatn', sans-serif;
  --mono-fa: 'Vazirmatn', sans-serif;

  --max: 1180px;
}

/* Force a single consistent typeface (Vazirmatn) across every element on
   Farsi pages. This is intentionally a blanket rule with !important so no
   individual element can ever fall back to a Latin font by accident. */
html[dir="rtl"] * { font-family: var(--body-fa) !important; letter-spacing: normal !important; }
html[dir="rtl"] .eyebrow::before { transform: scaleX(-1); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* -------------------- blueprint grid backdrop -------------------- */
.blueprint {
  position: relative;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.corner-tick {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--amber);
}
.corner-tick.tl { top: 18px; left: 18px; border-right: none; border-bottom: none; }
.corner-tick.tr { top: 18px; right: 18px; border-left: none; border-bottom: none; }
.corner-tick.bl { bottom: 18px; left: 18px; border-right: none; border-top: none; }
.corner-tick.br { bottom: 18px; right: 18px; border-left: none; border-top: none; }

/* -------------------- logo -------------------- */
.logo-mark {
  height: 76px;
  width: auto;
  display: block;
}

/* -------------------- header / nav -------------------- */
header.site {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 104px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: nowrap;
  gap: 16px;
  position: relative;
}
.logo {
  font-family: var(--brand);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.nav-drawer {
  display: flex;
  align-items: center;
  gap: 36px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-inline-start: 12px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
nav.main { display: flex; gap: 36px; align-items: center; }
nav.main a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
nav.main a:hover, nav.main a.active {
  color: var(--white);
  border-bottom-color: var(--amber);
}
.btn {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 20px;
  border: 1px solid var(--amber);
  color: var(--amber);
  display: inline-block;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--amber); color: var(--ink); }
.btn.solid { background: var(--amber); color: var(--ink); }
.btn.solid:hover { background: #c17f22; }
.btn.light { border-color: rgba(255,255,255,0.5); color: var(--white); }
.btn.light:hover { background: var(--white); color: var(--ink); border-color: var(--white); }

/* -------------------- language switcher -------------------- */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-inline-start: 8px;
}
.lang-switch a {
  color: rgba(255,255,255,0.55);
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.2);
}
.lang-switch a.active {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
}
.lang-switch a:hover:not(.active) { color: var(--white); border-color: rgba(255,255,255,0.5); }

/* -------------------- hero -------------------- */
.hero {
  background: var(--ink);
  color: var(--white);
  padding: 96px 0 88px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--amber);
  display: inline-block;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 780px;
  margin: 0 0 22px;
}
.hero p.lede {
  font-size: 1.08rem;
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  margin: 0 0 34px;
}
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* -------------------- page header (interior pages) -------------------- */
.page-header {
  background: var(--ink);
  color: var(--white);
  padding: 64px 0 54px;
}
.page-header h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 0;
}
.page-header p {
  color: rgba(255,255,255,0.68);
  max-width: 620px;
  margin: 14px 0 0;
  font-size: 1.02rem;
}

/* -------------------- sections -------------------- */
section { padding: 84px 0; }
section.tight { padding: 64px 0; }
section.alt { background: var(--white); }

.section-head { max-width: 640px; margin: 0 0 48px; }
.section-head .eyebrow { color: var(--steel); }
.section-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  color: var(--ink);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 1.02rem; }

/* -------------------- stats strip -------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 30px 24px;
  border-inline-start: 1px solid var(--line);
}
.stat:first-child { border-inline-start: none; }
.stat .num {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--ink);
  font-weight: 500;
}
.stat .label {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* -------------------- service / capability cards -------------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card {
  background: var(--white);
  padding: 36px 32px;
  position: relative;
}
.card .tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  letter-spacing: 0.06em;
}
.card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 14px 0 12px;
  color: var(--ink);
}
.card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.card ul { margin: 14px 0 0; padding-inline-start: 18px; color: var(--text-muted); font-size: 0.92rem; }
.card ul li { margin-bottom: 6px; }

/* -------------------- project entries -------------------- */
.project {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.project:first-of-type { border-top: 1px solid var(--line); }
.project .meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--steel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.project h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 12px;
}
.project p { color: var(--text-muted); margin: 0 0 16px; }
.project .result {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper-alt);
  display: inline-block;
  padding: 8px 14px;
  border-inline-start: 3px solid var(--amber);
}
.project .figure {
  aspect-ratio: 4/3;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.project .figure img { width: 100%; height: 100%; object-fit: cover; }
.project .figure.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.project .figure.figure-grid img { display: block; }
.project .figure.figure-slideshow { position: relative; }
.project .figure.figure-slideshow img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.project .figure.figure-slideshow img.active { opacity: 1; }

/* -------------------- CTA band -------------------- */
.cta-band {
  background: var(--steel);
  color: var(--white);
  padding: 60px 0;
}
.cta-band .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 0;
  max-width: 480px;
}

/* -------------------- footer -------------------- */
footer.site {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 56px 0 32px;
  font-size: 0.9rem;
}
footer.site .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
footer.site h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 16px;
}
footer.site a { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.6); }
footer.site a:hover { color: var(--white); }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.footer-brand .logo-mark { height: 68px; flex-shrink: 0; }
.footer-brand-text { display: flex; flex-direction: column; gap: 4px; }
.footer-brand-text .name {
  font-family: var(--brand);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  line-height: 1.3;
}
html[dir="rtl"] .footer-brand-text .name { font-family: var(--display-fa); }
.footer-brand-text .tagline {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}
footer.site .bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------------------- about / values -------------------- */
.value-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.value {
  border-inline-start: 3px solid var(--steel);
  padding-inline-start: 20px;
}
.value h3 { font-family: var(--display); font-size: 1.05rem; margin: 0 0 8px; color: var(--ink); }
.value p { color: var(--text-muted); margin: 0; font-size: 0.93rem; }

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.person .photo {
  aspect-ratio: 1;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  overflow: hidden;
}
.person .photo img { width: 100%; height: 100%; object-fit: cover; }
.person h4 { font-family: var(--display); margin: 0 0 2px; font-size: 1.02rem; color: var(--ink); }
.person .role { font-family: var(--mono); font-size: 0.75rem; color: var(--steel); text-transform: uppercase; letter-spacing: 0.04em; }

/* -------------------- contact -------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 120px; }
.info-item { margin-bottom: 28px; }
.info-item .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.info-item .v { font-size: 1.02rem; color: var(--ink); }
.info-item .v.small { font-size: 0.92rem; color: var(--text-muted); }

/* -------------------- responsive -------------------- */
@media (min-width: 901px) and (max-width: 1200px) {
  .logo { font-size: 1.2rem; }
  .logo-mark { height: 60px; }
  .nav-drawer { gap: 20px; }
  nav.main { gap: 20px; }
}

@media (max-width: 900px) {
  header.site .wrap { flex-wrap: wrap; }
  .logo { font-size: 0.98rem; flex: 1 1 auto; }
  .logo-mark { height: 38px; }
  .nav-toggle { display: block; }
  .nav-drawer {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 14px;
    padding-top: 8px;
  }
  body.nav-open .nav-drawer { display: flex; }
  nav.main { flex-direction: column; gap: 0; align-items: stretch; }
  nav.main a {
    padding: 14px 2px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-bottom-width: 1px;
  }
  nav.main a.active, nav.main a:hover { border-bottom: 2px solid var(--amber); }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 14px 0 6px;
  }
  .header-actions .btn { text-align: center; }
  .lang-switch { justify-content: center; margin-inline-start: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .grid-3, .grid-2, .value-list, .team-grid, .contact-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  footer.site .cols { grid-template-columns: repeat(2, 1fr); }
  footer.site .cols > div:first-child { grid-column: 1 / -1; margin-bottom: 8px; }
}

@media (max-width: 420px) {
  .logo { font-size: 0.86rem; }
  .logo-mark { height: 32px; }
  .footer-brand .logo-mark { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
