/* ============================================
   ARC ENGINEERING LAB - Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --color-bg: #07070D;
  --color-surface: #0F0F1A;
  --color-surface-2: #161625;
  --color-surface-3: #1C1C30;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(74, 144, 217, 0.3);

  --color-primary: #4A90D9;
  --color-primary-light: #6AADE6;
  --color-primary-dark: #2E6BB0;
  --color-primary-glow: rgba(74, 144, 217, 0.15);

  --color-accent: #E84C4C;
  --color-accent-light: #F06B6B;
  --color-accent-glow: rgba(232, 76, 76, 0.15);

  --color-text: #EAEAF0;
  --color-text-secondary: #9999B0;
  --color-text-muted: #666680;

  --color-success: #4ADE80;
  --color-warning: #FBBF24;

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 900px;
  --nav-height: 72px;

  /* Effects */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(74, 144, 217, 0.1);
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

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

.section {
  padding: var(--space-5xl) 0;
}

.section--sm {
  padding: var(--space-3xl) 0;
}

.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-glow);
  padding: var(--space-xs) var(--space-md);
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.3);
}

.btn--primary:hover {
  background: var(--color-primary-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(74, 144, 217, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(4px);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-glow);
}

.btn--accent {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(232, 76, 76, 0.3);
}

.btn--accent:hover {
  background: var(--color-accent-light);
  color: #fff;
  transform: translateY(-2px);
}

.btn--lg {
  padding: 1rem 2.2rem;
  font-size: 1.05rem;
}

.btn--sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
}

.btn-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 9999;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.nav.scrolled {
  background: rgba(7, 7, 13, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--color-border);
}

.nav.menu-open {
  background: var(--color-bg);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav__logo img {
  height: 42px;
  width: 42px;
  border-radius: var(--radius-sm);
}

.nav__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.nav__logo-text span {
  color: var(--color-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav__link {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

.nav__link.active {
  color: var(--color-primary);
}

.nav__cta {
  margin-left: var(--space-sm);
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all var(--transition-fast);
  border-radius: 2px;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 7, 13, 0.5) 0%,
    rgba(7, 7, 13, 0.3) 40%,
    rgba(7, 7, 13, 0.7) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: var(--space-xl);
}

.hero__logo {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(74, 144, 217, 0.2);
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #fff 0%, #a0c4f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: float 2s ease-in-out infinite;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--color-primary), transparent);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* --- Page Hero (inner pages) --- */
.page-hero {
  position: relative;
  padding: calc(var(--nav-height) + var(--space-4xl)) 0 var(--space-3xl);
  overflow: hidden;
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,7,13,0.7) 0%, var(--color-bg) 100%);
  z-index: 1;
}

.page-hero__content {
  position: relative;
  z-index: 2;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: grayscale(20%) contrast(1.05);
  transition: filter var(--transition-base);
}

.card:hover .card__image {
  filter: grayscale(0%) contrast(1);
}

.card__body {
  padding: var(--space-lg);
}

.card__tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0;
  margin-bottom: var(--space-sm);
  background: none;
}

.card__tag--software { color: #A78BFA; }
.card__tag--robotics { color: #6AADE6; }
.card__tag--mechanics { color: #F06B6B; }
.card__tag--electronics { color: #FBBF24; }
.card__tag--connectivity { color: #4ADE80; }

.card__title {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.card__text {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  transition: color var(--transition-fast);
}

.card__link:hover {
  color: var(--color-text);
}

.card__link svg {
  transition: transform var(--transition-fast);
}

.card__link:hover svg {
  transform: translateX(4px);
}

/* --- Grid Layouts --- */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- Lab Division Cards --- */
.lab-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  transition: border-color var(--transition-base);
  position: relative;
  overflow: hidden;
}

.lab-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.lab-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lab-card__icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-text-muted);
}

.lab-card--accent .lab-card__icon svg {
  stroke: var(--color-text-muted);
}

.lab-card--green .lab-card__icon svg {
  stroke: var(--color-text-muted);
}

.lab-card--yellow .lab-card__icon svg {
  stroke: var(--color-text-muted);
}

.lab-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.05rem;
  font-weight: 600;
}

.lab-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* --- Video Background --- */
.video-bg-section {
  position: relative;
  overflow: hidden;
}

.video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.video-bg video.loaded {
  opacity: 0.12;
}

.video-bg__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--color-bg) 0%, rgba(7,7,13,0.6) 30%, rgba(7,7,13,0.6) 70%, var(--color-bg) 100%);
  z-index: 1;
}

.video-bg-section > *:not(.video-bg) {
  position: relative;
  z-index: 2;
}

/* --- Mobile: Standalone Video Showcase --- */
.video-showcase {
  display: none;
}

