/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

::selection {
  background: rgba(255, 76, 41, 0.3);
  color: #fff;
}

/* ── Navigation ───────────────────────────────────────── */
.nav-header {
  background: rgba(11, 12, 16, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-header.scrolled {
  background: rgba(11, 12, 16, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav-link {
  color: rgba(197, 198, 199, 0.7);
  transition: color 0.2s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #FF4C29;
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

/* ── Language Switcher ────────────────────────────────── */
.lang-switcher {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  color: rgba(197, 198, 199, 0.5);
  border-radius: 9999px;
  transition: color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn--active {
  color: #fff;
  background: rgba(255, 76, 41, 0.2);
}

/* ── 3D Grid Background ───────────────────────────────── */
.grid-3d-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 900px;
  perspective-origin: 50% 35%;
}

.grid-3d-wrapper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.grid-3d-plane {
  position: absolute;
  left: 50%;
  width: 280%;
  height: 280%;
  margin-left: -140%;
  transform-style: preserve-3d;
  background-image:
    linear-gradient(rgba(255, 76, 41, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 76, 41, 0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  will-change: transform;
}

.grid-3d-plane--far {
  top: 10%;
  opacity: 0.25;
  background-size: 120px 120px;
}

.grid-3d-plane--mid {
  top: 5%;
  opacity: 0.45;
  background-size: 80px 80px;
}

.grid-3d-plane--near {
  top: 0%;
  opacity: 0.65;
  background-size: 56px 56px;
}

.grid-3d-horizon {
  position: absolute;
  left: -20%;
  right: -20%;
  top: 42%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 76, 41, 0.15) 20%,
    rgba(255, 107, 0, 0.4) 50%,
    rgba(255, 76, 41, 0.15) 80%,
    transparent 100%
  );
  box-shadow: 0 0 40px rgba(255, 76, 41, 0.2), 0 0 80px rgba(255, 76, 41, 0.08);
  opacity: 0.6;
}

.grid-3d-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, transparent 0%, #0B0C10 75%),
    linear-gradient(to bottom, #0B0C10 0%, transparent 25%, transparent 70%, #0B0C10 100%);
}

/* ── Console Widget ───────────────────────────────────── */
.console-frame {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(255, 76, 41, 0.08);
}

.console-line {
  opacity: 0;
  transform: translateY(4px);
  animation: consoleFadeIn 0.3s ease forwards;
}

.console-line.ok { color: #4ade80; }
.console-line.info { color: #60a5fa; }
.console-line.warn { color: #fbbf24; }
.console-line.dim { color: rgba(197, 198, 199, 0.4); }

.console-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: #FF4C29;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

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

@keyframes blink {
  50% { opacity: 0; }
}

/* ── Bento Cards ──────────────────────────────────────── */
.bento-card {
  perspective: 800px;
  cursor: default;
}

.bento-card-inner {
  position: relative;
  border-radius: 1rem;
  background: #1F2833;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.15s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.bento-card:hover .bento-card-inner {
  border-color: rgba(255, 76, 41, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 76, 41, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(255, 76, 41, 0.12);
}

.bento-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 76, 41, 0.12) 0%,
    transparent 60%
  );
  z-index: 1;
}

.bento-card:hover .bento-glare {
  opacity: 1;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(197, 198, 199, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
}

/* ── Process Timeline ─────────────────────────────────── */
.process-line-fill {
  transform: scaleX(0);
}

.process-dot {
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.process-step.active .process-dot {
  background-color: #FF4C29;
  box-shadow: 0 0 12px rgba(255, 76, 41, 0.5);
}

.process-step.active .process-number {
  color: rgba(255, 76, 41, 0.3);
}

/* ── Contact ──────────────────────────────────────────── */
.contact-glow {
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(255, 76, 41, 0.06) 0%, transparent 70%);
}

.form-input:focus {
  outline: none;
}

/* ── Legal / Privacy ──────────────────────────────────── */
.legal-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: #fff;
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal-content h2:first-of-type {
  margin-top: 1.5rem;
}

.legal-content p,
.legal-content li {
  color: rgba(197, 198, 199, 0.85);
  line-height: 1.75;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.75rem 0 1rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content a {
  color: #FF4C29;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.legal-content a:hover {
  color: #FF6B00;
}

/* ── Scroll Indicator ─────────────────────────────────── */
.scroll-indicator {
  animation: fadeInUp 1s ease 2s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── 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-indicator { display: none; }

  .bento-card-inner {
    transform: none !important;
  }

  .grid-3d-plane,
  .grid-3d-wrapper,
  .grid-3d-horizon {
    transform: none !important;
  }
}
