/* ==========================================================================
   Falcon Software — Premium Silver Theme
   Swiss-inspired layout, editorial typography, purposeful motion.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  /* Color palette */
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;

  --surface-elevated: var(--white);
  --surface-muted: var(--slate-50);
  --surface-subtle: var(--slate-100);
  --border-default: var(--slate-200);
  --border-strong: var(--slate-300);
  --text-primary: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-500);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-display: clamp(2.5rem, 5vw + 1rem, 4.25rem);
  --text-h1: clamp(2rem, 3vw + 1rem, 2.75rem);
  --text-h2: clamp(1.65rem, 2vw + 0.75rem, 2.125rem);
  --text-h3: clamp(1.15rem, 1vw + 0.85rem, 1.35rem);
  --text-body: clamp(0.9375rem, 0.15vw + 0.9rem, 1.0625rem);
  --text-sm: 0.9375rem;
  --text-xs: 0.8125rem;
  --leading-tight: 1.1;
  --leading-snug: 1.35;
  --leading-normal: 1.65;
  --prose-width: 42rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;

  /* Layout */
  --container-max: 72rem;
  --container-narrow: 47.5rem;
  --container-gutter: clamp(1rem, 3.5vw, 2.5rem);
  --section-y: clamp(3rem, 5vw + 1rem, 6rem);
  --header-height: clamp(4rem, 2vw + 3.5rem, 4.5rem);
  --bp-nav: 64rem;
  --bp-md: 48rem;
  --bp-sm: 30rem;

  /* Radii — restrained, enterprise */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadows — subtle depth */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.1);
  --shadow-card: var(--shadow-sm);
  --shadow-card-hover: var(--shadow-md);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  text-wrap: balance;
}

[dir="rtl"] {
  font-family: "Tajawal", "Inter", -apple-system, sans-serif;
}

[dir="rtl"] .form-field input,
[dir="rtl"] .form-field textarea {
  font-family: "Tajawal", "Inter", -apple-system, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--slate-700);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section-padding {
  padding-block: var(--section-y);
}

.section-padding--sm {
  padding: var(--space-16) 0 var(--space-8);
}

.bg-light {
  background: var(--surface-muted);
}