@media (max-width: 767px) {
  .video-bg video.loaded {
    opacity: 0.08;
  }
  .video-bg__overlay {
    background: linear-gradient(180deg, var(--color-bg) 0%, rgba(7,7,13,0.75) 25%, rgba(7,7,13,0.75) 75%, var(--color-bg) 100%);
  }
  .video-showcase {
    display: block;
    padding: var(--space-lg) var(--space-md);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  .video-showcase__wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-bg);
  }
  .video-showcase__wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border-top-left-radius: 80%;
    z-index: 3;
    box-shadow: -1px -1px 4px rgba(0,0,0,0.2);
  }
  .video-showcase__wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
  }
  .video-showcase__wrapper video.loaded {
    opacity: 1;
  }
  .video-showcase__label {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    font-size: 0.7rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.5);
    padding: 0.2em 0.6em;
    border-radius: var(--radius-sm);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-bg video,
  .video-showcase__wrapper video {
    display: none;
  }
}

/* --- Stats Bar --- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.stat {
  text-align: center;
}

.stat__number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- CTA Section --- */
.cta-section {
  position: relative;
  padding: var(--space-5xl) 0;
  overflow: hidden;
}

.cta-section__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cta-section__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.cta-section__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(7,7,13,0.85) 0%, rgba(7,7,13,0.7) 100%);
  z-index: 1;
}

.cta-section__content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.cta-section h2 {
  margin-bottom: var(--space-md);
}

.cta-section p {
  max-width: 550px;
  margin: 0 auto var(--space-xl);
  font-size: 1.05rem;
}

/* --- Team Grid --- */
.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
  transition: all var(--transition-base);
}

.team-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}

.team-card__photo {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: var(--color-surface-2);
}

.team-card__info {
  padding: var(--space-lg);
}

.team-card__name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.team-card__role {
  font-size: 0.8rem;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

.team-card__project {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* --- Gallery --- */
.gallery-grid {
  columns: 3;
  column-gap: var(--space-md);
}

.gallery-grid__item {
  break-inside: avoid;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-base);
  position: relative;
}

.gallery-grid__item::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.gallery-grid__item:hover {
  transform: scale(1.02);
}

.gallery-grid__item img {
  width: 100%;
  display: block;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.lightbox.active {
  display: flex;
}

.lightbox__close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* --- Form (Join Page) --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- Footer --- */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer__brand img {
  height: 40px;
  margin-bottom: var(--space-md);
}

.footer__brand p {
  font-size: 0.9rem;
  max-width: 280px;
}

.footer__heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.footer__links li {
  margin-bottom: var(--space-sm);
}

.footer__links a {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.footer__links a:hover {
  color: var(--color-primary);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer__socials {
  display: flex;
  gap: var(--space-md);
}

.footer__socials a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer__socials a:hover {
  color: var(--color-primary);
}

/* --- Vision Page --- */
.vision-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.vision-block--reverse {
  direction: rtl;
}

.vision-block--reverse > * {
  direction: ltr;
}

.vision-block__image {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.vision-block__image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

/* --- Focus Areas --- */
.focus-card {
  padding: var(--space-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: border-color var(--transition-base);
}

.focus-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.focus-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-lg);
  color: var(--color-text-muted);
}

.focus-card h3 {
  margin-bottom: var(--space-sm);
}

.focus-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* --- Project Detail Page --- */
.project-hero {
  position: relative;
  padding: calc(var(--nav-height) + var(--space-3xl)) 0 var(--space-3xl);
  overflow: hidden;
}

.project-meta {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.project-meta__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.project-meta__item svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}

.project-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-3xl);
}

.project-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-xl));
}

.project-sidebar__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.project-sidebar__card h4 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

/* --- Programs Page --- */
.program-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.program-section:last-child {
  border-bottom: none;
}

.program-section--reverse {
  direction: rtl;
}

.program-section--reverse > * {
  direction: ltr;
}

.program-section__image {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.program-section__image img {
  width: 100%;
  height: 350px;
  object-fit: cover;
}

.program-section__content h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.program-section__content p {
  margin-bottom: var(--space-lg);
}

.program-section__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.program-section__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.program-section__list li svg {
  width: 18px;
  height: 18px;
  color: var(--color-success);
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .project-content { grid-template-columns: 1fr; }
  .vision-block { grid-template-columns: 1fr; }
  .vision-block--reverse { direction: ltr; }
  .program-section { grid-template-columns: 1fr; }
  .program-section--reverse { direction: ltr; }
  .gallery-grid { columns: 2; }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--color-bg);
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--space-2xl);
    gap: var(--space-xs);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__link {
    font-size: 1.1rem;
    padding: 0.75rem;
    width: 100%;
  }

  .nav__cta {
    margin-left: 0;
    margin-top: var(--space-md);
    width: 100%;
    text-align: center;
  }

  .nav__toggle {
    display: block;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .btn-group {
    flex-direction: column;
    align-items: center;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  .gallery-grid {
    columns: 1;
  }

  .hero__logo {
    width: 80px;
    height: 80px;
  }

  .section {
    padding: var(--space-3xl) 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }
}

/* ============================================
   MOBILE ENHANCEMENTS
   ============================================ */

/* --- Touch Feedback States --- */
@media (hover: none) and (pointer: coarse) {
  .btn:active {
    transform: scale(0.96);
    opacity: 0.9;
  }

  .card:active {
    opacity: 0.85;
  }

  .lab-card:active {
    opacity: 0.85;
  }

  .team-card:active {
    transform: scale(0.98);
  }

  .nav__link:active {
    background: rgba(255, 255, 255, 0.1);
  }

  .filter-btn:active {
    transform: scale(0.95);
  }

  .gallery-grid__item:active {
    transform: scale(0.98);
  }

  .focus-card:active {
    transform: scale(0.98);
  }

  .footer__links a:active {
    color: var(--color-primary);
  }

  /* Disable hover effects on touch devices */
  .card:hover {
    border-color: var(--color-border);
  }

  .card:hover .card__image {
    filter: grayscale(20%) contrast(1.05);
  }

  .gallery-grid__item:hover {
    transform: none;
  }
}

/* --- Minimum Touch Target Sizes --- */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .filter-btn {
    min-height: 44px;
    padding: 0.6rem 1.2rem;
  }

  .nav__link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .footer__links a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
  }

  .footer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .card__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* --- Scrollable Filter Bar --- */
