/* BASE.CSS - Universal Styles for All Pages
   Introl Terminal Aesthetic Design System
   ============================================= */

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

hr {
  border: none;
}

:root {
  --bg-primary: #080808;
  --bg-secondary: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #0f0f0f;

  --text-primary: #00F200;
  --text-secondary: #00C000;
  --text-dim: #008800;
  --text-white: #ffffff;
  --text-gray: #a0a0a0;

  --accent-glow: 0 0 20px rgba(0, 242, 0, 0.5);
  --accent-glow-strong: 0 0 40px rgba(0, 242, 0, 0.8);

  --border-color: rgba(0, 242, 0, 0.2);
  --border-color-strong: rgba(0, 242, 0, 0.4);

  --font-sans: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-display: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius: 4px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Keyframes */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInEffects {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fallbackFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fallbackStaggerIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 0 rgba(0, 242, 0, 0); }
  30% { box-shadow: 0 0 20px rgba(0, 242, 0, 0.15); }
  100% { box-shadow: 0 0 0 rgba(0, 242, 0, 0); }
}

@keyframes staggerFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* HTML & Body */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}

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

/* CRT Effects - Deferred */
body.effects-loaded::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 50%,
    rgba(0, 242, 0, 0.02) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: fadeInEffects 0.5s ease-out forwards;
}

body.effects-loaded::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(0, 242, 0, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 242, 0, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(0, 242, 0, 0.01) 0%, transparent 30%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: fadeInEffects 0.5s ease-out 0.1s forwards;
}

/* =============================================================================
   Typography
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-white);
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-shadow: var(--accent-glow);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-gray);
  margin-bottom: 1.5rem;
}

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

a:hover {
  text-shadow: var(--accent-glow);
}

/* Animated underline for inline text links */
.text-editorial a,
.blog-post-content a,
.leader-bio-text a,
.partner-desc a,
.card-text a,
.quote-modal a,
.footer-text a {
  text-decoration: none;
  background-image: linear-gradient(var(--text-primary), var(--text-primary));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s ease, text-shadow 0.3s ease;
}

.text-editorial a:hover,
.blog-post-content a:hover,
.leader-bio-text a:hover,
.partner-desc a:hover,
.card-text a:hover,
.quote-modal a:hover,
.footer-text a:hover {
  background-size: 100% 1px;
}

/* Display Typography */
.display-huge {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text-white);
}

.display-large {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-white);
}

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

.display-accent.glow-loaded,
.display-accent:hover {
  text-shadow: var(--accent-glow);
}

.text-editorial {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-gray);
  max-width: 65ch;
}

.text-tight {
  max-width: 50ch;
}

/* =============================================================================
   Layout
   ============================================================================= */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* Sections */
.section {
  padding: 12rem 0;
  position: relative;
  border-top: 1px solid var(--border-color);
}

.section-dark {
  background: var(--bg-secondary);
}

.section-compact {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  font-size: 0.75rem;
  color: var(--text-secondary);  /* Improved contrast: #00C000 vs #008800 */
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.section-heading {
  margin-bottom: 3rem;
}

.section-heading-tight {
  margin-bottom: 1.5rem;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* =============================================================================
   Navigation
   ============================================================================= */

.nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(8, 8, 8, 0.95);
}

.nav.scrolled {
  background: rgba(8, 8, 8, 0.98);
  box-shadow: 0 4px 20px rgba(0, 242, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo img {
  height: 40px;
  filter: brightness(0) saturate(100%) invert(1);
  transition: var(--transition);
}

.nav-logo:hover img {
  filter: brightness(0) saturate(100%) invert(58%) sepia(94%) saturate(2584%) hue-rotate(79deg) brightness(104%) contrast(108%);
}

.nav-logo-fallback {
  filter: none !important;
}

.nav-logo:hover .nav-logo-fallback {
  filter: none !important;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-gray);
  font-size: 0.875rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: rgba(0, 242, 0, 0.05);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* Language Picker */
.nav-lang {
  position: relative;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
}

.lang-toggle:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: rgba(0, 242, 0, 0.05);
}

.lang-toggle.active {
  border-color: var(--text-primary);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(0, 242, 0, 0.2);
}

.lang-toggle svg {
  flex-shrink: 0;
}

.lang-chevron {
  transition: transform 0.2s ease;
}

.lang-toggle.active .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  min-width: 180px;
  max-height: 320px;
  overflow: hidden;
  z-index: 1001;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 0, 0.1);
}

.lang-dropdown-inner {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.lang-dropdown-inner::-webkit-scrollbar {
  width: 6px;
}

.lang-dropdown-inner::-webkit-scrollbar-track {
  background: transparent;
}

.lang-dropdown-inner::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: var(--transition);
  border-left: 2px solid transparent;
}