.bg-dark {
  background: var(--slate-900);
  color: var(--slate-300);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

/* ---------- Section headings ---------- */
.section-heading {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
}

.section-heading h2,
.section-heading h1 {
  font-size: var(--text-h2);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  text-transform: uppercase;
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.bg-dark .section-heading h2 {
  color: var(--white);
}

.section-heading .underline {
  width: 48px;
  height: 3px;
  background: var(--slate-700);
  margin: 0 auto var(--space-5);
  border-radius: 1px;
}

.section-heading p {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* ---------- Page headers (inner pages) ---------- */
.page-header {
  padding:
    calc(var(--header-height) + clamp(var(--space-10), 5vw, var(--space-16))) 0
    clamp(var(--space-6), 3vw, var(--space-8));
  border-bottom: 1px solid var(--border-default);
  background: var(--white);
}

.page-header .container {
  text-align: center;
}

.page-header h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.page-header .underline {
  width: 48px;
  height: 3px;
  background: var(--slate-700);
  margin: 0 auto var(--space-5);
  border-radius: 1px;
}

.page-header p {
  max-width: var(--prose-width);
  margin: 0 auto;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.page-header--about .container {
  max-width: var(--container-narrow);
}

.page-header--about p {
  font-size: var(--text-body);
  line-height: 1.8;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8125rem 1.625rem;
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn-dark {
  background: var(--slate-900);
  color: var(--white);
  border-color: var(--slate-900);
}

.btn-dark:hover {
  background: var(--slate-800);
  border-color: var(--slate-800);
  box-shadow: var(--shadow-sm);
}

.btn-light {
  background: var(--white);
  color: var(--slate-800);
  border-color: var(--border-default);
}

.btn-light:hover {
  border-color: var(--border-strong);
  background: var(--slate-50);
  box-shadow: var(--shadow-xs);
}

.btn-block {
  width: 100%;
}

.link-arrow,
.case-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
  color: var(--slate-800);
  transition: gap var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}

.link-arrow:hover,
.case-link:hover {
  color: var(--slate-900);
  gap: var(--space-3);
}

.dir-arrow {
  transition: transform var(--duration-base) var(--ease-out);
}

.link-arrow:hover .dir-arrow,
.case-link:hover .dir-arrow {
  transform: translateX(3px);
}

[dir="rtl"] .link-arrow:hover .dir-arrow,
[dir="rtl"] .case-link:hover .dir-arrow {
  transform: translateX(-3px);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--duration-base) var(--ease-out);
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  pointer-events: none;
  z-index: 0;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.site-header.is-scrolled::before {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}

.site-header.is-scrolled {
  border-bottom-color: transparent;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.brand:hover {
  opacity: 0.85;
}

.brand-logo {
  height: clamp(2.25rem, 4vw, 2.75rem);
  width: auto;
  max-width: min(12rem, 42vw);
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-width: 0;
}

@media (min-width: 64.0625rem) and (max-width: 80rem) {
  .main-nav {
    gap: var(--space-4);
  }

  .main-nav > a:not(.nav-cta) {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
  }

  .main-nav .nav-cta {
    padding: 0.5rem 0.875rem;
  }
}

.main-nav > a:not(.nav-cta) {
  position: relative;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-2) 0;
  transition: color var(--duration-base) var(--ease-out);
}

.main-nav > a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--slate-900);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
}

[dir="rtl"] .main-nav > a:not(.nav-cta)::after {
  transform-origin: right;
}

.main-nav > a:not(.nav-cta):hover,
.main-nav > a:not(.nav-cta).active {
  color: var(--text-primary);
}

.main-nav > a:not(.nav-cta).active::after,
.main-nav > a:not(.nav-cta):hover::after {
  transform: scaleX(1);
}

.main-nav .nav-cta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5625rem 1.125rem;
  background: var(--slate-900);
  color: var(--white);
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.main-nav .nav-cta:hover {
  background: var(--slate-800);
}

.main-nav .nav-cta::after {
  display: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  color: var(--slate-800);
  cursor: pointer;
  transition: border-color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}

.nav-toggle:hover {
  background: var(--slate-50);
  border-color: var(--border-strong);
}

.nav-toggle[aria-expanded="true"] {
  background: var(--slate-100);
}

@media (max-width: 64rem) {
  .site-header:has(.main-nav.open) {
    z-index: 200;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-4) var(--container-gutter) var(--space-8);
    background: var(--white);
    border-bottom: 1px solid var(--border-default);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity var(--duration-base) var(--ease-out),
      visibility var(--duration-base) var(--ease-out),
      transform var(--duration-base) var(--ease-out);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .main-nav > a:not(.nav-cta) {
    padding: var(--space-4) 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--slate-100);
    min-height: 2.75rem;
  }

  .main-nav > a:not(.nav-cta)::after {
    display: none;
  }

  .main-nav .nav-cta {
    margin-top: var(--space-4);
    text-align: center;
    padding: var(--space-4);
  }

  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 101;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding:
    calc(var(--header-height) + clamp(var(--space-12), 6vw, var(--space-20))) 0
    clamp(var(--space-16), 5vw, var(--space-24));
  background: var(--slate-50);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 75%);
  pointer-events: none;
}

.hero-nexus {
  position: absolute;
  inset: 0;
  z-index: 0;
  color: var(--slate-400);
  pointer-events: none;
  mask-image: radial-gradient(ellipse 88% 78% at 50% 48%, black 18%, transparent 74%);
}

