/* ==========================================================================
   FABROTECH — Design tokens
   Palette pulled from the brand's own HMI sage (#9db2a8), paired with a
   deep steel ink and a molten-metal ember used only as a spark accent.
   Persian sets in Vazirmatn throughout; English pairs a technical display
   face (Space Grotesk) with IBM Plex Sans, plus IBM Plex Mono for the
   small "calibration tag" labels — a nod to the HMI screens themselves.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  /* Color */
  --bg: #eef1ee;
  --bg-alt: #e3e8e3;
  --panel: #ffffff;
  --ink: #1c2420;
  --ink-soft: #55625b;
  --ink-faint: #8a958d;
  --brand: #9db2a8;
  --brand-deep: #5f7a6d;
  --brand-tint: #d9e2dc;
  --steel: #333e3a;
  --steel-deep: #212a26;
  --ember: #c1622b;
  --line: #ccd4cd;
  --line-soft: #dde3dd;

  /* Type */
  --f-fa: 'Vazirmatn', sans-serif;
  --f-display: 'Space Grotesk', 'Vazirmatn', sans-serif;
  --f-body: 'IBM Plex Sans', 'Vazirmatn', sans-serif;
  --f-mono: 'IBM Plex Mono', 'Vazirmatn', monospace;

  /* Layout */
  --container: 1200px;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 28px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --section-pad: clamp(4rem, 9vw, 8rem);

  /* Motion */
  --ease: cubic-bezier(.22, .8, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: .25s;
  --t-med: .5s;
  --t-slow: .8s;
}

[data-lang="fa"] { --f-ui: var(--f-fa); --f-head: var(--f-fa); }
[data-lang="en"] { --f-ui: var(--f-body); --f-head: var(--f-display); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
input, textarea { font: inherit; }

[dir="rtl"] body { font-family: var(--f-fa); }
[dir="ltr"] body { font-family: var(--f-body); }

.font-head { font-family: var(--f-head); }
[dir="rtl"] .font-head { font-family: var(--f-fa); }

:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: var(--section-pad); position: relative; }
.section--alt { background: var(--bg-alt); }

/* Eyebrow / calibration tag — the signature motif: a bracketed label
   echoing machine-vision targeting corners & HMI status tags. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-deep);
  padding: .4em .9em;
  position: relative;
}
.tag::before, .tag::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  border: 1.5px solid var(--brand-deep);
  opacity: .55;
}
.tag::before { top: 0; inset-inline-start: 0; border-inline-end: none; border-bottom: none; }
.tag::after { bottom: 0; inset-inline-end: 0; border-inline-start: none; border-top: none; }
[dir="rtl"] .tag { font-family: var(--f-mono); direction: ltr; }

.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.01em;
  margin-block: .6em .5em;
}
.section-head p { color: var(--ink-soft); font-size: 1.05rem; max-width: 52ch; white-space: pre-line; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .95em 1.7em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--steel-deep); color: #fff; }
.btn--primary:hover { background: var(--brand-deep); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand-deep); color: var(--brand-deep); transform: translateY(-2px); }
.btn svg { width: 16px; height: 16px; transition: transform var(--t-fast) var(--ease); }
[dir="rtl"] .btn svg { transform: scaleX(-1); }
.btn:hover svg { transform: translateX(3px); }
[dir="rtl"] .btn:hover svg { transform: scaleX(-1) translateX(3px); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: 1rem;
  transition: background var(--t-med) var(--ease), padding var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.site-header::before {
  content: "";
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.site-header.is-scrolled { padding-block: .65rem; box-shadow: 0 1px 0 var(--line-soft); }
.site-header.is-scrolled::before { opacity: 1; }

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; position: relative; z-index: 1; }

.brand { display: flex; align-items: center; gap: .7rem; font-weight: 700; font-size: 1.15rem; }
.brand-mark { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
.brand-name { font-family: var(--f-head); }
[dir="rtl"] .brand-name { font-family: var(--f-fa); }

.main-nav { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.25rem); }
.main-nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-block: .3rem;
  transition: color var(--t-fast) var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute; inset-inline-start: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--brand-deep);
  transition: width var(--t-fast) var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: .9rem; }

.lang-toggle {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: .25rem;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  background: var(--panel);
}
.lang-toggle button {
  border: none; background: transparent;
  padding: .4em .85em; border-radius: 999px;
  color: var(--ink-faint);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lang-toggle button.is-active { background: var(--steel-deep); color: #fff; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--panel);
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block;
  width: 17px; height: 1.5px; background: var(--ink);
  position: relative; transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle.is-open span { background: transparent; }
.nav-toggle.is-open span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span::after { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: clamp(7rem, 16vw, 10rem) clamp(4rem, 8vw, 6rem);
  position: relative;
  overflow: clip;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.hero-copy .tag { margin-inline-start: -.9em; margin-bottom: 1.1rem; }
.hero-copy h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.75rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 1.15rem;
  white-space: pre-line;
}
.hero-copy p { color: var(--ink-soft); font-size: clamp(1.02rem, 1.4vw, 1.15rem); max-width: 46ch; margin-bottom: 2.1rem; white-space: pre-line; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }

.hero-stats { display: flex; gap: clamp(1.5rem, 4vw, 3rem); flex-wrap: wrap; }
.hero-stats div { border-inline-start: 1.5px solid var(--line); padding-inline-start: 1rem; }
.hero-stats strong { display: block; font-family: var(--f-mono); font-size: 1.35rem; color: var(--steel-deep); }
.hero-stats span { font-size: .8rem; color: var(--ink-faint); }

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-l);
  background: linear-gradient(155deg, var(--brand-tint), var(--bg-alt) 60%, var(--panel));
  border: 1.5px solid var(--line-soft);
  display: flex; align-items: center; justify-content: center;
  isolation: isolate;
}
.hero-visual::before {
  content: "";
  position: absolute; inset: 22px;
  border: 1px dashed color-mix(in srgb, var(--brand-deep) 35%, transparent);
  border-radius: calc(var(--radius-l) - 10px);
}
.hero-visual svg { width: 78%; height: 78%; }
.hero-corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--steel-deep); opacity: .8; }
.hero-corner.tl { top: 14px; inset-inline-start: 14px; border-inline-end: none; border-bottom: none; }
.hero-corner.br { bottom: 14px; inset-inline-end: 14px; border-inline-start: none; border-top: none; }

/* Logo intro: outline draws itself in (stroke-dashoffset, set via JS using
   real path lengths), then the gradient-filled mark fades in and stays,
   with a soft ambient glow and a slow decorative ring behind it. */