.lang-option:hover {
  background: rgba(0, 242, 0, 0.08);
  color: var(--text-primary);
  border-left-color: var(--text-primary);
}

.lang-option.active {
  background: rgba(0, 242, 0, 0.1);
  color: var(--text-primary);
  border-left-color: var(--text-primary);
}

.lang-code {
  font-weight: 600;
  min-width: 28px;
  color: inherit;
}

.lang-name {
  color: var(--text-gray); /* a11y: improved contrast from --text-dim */
  font-size: 0.75rem;
}

.lang-option:hover .lang-name,
.lang-option.active .lang-name {
  color: var(--text-secondary);
}

/* Language dropdown transitions */
.lang-enter {
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.lang-enter-start {
  opacity: 0;
  transform: translateY(-8px);
}
.lang-enter-end {
  opacity: 1;
  transform: translateY(0);
}
.lang-leave {
  transition: opacity 0.1s ease, transform 0.1s ease;
}
.lang-leave-start {
  opacity: 1;
  transform: translateY(0);
}
.lang-leave-end {
  opacity: 0;
  transform: translateY(-8px);
}

/* Services Dropdown */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-gray);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  transition: var(--transition);
}

.nav-dropdown-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: rgba(0, 242, 0, 0.05);
}

.nav-dropdown-toggle.active {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: rgba(0, 242, 0, 0.05);
}

.nav-dropdown-toggle .nav-chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown-toggle.active .nav-chevron {
  transform: rotate(180deg);
}

.services-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  min-width: 280px;
  z-index: 1001;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 0, 0.1);
}

.services-option {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: var(--transition);
}

.services-option:hover {
  background: rgba(0, 242, 0, 0.05);
  border-left-color: var(--text-primary);
}

.services-title {
  color: var(--text-white);
  font-weight: 500;
  font-size: 0.875rem;
}

.services-desc {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease-out, height 0.4s ease-out;
}

.btn:hover::after {
  width: 800px;
  height: 800px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
  background: var(--text-secondary);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3), var(--accent-glow-strong);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(0, 242, 0, 0.1);
  box-shadow: var(--accent-glow);
}

.btn-full {
  width: 100%;
  margin-top: 1rem;
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Focus States - Accessibility */
.btn:focus-visible,
.nav-link:focus-visible,
.footer-link:focus-visible,
.lang-toggle:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  box-shadow: var(--accent-glow);
}

a:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* =============================================================================
   Footer
   ============================================================================= */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-column {
  min-width: 0;
}

.footer-heading {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  position: relative;
}

.footer-heading::after {
  content: "_";
  animation: blink-cursor 1s 5;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.625rem;
}

.footer-nav a {
  color: var(--text-gray);
  font-size: 0.875rem;
  transition: var(--transition);
  display: inline-block;
  padding: 0.25rem 0;
}

.footer-nav a:hover {
  color: var(--text-primary);
  text-shadow: var(--accent-glow);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  gap: 0.75rem;
}

.footer-legal {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-gray);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--text-primary);
  text-shadow: var(--accent-glow);
}

.footer-text {
  color: var(--text-gray);  /* Improved contrast: #a0a0a0 vs #008800 */
  font-size: 0.8125rem;
}

/* =============================================================================
   Animations
   ============================================================================= */

.fade-in {
  animation: fadeIn 1s ease-out;
}

/* Scroll-triggered animations (Alpine x-intersect) */
/* Note: Using animation only (no transition) to allow GPU compositing */
.animate-fade-up {
  opacity: 0;
  transform: translateY(60px) scale(0.97);
  will-change: transform, opacity;
  animation: fallbackFadeIn 0.6s ease-out 0.5s forwards;
}

.animate-fade-up.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: none;
  will-change: auto;
}

/* Stagger children animation */
.animate-stagger > * {
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  will-change: transform, opacity;
  animation: fallbackStaggerIn 0.5s ease-out 0.6s forwards;
}

.animate-stagger.in-view > * {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: none;
  will-change: auto;
}

/* Stagger delays applied via animation-delay for GPU compositing */
.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* Border reveal animation */
.animate-border {
  position: relative;
}

.animate-border::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--text-primary), var(--border-color-strong) 50%, var(--border-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0, 242, 0, 0.3);
}

.animate-border.in-view::before {
  transform: scaleX(1);
}