.hero-nexus__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-nexus__line {
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.45;
  stroke-dasharray: 5 16;
  animation: hero-nexus-flow var(--nexus-duration, 14s) linear infinite;
  animation-delay: var(--nexus-delay, 0s);
}

.hero-nexus__line--mesh {
  opacity: 0.28;
  stroke-dasharray: 3 18;
}

.hero-nexus__node {
  fill: currentColor;
  opacity: 0.55;
  animation: hero-nexus-pulse 3.6s ease-in-out infinite;
  animation-delay: var(--nexus-delay, 0s);
}

.hero-nexus__node--hub {
  opacity: 0.85;
  animation: hero-nexus-pulse 2.8s ease-in-out infinite;
}

.hero-nexus__ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.35;
  animation: hero-nexus-ring 4.8s ease-in-out infinite;
}

.hero-nexus__ring--outer {
  opacity: 0.2;
  animation-delay: -2.4s;
  animation-duration: 6.4s;
}

@keyframes hero-nexus-flow {
  to {
    stroke-dashoffset: -42;
  }
}

@keyframes hero-nexus-pulse {
  0%,
  100% {
    opacity: 0.28;
  }

  50% {
    opacity: 0.75;
  }
}

@keyframes hero-nexus-ring {
  0%,
  100% {
    opacity: 0.16;
  }

  50% {
    opacity: 0.42;
  }
}

.hero .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-content {
  max-width: min(42rem, 100%);
  margin-inline: auto;
}

.hero h1 {
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-6);
  overflow-wrap: anywhere;
}

.hero h1 .accent {
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  background: linear-gradient(to top, var(--slate-300) 18%, transparent 18%);
}

.hero p {
  color: var(--text-muted);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  max-width: min(36rem, 100%);
  margin: 0 auto var(--space-8);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 48rem) {
  .hero {
    padding-bottom: var(--space-16);
  }
}

@media (max-width: 30rem) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    white-space: normal;
  }
}

/* ---------- About cards ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-6);
}

:where(.about-grid, .service-grid, .project-grid, .team-grid, .contact-grid, .footer-grid, .form-row) > * {
  min-width: 0;
}

.about-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-6), 3vw + 0.5rem, var(--space-10));
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.about-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.about-card .about-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--slate-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.about-card h3 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  line-height: var(--leading-snug);
}

.about-card p {
  color: var(--text-muted);
  line-height: var(--leading-normal);
  margin: 0;
  font-size: var(--text-sm);
}

.about-cta {
  text-align: center;
  margin-top: var(--space-10);
}

/* ---------- Service cards ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: var(--space-6);
}

.service-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-6), 3vw + 0.5rem, var(--space-10)) clamp(var(--space-5), 2vw + 0.5rem, var(--space-8));
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.service-card:hover {
  border-color: var(--slate-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}

.service-card:hover .service-icon {
  background: var(--slate-900);
  color: var(--white);
}

.service-card h3 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  line-height: var(--leading-snug);
}

.service-card p {
  color: var(--text-muted);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-6);
  font-size: var(--text-sm);
  flex: 1;
}

.service-card .link-arrow {
  margin-top: auto;
}

/* ---------- Discipline sections ---------- */
.discipline-section {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.discipline-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) clamp(var(--space-4), 3vw, var(--space-8));
  justify-content: center;
  margin: 0 0 var(--space-12);
  padding: clamp(var(--space-4), 2.5vw, var(--space-6)) clamp(var(--space-4), 3vw, var(--space-8));
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.bg-light .discipline-badges {
  background: var(--white);
}

.discipline-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 0;
}

.discipline-badge .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--slate-400);
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.subsection-title {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-8);
}

/* ---------- Project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: var(--space-6);
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.project-card:hover {
  border-color: var(--slate-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.project-card .project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--slate-900);
}

.project-card .project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.project-card:hover .project-media img {
  transform: scale(1.04);
}

.project-card .project-body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-default);
}

.project-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.project-card h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  line-height: var(--leading-snug);
}

.project-card p {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-5);
  flex: 1;
}

/* ---------- CTA section ---------- */
.cta-section {
  position: relative;
  text-align: center;
  padding-block: var(--section-y);
  overflow: hidden;
}