@media (max-width: 768px) {
  .filter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--space-md);
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    gap: var(--space-sm);
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* --- Mobile Typography & Spacing --- */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.65;
  }

  h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
  h3 { font-size: clamp(1.15rem, 4vw, 1.4rem); }

  .section-header p {
    font-size: 0.95rem;
  }

  .section-label {
    font-size: 0.7rem;
  }

  /* Reduce section spacing */
  .section {
    padding: var(--space-2xl) 0;
  }

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

  .section-header {
    margin-bottom: var(--space-xl);
  }

  /* Page hero tighter */
  .page-hero {
    padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-xl);
  }

  .page-hero__content .section-header p {
    font-size: 0.9rem;
  }

  /* Card image responsive heights */
  .card__image {
    height: 180px;
  }

  .card__body {
    padding: var(--space-md);
  }

  .card__title {
    font-size: 1.05rem;
  }

  .card__text {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }

  /* Team card compact */
  .team-card__photo,
  .team-card__photo[style] {
    height: 180px !important;
  }

  .team-card__info {
    padding: var(--space-md);
  }

  /* Vision block images */
  .vision-block__image img {
    height: 250px;
  }

  /* Program section images */
  .program-section__image img {
    height: 220px;
  }

  /* Stats bar tighter */
  .stats {
    padding: var(--space-xl) 0;
  }

  .stat__number {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  .stat__label {
    font-size: 0.75rem;
  }

  /* CTA section tighter */
  .cta-section {
    padding: var(--space-3xl) 0;
  }

  .cta-section p {
    font-size: 0.95rem;
  }

  /* --- Hero Mobile Fix --- */
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero__content {
    padding: var(--space-lg) var(--space-md);
  }

  .hero__logo {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-lg);
  }

  .hero__title {
    font-size: clamp(2rem, 8vw, 2.8rem);
    margin-bottom: var(--space-sm);
  }

  .hero__subtitle {
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
    line-height: 1.6;
  }

  .hero__scroll {
    bottom: 1.5rem;
  }

  /* --- Nav Mobile Fix --- */
  .nav__logo-text {
    font-size: 0.95rem;
  }

  .nav__logo img {
    width: 34px;
    height: 34px;
  }

  /* Gallery polish */
  .gallery-grid {
    column-gap: var(--space-sm);
  }

  .gallery-grid__item {
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-sm);
  }
}

/* --- Lightbox Nav + Counter --- */
.lightbox__nav {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-md);
  z-index: 10;
}

.lightbox__nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.lightbox__nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__counter {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .lightbox {
    padding: var(--space-sm);
  }

  .lightbox img {
    max-width: 100vw;
    max-height: 80vh;
    border-radius: var(--radius-sm);
  }

  .lightbox__close {
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    font-size: 1.5rem;
  }
}

/* --- Accordion Footer on Mobile --- */
@media (max-width: 768px) {
  .footer__grid {
    gap: 0;
  }

  .footer__brand {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
  }

  .footer__heading {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
    min-height: 44px;
  }

  .footer__heading::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
  }

  .footer__heading.open::after {
    content: '−';
  }

  .footer__links {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
  }

  .footer__links.open {
    max-height: 200px;
    padding: var(--space-sm) 0;
  }
}

/* --- Mobile Form Enhancements --- */
@media (max-width: 768px) {
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 0.85rem 1rem;
    min-height: 48px;
    border-radius: var(--radius-md);
  }

  .form-group label {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .form-group textarea {
    min-height: 100px;
  }

  .grid--2 {
    gap: var(--space-xl) !important;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__scroll {
    animation: none;
  }
}

/* --- Landscape Mobile --- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + var(--space-xl)) 0 var(--space-xl);
  }

  .hero__logo {
    width: 50px;
    height: 50px;
  }

  .hero__scroll {
    display: none;
  }

  .page-hero {
    padding: calc(var(--nav-height) + var(--space-lg)) 0 var(--space-md);
  }
}