.logo-anim { width: 100%; height: 100%; overflow: visible; }
.logo-outline use {
  fill: none;
  stroke: var(--steel-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo-outline { transition: opacity .7s var(--ease) .15s; }
.logo-outline.is-done { opacity: 0; }
.logo-fill { opacity: 0; transition: opacity 1.1s var(--ease); }
.logo-fill.is-in { opacity: 1; }

.logo-glow {
  transform-origin: 46.5px 49px;
  animation: glow-pulse 4.5s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.09); opacity: .8; }
}

/* Decorative rings behind the logo: outline-only (no fill), so they read as
   a faint orbit rather than a solid disc, and they rotate slowly to keep
   the mark feeling alive instead of static. */
.logo-ring {
  fill: none;
  stroke: var(--brand-deep);
  stroke-opacity: .18;
  stroke-width: 1;
  transform-origin: 46.5px 49px;
  animation: ring-spin 90s linear infinite;
}
.logo-ring--inner {
  stroke-opacity: .28;
  stroke-dasharray: 2 7;
  animation-duration: 60s;
  animation-direction: reverse;
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* The mark is drawn in perspective, not a flat front-on view, so spinning
   it looks wrong — instead it drifts gently in a smooth, roughly circular
   path, like it's floating loose inside the outer ring, combined with a
   very small mechanical rotational jitter (a couple of degrees) so it
   reads like a machined part settling rather than a balloon drifting. */
.logo-fill.is-in {
  transform-origin: 46.5px 49px;
  animation: logo-float 14s ease-in-out infinite;
}
@keyframes logo-float {
  0%   { transform: translate(0, 0) rotate(0deg); }
  20%  { transform: translate(3px, -4px) rotate(-1.4deg); }
  45%  { transform: translate(0, -6px) rotate(1.1deg); }
  70%  { transform: translate(-3px, -2px) rotate(-0.8deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-ring, .logo-fill.is-in, .logo-glow { animation: none; }
}

/* Logo settles into place after the draw-in animation and stays put. */

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.service-card {
  background: var(--panel);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-m);
  padding: 2rem 1.85rem;
  transition: transform var(--t-med) var(--ease-spring), border-color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
  position: relative;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--brand);
  box-shadow: 0 18px 40px -22px rgba(28,36,32,.28);
}
.service-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.3rem;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.service-icon svg, .service-icon img { width: 24px; height: 24px; object-fit: contain; }
.service-card:hover .service-icon { background: var(--steel-deep); color: var(--brand-tint); }
.service-icon img { filter: none; transition: filter var(--t-fast) var(--ease); }
.service-card h3 { font-family: var(--f-head); font-size: 1.15rem; font-weight: 600; margin-bottom: .6rem; }
[dir="rtl"] .service-card h3 { font-family: var(--f-fa); }
.service-card p { color: var(--ink-soft); font-size: .93rem; }


/* ==========================================================================
   Portfolio — horizontal drag/scroll carousel
   ========================================================================== */
.portfolio-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; margin-bottom: 2.5rem; flex-wrap: wrap;
}
.portfolio-controls { display: flex; align-items: center; gap: .9rem; }
.portfolio-hint { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .06em; color: var(--ink-faint); text-transform: uppercase; }
.carousel-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.carousel-btn:hover { background: var(--steel-deep); border-color: var(--steel-deep); color: #fff; transform: scale(1.05); }
.carousel-btn svg { width: 17px; height: 17px; }
[dir="rtl"] .carousel-btn.prev svg,
[dir="rtl"] .carousel-btn.next svg { transform: scaleX(-1); }

/* Lives inside .wrap now (not a full-bleed sibling) — no negative-margin
   trick needed, so it can't drift out of alignment with the rest of the page. */
.carousel-viewport { overflow: hidden; }
.carousel-track {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
  cursor: grab;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.project-card {
  flex: 0 0 clamp(260px, 34vw, 400px);
  scroll-snap-align: start;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--panel);
  border: 1.5px solid var(--line-soft);
  transition: transform var(--t-med) var(--ease-spring), box-shadow var(--t-med) var(--ease);
  user-select: none;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px -24px rgba(28,36,32,.32); }
.project-media { aspect-ratio: 4/3; overflow: hidden; position: relative; background: var(--brand-tint); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); -webkit-user-drag: none; user-select: none; }
.project-card:hover .project-media img { transform: scale(1.06); }
.project-media .tag { position: absolute; top: 12px; inset-inline-start: 12px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(6px); border-radius: 6px; }
.project-body { padding: 1.35rem 1.5rem 1.6rem; }
.project-body h3 { font-family: var(--f-head); font-size: 1.05rem; font-weight: 600; margin-bottom: .4rem; }
[dir="rtl"] .project-body h3 { font-family: var(--f-fa); }
.project-body p { color: var(--ink-soft); font-size: .88rem; margin-bottom: .9rem; }
.project-link { display: inline-flex; align-items: center; gap: .4em; font-size: .82rem; font-weight: 600; color: var(--brand-deep); }
.project-link svg { width: 14px; height: 14px; transition: transform var(--t-fast) var(--ease); }
[dir="rtl"] .project-link svg { transform: scaleX(-1); }
.project-card:hover .project-link svg { transform: translateX(3px); }
[dir="rtl"] .project-card:hover .project-link svg { transform: scaleX(-1) translateX(3px); }