.cta-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.cta-section .container {
  position: relative;
}

.cta-section h2 {
  font-size: var(--text-h2);
  font-weight: 800;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 auto var(--space-8);
  max-width: min(28rem, 100%);
  line-height: var(--leading-tight);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: flex-start;
}

@media (min-width: 56.25rem) {
  .contact-grid {
    grid-template-columns: minmax(16rem, 0.85fr) minmax(0, 1.15fr);
  }
}

.contact-info-card {
  background: var(--slate-50);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-6), 3vw + 0.5rem, var(--space-10));
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}

.contact-info-card h3 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-8);
}

.contact-info-row {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.contact-info-row:last-child {
  margin-bottom: 0;
}

.contact-info-row .icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--slate-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-row .label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-1);
}

.contact-info-row .value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  margin: 0;
  overflow-wrap: anywhere;
}

.contact-form-card {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-6), 3vw + 0.5rem, var(--space-10));
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.form-field {
  margin-bottom: var(--space-5);
}

.form-row .form-field {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--slate-50);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--slate-800);
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    background var(--duration-base) var(--ease-out);
}

.form-field input:hover,
.form-field textarea:hover {
  border-color: var(--border-strong);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--slate-500);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12);
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #b91c1c;
}

.form-error {
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-2);
}

.form-flash {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.form-flash.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-flash.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@media (max-width: 56.25rem) {
  .contact-info-card {
    position: static;
  }
}

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-6);
}

.team-card {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-6), 3vw + 0.5rem, var(--space-10));
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.team-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.team-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--slate-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-5);
}

.team-card h3 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
}

.team-role {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
}

.team-bio {
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-6);
}

.team-contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-default);
  padding-top: var(--space-5);
}

.team-contact a {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--duration-base) var(--ease-out);
  overflow-wrap: anywhere;
}

.team-contact a:hover {
  color: var(--text-primary);
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-24);
}

.error-page .container {
  text-align: center;
}

.error-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--slate-200);
  line-height: 1;
  letter-spacing: -0.04em;
}

.error-page h1 {
  font-size: var(--text-h2);
  font-weight: 800;
  color: var(--text-primary);
  margin: var(--space-4) 0;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: clamp(var(--space-12), 6vw, var(--space-20)) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(var(--space-8), 4vw, var(--space-12));
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.footer-brand span {
  font-weight: 800;
  font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
  letter-spacing: 0.06em;
  color: var(--white);
}

.footer-brand img {
  height: 28px;
  flex-shrink: 0;
}

.site-footer > .container > .footer-grid > div:first-child p {
  line-height: var(--leading-normal);
  font-size: var(--text-sm);
  max-width: 22rem;
  margin: 0;
}

.site-footer h4 {
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 var(--space-5);
}

.site-footer .footer-links li {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  overflow-wrap: anywhere;
}

.site-footer .footer-links a {
  transition: color var(--duration-base) var(--ease-out);
}

.site-footer .footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) 0 var(--space-6);
  font-size: 0.8125rem;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom .legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
}

.footer-bottom a {
  transition: color var(--duration-base) var(--ease-out);
}

.footer-bottom a:hover {
  color: var(--white);
}

@media (max-width: 30rem) {
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

.footer-registration {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-6) 0 var(--space-5);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.75rem;
  line-height: var(--leading-normal);
}

.footer-registration__ids {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  color: var(--slate-500);
}

.footer-registration__sep {
  color: var(--slate-600);
}