/* Glow pulse on reveal */
.animate-glow {
  transition: box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-glow.in-view {
  animation: glowPulse 0.8s ease-out;
}

/* Staggered Animation */
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-in.visible > *:nth-child(1) { animation: staggerFade 0.6s 0.1s forwards; }
.stagger-in.visible > *:nth-child(2) { animation: staggerFade 0.6s 0.2s forwards; }
.stagger-in.visible > *:nth-child(3) { animation: staggerFade 0.6s 0.3s forwards; }
.stagger-in.visible > *:nth-child(4) { animation: staggerFade 0.6s 0.4s forwards; }
.stagger-in.visible > *:nth-child(5) { animation: staggerFade 0.6s 0.5s forwards; }
.stagger-in.visible > *:nth-child(6) { animation: staggerFade 0.6s 0.6s forwards; }

/* =============================================================================
   Mobile: Disable Scroll Animations (Speed Index Optimization)
   Show content immediately on mobile - animations hurt Speed Index on slow 4G
   ============================================================================= */
@media (max-width: 768px) {
  .animate-fade-up,
  .animate-fade-up.in-view {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
  }

  .animate-stagger > *,
  .animate-stagger.in-view > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
  }

  .stagger-in > *,
  .stagger-in.visible > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .animate-border::before {
    transform: scaleX(1) !important;
    transition: none !important;
  }
}

/* =============================================================================
   Utility Classes
   ============================================================================= */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-dim); }

.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-5 { margin-top: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-1-5 { margin-top: 1.5rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1-5 { margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 3rem; }

.max-w-prose { max-width: 600px; }
.border-top { border-top: 1px solid var(--border-color); }

.text-editorial-spaced {
  margin-top: 1.5rem;
  max-width: 600px;
}

.lead-text {
  font-size: 1.25rem;
  color: var(--text-gray);
  line-height: 1.6;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

/* =============================================================================
   iOS Form Compatibility
   ============================================================================= */

input,
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300F200' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* =============================================================================
   Responsive - Core Layout
   ============================================================================= */

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
  }
}

@media (max-width: 768px) {
  body.nav-open {
    overflow: hidden;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }

  .btn-secondary {
    width: auto;
    min-width: 180px;
    text-align: center;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu.nav-pushed {
    transform: translateX(-30%);
    opacity: 0.3;
    pointer-events: none;
  }

  .lang-dropdown,
  .services-dropdown {
    display: none !important;
  }

  .nav-dropdown-toggle .nav-chevron {
    display: none;
  }

  .mobile-lang-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .mobile-lang-panel.active {
    transform: translateX(0);
  }

  .lang-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
  }

  .lang-back:hover {
    background: rgba(0, 242, 0, 0.05);
  }

  .mobile-lang-panel .lang-list {
    padding: 0.5rem 0;
  }

  .mobile-lang-panel .lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: var(--transition);
  }

  .mobile-lang-panel .lang-option:hover,
  .mobile-lang-panel .lang-option.active {
    background: rgba(0, 242, 0, 0.08);
    color: var(--text-primary);
    border-left-color: var(--text-primary);
  }

  .mobile-lang-panel .lang-code {
    font-weight: 600;
    min-width: 28px;
  }

  .mobile-lang-panel .lang-name {
    color: var(--text-gray); /* a11y: improved contrast from --text-dim */
    font-size: 0.75rem;
  }

  .mobile-lang-panel .lang-option:hover .lang-name,
  .mobile-lang-panel .lang-option.active .lang-name {
    color: var(--text-secondary);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

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

  .nav-link {
    padding: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-lang {
    position: relative;
  }

  .lang-toggle {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .lang-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 300px;
  }

  .lang-option {
    padding: 1rem 1.5rem;
    min-height: 48px;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-buttons .btn {
    width: 100%;
    text-align: center;
  }

  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-heading {
    margin-bottom: 1rem;
  }

  .footer-nav li {
    margin-bottom: 0.5rem;
  }

  .footer-bottom {
    gap: 0.75rem;
  }

  .footer-legal {
    gap: 1.5rem;
  }

  .section-label,
  .job-type {
    font-size: 0.8125rem;
  }
}

@media (min-width: 769px) {
  .mobile-lang-panel {
    display: none;
  }

  .lang-back {
    display: none;
  }

  .nav-menu.nav-pushed {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 1rem 2rem;
    min-height: 48px;
    width: 100%;
  }

  .display-huge {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
    line-height: 1.05;
  }

  .display-large {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .cta-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* =============================================================================
   Reduced Motion - Accessibility
   ============================================================================= */

@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;
  }

  .animate-fade-up,
  .animate-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .animate-border::before {
    transform: scaleX(1);
    transition: none;
  }

  .animate-glow.in-view {
    animation: none;
  }

  .stagger-in > * {
    opacity: 1;
    transform: none;
  }

  .stagger-in.visible > * {
    animation: none;
  }
}