/* ==========================================================================
   About
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1fr .85fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.about-body { position: relative; }
.about-body p { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 2rem; white-space: pre-line; }

.founder-card {
  display: flex; align-items: center; gap: 1.1rem;
  background: var(--panel);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-m);
  padding: 1.3rem 1.5rem;
  margin-bottom: 2.25rem;
}
.founder-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--steel-deep); color: var(--brand-tint);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-weight: 600; font-size: 1rem;
  flex-shrink: 0; overflow: hidden;
}
.founder-avatar img { width: 100%; height: 100%; object-fit: cover; }
.founder-meta .label { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-deep); display: block; margin-bottom: .3rem; }
.founder-meta strong { display: block; font-size: 1.05rem; margin-bottom: .2rem; }
.founder-meta span { font-size: .85rem; color: var(--ink-soft); }

.values-list { display: flex; flex-direction: column; gap: 1.5rem; }
.value-item { border-inline-start: 2px solid var(--brand); padding-inline-start: 1.15rem; }
.value-item h4 { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.value-item p { font-size: .88rem; color: var(--ink-soft); }

.about-panel {
  background: var(--steel-deep);
  color: var(--bg);
  border-radius: var(--radius-m);
  padding: 2rem;
  position: sticky;
  top: 100px;
  overflow: hidden;
}
/* Subtle brand "F" mark watermark, centered behind the stats — decorative only, never mirrored.
   Uses physical left/top (not logical inset-inline-start): true centering doesn't
   depend on reading direction, so the physical properties are the correct choice here. */