.footer-registration__link {
  font-weight: 600;
  color: var(--slate-400);
  transition: color var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.footer-registration__link:hover {
  color: var(--white);
}

@media (max-width: 30rem) {
  .footer-registration {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Language toggle ---------- */
.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lang-toggle {
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: var(--slate-100);
  border-radius: 999px;
  padding: 3px;
  height: 36px;
  box-sizing: border-box;
}

.main-nav .lang-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
  border-bottom: none;
  padding-bottom: 0;
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}

.main-nav .lang-toggle a::after {
  display: none;
}

.main-nav .lang-toggle a:hover,
.main-nav .lang-toggle a.active {
  border-bottom: none;
  border-color: transparent;
}

.lang-toggle a.active {
  background: var(--slate-900);
  color: var(--white);
}

.lang-toggle a:hover:not(.active) {
  color: var(--text-primary);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--white);
  color: var(--slate-700);
  cursor: pointer;
  transition:
    border-color var(--duration-base) var(--ease-out),
    background var(--duration-base) var(--ease-out);
  flex-shrink: 0;
  box-sizing: border-box;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--slate-50);
}

.theme-toggle svg {
  display: none;
}

html[data-theme-pref="light"] .theme-toggle .icon-sun,
html:not([data-theme-pref]) .theme-toggle .icon-sun {
  display: block;
}

html[data-theme-pref="dark"] .theme-toggle .icon-moon {
  display: block;
}

html[data-theme-pref="system"] .theme-toggle .icon-system {
  display: block;
}

@media (max-width: 64rem) {
  .main-nav .nav-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-default);
  }
}

/* ---------- RTL adjustments ---------- */
[dir="rtl"] h1,
[dir="rtl"] .section-heading h2,
[dir="rtl"] .subsection-title,
[dir="rtl"] .main-nav > a:not(.nav-cta),
[dir="rtl"] .project-tag,
[dir="rtl"] .site-footer h4,
[dir="rtl"] .hero h1,
[dir="rtl"] .page-header h1,
[dir="rtl"] .team-role {
  text-transform: none !important;
  letter-spacing: normal !important;
}

[dir="rtl"] .dir-arrow {
  display: inline-block;
  transform: scaleX(-1);
}

[dir="rtl"] .hero h1 .accent {
  background: linear-gradient(to top, var(--slate-300) 18%, transparent 18%);
}

/* ---------- Responsive section spacing ---------- */
@media (max-width: 48rem) {
  .section-padding--sm {
    padding-block: var(--space-12) var(--space-6);
  }

  .form-field input,
  .form-field textarea {
    font-size: max(1rem, var(--text-sm));
  }

  .btn {
    white-space: normal;
  }
}

/* ==========================================================================
   Dark mode
   ========================================================================== */

html[data-theme="dark"] {
  --surface-elevated: #141d2e;
  --surface-muted: #0c1220;
  --surface-subtle: #141d2e;
  --border-default: #1e293b;
  --border-strong: #334155;
  --text-primary: var(--white);
  --text-secondary: var(--slate-300);
  --text-muted: var(--slate-400);
}

html[data-theme="dark"] body {
  background: var(--slate-900);
  color: var(--slate-300);
}

html[data-theme="dark"] .bg-light {
  background: var(--surface-muted);
}

html[data-theme="dark"] .page-header {
  background: var(--slate-900);
  border-bottom-color: var(--border-default);
}

html[data-theme="dark"] .site-header {
  background: transparent;
  border-bottom-color: transparent;
}

html[data-theme="dark"] .site-header::before {
  background: rgba(15, 23, 42, 0.88);
  border-bottom-color: transparent;
}

html[data-theme="dark"] .site-header.is-scrolled::before {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: var(--border-default);
}

html[data-theme="dark"] .site-header.is-scrolled {
  border-bottom-color: transparent;
}

html[data-theme="dark"] .brand-logo {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"] .main-nav > a:not(.nav-cta) {
  color: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .main-nav > a:not(.nav-cta):hover,
html[data-theme="dark"] .main-nav > a:not(.nav-cta).active {
  color: var(--white);
}

html[data-theme="dark"] .main-nav > a:not(.nav-cta)::after {
  background: var(--white);
}

html[data-theme="dark"] .main-nav .nav-cta {
  background: var(--white);
  color: var(--slate-900);
}

html[data-theme="dark"] .main-nav .nav-cta:hover {
  background: var(--slate-200);
}

html[data-theme="dark"] .nav-toggle {
  color: var(--slate-200);
  border-color: var(--border-default);
  background: var(--surface-elevated);
}

html[data-theme="dark"] .nav-toggle:hover {
  background: var(--slate-800);
}

@media (max-width: 64rem) {
  html[data-theme="dark"] .main-nav {
    background: var(--slate-900);
    border-bottom-color: var(--border-default);
  }

  html[data-theme="dark"] .main-nav > a:not(.nav-cta) {
    border-bottom-color: var(--border-default);
  }
}

html[data-theme="dark"] .lang-toggle {
  background: var(--slate-800);
}

html[data-theme="dark"] .main-nav .lang-toggle a {
  color: var(--slate-400);
}

html[data-theme="dark"] .lang-toggle a.active {
  background: var(--slate-300);
  color: var(--slate-900);
}

html[data-theme="dark"] .lang-toggle a:hover:not(.active) {
  color: var(--white);
}

html[data-theme="dark"] .theme-toggle {
  background: var(--slate-800);
  border-color: var(--border-default);
  color: var(--slate-200);
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--slate-700);
}

html[data-theme="dark"] .hero {
  background: var(--slate-900);
}

html[data-theme="dark"] .hero::before {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
}

html[data-theme="dark"] .hero-nexus {
  color: var(--slate-500);
}

html[data-theme="dark"] .hero-nexus__line {
  opacity: 0.38;
}

html[data-theme="dark"] .hero-nexus__line--mesh {
  opacity: 0.22;
}

html[data-theme="dark"] .about-card,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .contact-form-card {
  background: var(--surface-elevated);
  border-color: var(--border-default);
}

html[data-theme="dark"] .about-card:hover,
html[data-theme="dark"] .service-card:hover,
html[data-theme="dark"] .project-card:hover,
html[data-theme="dark"] .team-card:hover {
  border-color: var(--border-strong);
}

html[data-theme="dark"] .service-icon {
  background: var(--slate-800);
  color: var(--slate-200);
}

html[data-theme="dark"] .service-card:hover .service-icon {
  background: var(--white);
  color: var(--slate-900);
}

html[data-theme="dark"] .discipline-badges {
  background: var(--surface-elevated);
  border-color: var(--border-default);
}

html[data-theme="dark"] .discipline-badge .check {
  border-color: var(--slate-600);
  color: var(--slate-400);
}

html[data-theme="dark"] .project-card .project-body {
  border-top-color: var(--border-default);
}

html[data-theme="dark"] .link-arrow,
html[data-theme="dark"] .case-link {
  color: var(--slate-200);
}

html[data-theme="dark"] .contact-info-card {
  background: var(--surface-elevated);
  border-color: var(--border-default);
}

html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field textarea {
  background: var(--slate-900);
  border-color: var(--border-default);
  color: var(--slate-100);
}

html[data-theme="dark"] .form-field input:hover,
html[data-theme="dark"] .form-field textarea:hover {
  border-color: var(--border-strong);
}

html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field textarea:focus {
  background: var(--surface-elevated);
}

html[data-theme="dark"] .form-field input::placeholder,
html[data-theme="dark"] .form-field textarea::placeholder {
  color: var(--slate-500);
}