.about-panel::before {
  content: "";
  position: absolute; z-index: 0;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 200px; height: 236px;
  background: url('../media/f-watermark-light.svg') no-repeat center / contain;
  pointer-events: none;
}
.about-panel > * { position: relative; z-index: 1; }
.about-panel .tag { color: var(--brand-tint); }
.about-panel .tag::before, .about-panel .tag::after { border-color: var(--brand-tint); }
.about-stat { display: flex; justify-content: space-between; align-items: baseline; padding-block: 1rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.about-stat:last-child { border-bottom: none; }
.about-stat span { font-size: .85rem; color: color-mix(in srgb, var(--bg) 65%, transparent); }
.about-stat strong { font-family: var(--f-mono); font-size: 1.2rem; color: var(--brand-tint); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2.5rem, 6vw, 5rem); }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  padding: .85em 1em;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--brand-deep); box-shadow: 0 0 0 4px var(--brand-tint); outline: none; }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: .8rem; color: var(--ink-faint); white-space: pre-line; }
.form-result { font-size: .88rem; margin-top: .3rem; padding: .8em 1em; border-radius: var(--radius-s); display: none; }
.form-result.is-success { display: block; background: var(--brand-tint); color: var(--brand-deep); }
.form-result.is-error { display: block; background: #fbeae2; color: var(--ember); }

.contact-direct { background: var(--panel); border: 1.5px solid var(--line-soft); border-radius: var(--radius-m); padding: 1.75rem; height: fit-content; }
.contact-direct h3 { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-deep); margin-bottom: 1.4rem; }
.channel { display: flex; align-items: center; gap: .9rem; padding-block: .85rem; border-bottom: 1px solid var(--line-soft); }
.channel:last-child { border-bottom: none; }
.channel-icon { width: 28px; height: 28px; color: var(--brand-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; object-fit: contain; }
.channel-icon svg { width: 100%; height: 100%; }
.channel span { display: block; font-size: .75rem; color: var(--ink-faint); }
.channel strong { display: block; font-size: .92rem; font-family: var(--f-mono); direction: ltr; text-align: start; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--steel-deep); color: var(--bg); padding-block: 3rem; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.site-footer .brand-name { color: #fff; }
.site-footer p { color: color-mix(in srgb, var(--bg) 60%, transparent); font-size: .85rem; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a { font-size: .85rem; color: color-mix(in srgb, var(--bg) 75%, transparent); transition: color var(--t-fast) var(--ease); }
.footer-nav a:hover { color: var(--brand-tint); }

/* ==========================================================================
   Reveal-on-scroll (vanilla equivalent of a Framer-Motion whileInView fade/rise)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(22px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: .03s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .09s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .15s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .21s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .27s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: .33s; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-panel { position: static; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; margin-inline: auto; order: -1; }
}

@media (max-width: 720px) {
  .main-nav, .header-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .services-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .portfolio-controls .carousel-btn { display: none; }

  .mobile-nav {
    position: fixed; inset: 0; top: 0; z-index: 90;
    background: var(--bg);
    display: flex; flex-direction: column;
    padding: 6.5rem 2rem 2rem;
    transform: translateY(-100%);
    transition: transform var(--t-med) var(--ease);
  }
  .mobile-nav.is-open { transform: translateY(0); }
  .mobile-nav a { font-family: var(--f-head); font-size: 1.6rem; font-weight: 600; padding-block: .6rem; border-bottom: 1px solid var(--line-soft); }
  [dir="rtl"] .mobile-nav a { font-family: var(--f-fa); }
  .mobile-nav .lang-toggle { align-self: flex-start; margin-top: 1.5rem; }
}

@media (min-width: 721px) {
  .mobile-nav { display: none; }
}

@media (max-width: 560px) {
  .founder-card { flex-direction: column; align-items: flex-start; text-align: start; }
  .channel strong { font-size: .85rem; }
}

/* ==========================================================================
   Product detail page (pages/product.html)
   ========================================================================== */
.product-hero { padding-block: clamp(7rem,14vw,9rem) 2rem; }
.product-back { display:inline-flex; align-items:center; gap:.5em; font-family:var(--f-mono); font-size:.8rem; letter-spacing:.05em; color:var(--ink-soft); margin-bottom:1.75rem; }
.product-back svg{ width:15px;height:15px; transition:transform var(--t-fast) var(--ease); }
[dir="rtl"] .product-back svg{ transform:scaleX(-1); }
.product-back:hover{ color:var(--brand-deep); }
.product-back:hover svg{ transform:translateX(-3px); }
[dir="rtl"] .product-back:hover svg{ transform:scaleX(-1) translateX(-3px); }
.product-title-row{ display:flex; align-items:flex-start; justify-content:space-between; gap:1.5rem; flex-wrap:wrap; margin-bottom:1.75rem; }
.product-title-row h1{ font-size:clamp(2rem,4.5vw,3rem); font-weight:700; letter-spacing:-.01em; max-width:26ch; }

/* ---------- Slideshow: fixed-height responsive frame, images flip inside it ---------- */
.product-slider{
  position:relative; border-radius:var(--radius-l); overflow:hidden;
  aspect-ratio:16/9; width:100%; background:var(--brand-tint);
  border:1.5px solid var(--line-soft);
  margin-bottom:clamp(3rem,6vw,5rem);
}
.slider-track{ display:flex; width:100%; height:100%; transition:transform .55s var(--ease); }
.slider-track img{ width:100%; height:100%; object-fit:contain; background:var(--brand-tint); flex-shrink:0; }
.slider-arrow{
  position:absolute; top:50%; transform:translateY(-50%);
  width:44px; height:44px; border-radius:50%;
  background:color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter:blur(6px);
  border:1.5px solid var(--line-soft);
  display:flex; align-items:center; justify-content:center;
  transition:background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  z-index: 2;
}
.slider-arrow:hover{ background:var(--steel-deep); color:#fff; }
.slider-arrow svg{ width:18px; height:18px; }
.slider-arrow.prev{ inset-inline-start:16px; }
.slider-arrow.next{ inset-inline-end:16px; }
[dir="rtl"] .slider-arrow.prev svg{ transform:scaleX(-1); }
[dir="rtl"] .slider-arrow.next svg{ transform:scaleX(-1); }
.slider-dots{ position:absolute; bottom:16px; inset-inline:0; display:flex; justify-content:center; gap:8px; z-index: 2; }
.slider-dot{ width:8px; height:8px; padding:0; border-radius:50%; border:none; background:rgba(255,255,255,.55); transition:width var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.slider-dot.is-active{ width:22px; border-radius:5px; background:#fff; }
.slider-count{
  position:absolute; top:14px; inset-inline-end:14px;
  font-family:var(--f-mono); font-size:.72rem; letter-spacing:.05em;
  background:color-mix(in srgb, var(--steel-deep) 78%, transparent);
  color:#fff; padding:.3em .7em; border-radius:6px;
  z-index: 2;
}

.product-body-grid{ display:grid; grid-template-columns:1.3fr .9fr; gap:clamp(2.5rem,6vw,5rem); align-items:start; }
.product-overview p{ color:var(--ink-soft); font-size:1.05rem; margin-bottom:1rem; white-space:pre-line; }
.specs-panel{ background:var(--panel); border:1.5px solid var(--line-soft); border-radius:var(--radius-m); padding:1.75rem; }
.specs-panel h3{ font-family:var(--f-mono); font-size:.78rem; letter-spacing:.08em; text-transform:uppercase; color:var(--brand-deep); margin-bottom:1.2rem; }
.specs-panel ul{ display:flex; flex-direction:column; gap:.9rem; }
.specs-panel li{ display:flex; align-items:flex-start; gap:.7em; font-size:.92rem; color:var(--ink); }
.specs-panel li::before{ content:""; width:7px; height:7px; margin-top:.5em; border-radius:2px; background:var(--brand); flex-shrink:0; }
.product-cta{ display:flex; flex-wrap:wrap; gap:1rem; margin-top:clamp(2.5rem,5vw,4rem); }

.product-videos{ margin-top:2rem; display:flex; flex-direction:column; gap:1.5rem; }
.video-embed{
  position:relative; width:100%; aspect-ratio:16/9;
  border-radius:var(--radius-m); overflow:hidden;
  border:1.5px solid var(--line-soft); background:var(--steel-deep);
}
.video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

@media (max-width: 640px) {
  .product-slider{ aspect-ratio:4/3; border-radius:var(--radius-m); }
  .slider-arrow{ width:38px; height:38px; }
  .product-body-grid{ grid-template-columns:1fr; }
}
@media (max-width: 420px) {
  .product-slider{ aspect-ratio:1/1; }
}