html[data-theme="dark"] .form-flash.success {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

html[data-theme="dark"] .form-flash.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

html[data-theme="dark"] .team-contact {
  border-top-color: var(--border-default);
}

html[data-theme="dark"] .btn-light {
  background: var(--slate-800);
  color: var(--white);
  border-color: var(--border-default);
}

html[data-theme="dark"] .btn-light:hover {
  border-color: var(--border-strong);
  background: var(--slate-700);
}

html[data-theme="dark"] .btn-dark {
  background: var(--white);
  color: var(--slate-900);
  border-color: var(--white);
}

html[data-theme="dark"] .btn-dark:hover {
  background: var(--slate-200);
  border-color: var(--slate-200);
}

html[data-theme="dark"] .error-code {
  color: var(--slate-800);
}

html[data-theme="dark"] .bg-dark .section-heading h2 {
  color: var(--white);
}

html[data-theme="dark"] .section-heading .underline,
html[data-theme="dark"] .page-header .underline {
  background: var(--slate-400);
}

/* =========================================================================
   FALCON SOFTLABS — MOTION LAYER
   Append this block to the END of app/static/assets/css/style.css
   Scope: Home (.hero, .about-grid, .service-grid) + Services (.discipline-section)
   Intensity: Noticeable
   ========================================================================= */

:root {
  --motion-ease: cubic-bezier(0.22, 0.68, 0.24, 1);
  --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-rise: 0.72s;
  --motion-slide: 0.8s;
}

/* ---------- Page enter ---------- */
body {
  animation: fs-page-in 0.5s var(--motion-ease-out) both;
}

@keyframes fs-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Reveal directions + stagger ----------
   Add .reveal--left / .reveal--right alongside .reveal.
   main.js assigns --i on grid children for stagger. */
.reveal--left {
  transform: translate3d(-36px, 0, 0);
}

.reveal--right {
  transform: translate3d(36px, 0, 0);
}

.reveal--scale {
  transform: translate3d(0, 22px, 0) scale(0.975);
}

.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--scale.is-visible {
  transform: none;
}

.reveal {
  transition-duration: var(--motion-slide);
  transition-timing-function: var(--motion-ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  will-change: auto;
}

.reveal[style*="--i"] {
  transition-delay: calc(var(--i) * 90ms);
}

/* ---------- Hero entrance ---------- */
.hero-content > h1,
.hero-content > p,
.hero-content > .hero-actions {
  opacity: 0;
  animation: fs-hero-rise var(--motion-rise) var(--motion-ease-out) both;
}

.hero-content > h1 { animation-delay: 0.12s; }
.hero-content > p { animation-delay: 0.30s; }
.hero-content > .hero-actions { animation-delay: 0.46s; }

/* h1 line-by-line: wraps injected by main.js */
.hero-content h1 .hero-line {
  display: block;
  opacity: 0;
  animation: fs-hero-rise 0.66s var(--motion-ease-out) both;
  animation-delay: calc(0.14s + var(--i, 0) * 0.11s);
}

.hero-content h1:has(.hero-line) {
  animation: none;
  opacity: 1;
}

@keyframes fs-hero-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Hero nexus: draw in, then nodes pop ---------- */
.hero-nexus__lines .hero-nexus__line {
  stroke-dasharray: 5 16;
}

.hero-nexus__line {
  opacity: 0;
  animation:
    fs-nexus-fade 0.9s var(--motion-ease-out) both,
    hero-nexus-flow var(--nexus-duration, 14s) linear infinite;
  animation-delay: 0.15s, var(--nexus-delay, 0s);
}

.hero-nexus__line--mesh {
  animation-delay: 0.5s, var(--nexus-delay, 0s);
}

@keyframes fs-nexus-fade {
  from { opacity: 0; }
  to { opacity: 0.45; }
}

.hero-nexus__line--mesh {
  --fs-mesh: 1;
}

.hero-nexus__node,
.hero-nexus__node--hub {
  transform-box: fill-box;
  transform-origin: center;
  animation:
    fs-node-pop 0.5s var(--motion-ease) both,
    hero-nexus-pulse 3.6s ease-in-out infinite;
  animation-delay: calc(0.7s + var(--i, 0) * 0.07s), var(--nexus-delay, 0s);
}

.hero-nexus__node--hub {
  animation-delay: 0.55s, 0s;
  animation-duration: 0.5s, 2.8s;
}

.hero-nexus__ring {
  transform-box: fill-box;
  transform-origin: center;
  animation:
    fs-ring-in 0.9s var(--motion-ease-out) both,
    hero-nexus-ring 4.8s ease-in-out infinite;
  animation-delay: 0.8s, 0.8s;
}

.hero-nexus__ring--outer {
  animation-delay: 1s, 1s;
  animation-duration: 0.9s, 6.4s;
}

@keyframes fs-node-pop {
  0% { opacity: 0; transform: scale(0.2); }
  70% { opacity: 0.75; transform: scale(1.28); }
  100% { opacity: 0.55; transform: scale(1); }
}

@keyframes fs-ring-in {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 0.35; transform: scale(1); }
}

/* ---------- Card motion (Home + Services) ---------- */
.about-card,
.service-card,
.project-card {
  transition:
    transform 0.42s var(--motion-ease),
    box-shadow 0.42s var(--motion-ease),
    border-color 0.42s var(--motion-ease);
}

.about-card:hover,
.service-card:hover {
  transform: translateY(-7px);
}

.project-card:hover {
  transform: translateY(-6px);
}

.service-card .service-icon,
.about-card .about-icon {
  transition: transform 0.42s var(--motion-ease), color 0.42s var(--motion-ease);
}

.service-card:hover .service-icon {
  transform: translateY(-3px) rotate(-6deg) scale(1.06);
}

.about-card:hover .about-icon {
  transform: rotate(6deg) scale(1.06);
}

.link-arrow .dir-arrow,
.case-link .dir-arrow,
.btn .dir-arrow {
  display: inline-block;
  transition: transform 0.3s var(--motion-ease);
}

.link-arrow:hover .dir-arrow,
.case-link:hover .dir-arrow,
.btn:hover .dir-arrow {
  transform: translateX(4px);
}

[dir="rtl"] .link-arrow:hover .dir-arrow,
[dir="rtl"] .case-link:hover .dir-arrow,
[dir="rtl"] .btn:hover .dir-arrow {
  transform: translateX(-4px);
}

/* ---------- Services: discipline badges ---------- */
.discipline-badge {
  transition: transform 0.32s var(--motion-ease), border-color 0.32s var(--motion-ease);
}

.discipline-badges.is-visible .discipline-badge {
  animation: fs-badge-in 0.5s var(--motion-ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.discipline-badge:hover {
  transform: translateY(-2px);
}

@keyframes fs-badge-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}

/* ---------- Mobile nav: staggered links ---------- */
@media (max-width: 64rem) {
  .main-nav > a,
  .main-nav .nav-controls {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    transition:
      opacity 0.4s var(--motion-ease-out),
      transform 0.4s var(--motion-ease-out);
  }

  .main-nav.open > a,
  .main-nav.open .nav-controls {
    opacity: 1;
    transform: none;
    transition-delay: calc(0.06s + var(--i, 0) * 0.055s);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body,
  .hero-content > h1,
  .hero-content > p,
  .hero-content > .hero-actions,
  .hero-content h1 .hero-line,
  .hero-nexus__line,
  .hero-nexus__node,
  .hero-nexus__ring,
  .discipline-badges.is-visible .discipline-badge {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .main-nav.open > a,
  .main-nav.open .nav-controls,
  .main-nav > a,
  .main-nav .nav-controls {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Stats band (Home) ---------- */
.stats-band {
  padding-block: clamp(2.5rem, 4vw, 4rem);
  background: var(--slate-50, #f8fafc);
  border-block: 1px solid var(--slate-200, #e2e8f0);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
}

@media (max-width: 48rem) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--slate-900, #0f172a);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500, #64748b);
}
