:root {
  --bg-color: #080808;
  --text-color: #e8e6e3;
  --accent-color: #bfb8aa;
}

/* --- REFINED LIGHT THEME (Swiss/Minimalist Aesthetic) --- */
body.light-theme {
  --bg-color: #acabab;
  --text-color: #ffffff;
  --accent-color: #ffffff;
}

/* Global Text Overrides */
body.light-theme .text-white { color: var(--text-color) !important; }
body.light-theme .text-white\/90 { color: rgba(255, 255, 255, 0.9) !important; }
body.light-theme .text-white\/80 { color: rgba(255, 255, 255, 0.8) !important; }
body.light-theme .text-white\/70 { color: rgba(255, 255, 255, 0.7) !important; }
body.light-theme .text-white\/60 { color: rgba(255, 255, 255, 0.6) !important; }
body.light-theme .text-white\/50 { color: rgba(255, 255, 255, 0.5) !important; }
body.light-theme .text-white\/40 { color: rgba(255, 255, 255, 0.4) !important; }
body.light-theme .text-white\/30 { color: rgba(255, 255, 255, 0.3) !important; }
body.light-theme .text-white\/20 { color: rgba(255, 255, 255, 0.2) !important; }
body.light-theme .text-white\/10 { color: rgba(255, 255, 255, 0.1) !important; }

/* Link Hover Fix (excluding Nav which uses mix-blend) */
body.light-theme a:not(.nav-link):not(#brand-link):hover {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Section Background Overrides (ID-based for robustness) */
body.light-theme #hero,
body.light-theme #about,
body.light-theme #works,
body.light-theme #ai-interface,
body.light-theme #contact {
    background-color: transparent !important;
}

/* Tailwind Class Overrides (Backup) */
body.light-theme .bg-\[\#080808\] { background-color: var(--bg-color) !important; }
body.light-theme .bg-\[\#0c0c0c\] { background-color: #999999 !important; }
body.light-theme .bg-white { background-color: #ffffff !important; }
body.light-theme .bg-white\/20 { background-color: rgba(255, 255, 255, 0.1) !important; }
body.light-theme .bg-black\/20 { background-color: rgba(0, 0, 0, 0.2) !important; }

/* Border Overrides */
body.light-theme .border-white\/20 { border-color: rgba(255, 255, 255, 0.1) !important; }
body.light-theme .border-white\/10 { border-color: rgba(255, 255, 255, 0.05) !important; }
body.light-theme .border-white\/30 { border-color: rgba(255, 255, 255, 0.2) !important; }

/* Horizontal Scroll Section Fix */
body.light-theme .horizontal-slide {
    background-color: var(--bg-color) !important;
    border-right-color: rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* 3D Background - Stronger Visibility */
body.light-theme #canvas-container {
    filter: invert(1);
    color: #000000;
}
/* Noise Overlay */
body.light-theme .noise-overlay {
    filter: none;
    opacity: 0.05;
}

/* Hero Section Fixes */
/* Disable mix-blend-difference on the hero container specifically */
body.light-theme #hero .mix-blend-difference {
    mix-blend-mode: normal !important;
}
body.light-theme .mix-blend-overlay {
    mix-blend-mode: normal !important;
}
body.light-theme .hero-title {
  color: #ffffff !important;
}
body.light-theme .hero-sub {
  color: #dddddd !important;
}

/* Navigation - Keep WHITE so mix-blend-difference makes it BLACK */
body.light-theme nav .nav-link,
body.light-theme nav .text-lg,
body.light-theme #brand-link {
  color: rgba(254, 254, 253, 0.75) !important; 
}

/* Ensure mix-blend-difference is active on nav in light theme */
body.light-theme nav {
    mix-blend-mode: difference !important;
}

/* Mobile Menu */
body.light-theme #mobile-menu {
    background-color: #acabab !important;
}

body.light-theme #mobile-menu .mobile-link {
    color: #ffffff !important;
}
body.light-theme #mobile-menu .mobile-link:hover {
    color: #ffffff !important;
    -webkit-text-stroke: 1px #ffffff;
}

/* Capability Rail */
.chip {
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.service-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.service-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 1.75rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 1.4rem;
  pointer-events: none;
  border: 1px solid transparent;
}

.service-card:hover::after {
  border-color: rgba(255, 255, 255, 0.2);
}

.service-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Space Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

.service-index {
  font-size: 0.9rem;
  color: white;
}

.service-card h4 {
  font-family: "Syne", sans-serif;
  font-size: 1.7rem;
  margin: 0;
  color: white;
}

.service-card p {
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
}

.service-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  line-height: 1.6;
}

.service-marquee {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.marquee-track {
  display: inline-flex;
  gap: 3rem;
  padding: 1rem 0;
  animation: marquee 18s linear infinite;
  font-family: "Space Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

body.light-theme .service-card {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.5);
}

body.light-theme .service-card p,
body.light-theme .service-card ul {
  color: rgba(34, 34, 34, 0.7);
}

body.light-theme .service-card-head {
  color: rgba(0, 0, 0, 0.6);
}

body.light-theme .chip {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .service-marquee {
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .marquee-track {
  color: rgba(0, 0, 0, 0.4);
}

/* Spotlight Metrics */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  background: rgba(8, 8, 8, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s; 
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.3);
}

.stat-label {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.stat-value {
  font-family: "Syne", sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1.25rem;
  border-radius: 999px;
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
}

body.light-theme .stat-card {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

body.light-theme .stat-caption {
  color: rgba(0, 0, 0, 0.7);
}

body.light-theme .stat-label {
  color: rgba(0, 0, 0, 0.6);
}

body.light-theme .status-pill {
  background: rgba(255, 255, 255, 0.6);
  color: #111;
  border-color: rgba(0, 0, 0, 0.08);
}

/* Process Timeline */
.process-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .process-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }
  .process-sticky {
    position: sticky;
    top: 120px;
  }
}

.process-legends {
  display: flex;
  gap: 1.5rem;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  margin-right: 0.5rem;
}

.process-steps {
  position: relative;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 2rem;
}

.process-step {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
  position: relative;
}

.process-step:last-child {
  padding-bottom: 0;
}

.process-step::after {
  content: "";
  position: absolute;
  left: -2rem;
  bottom: 0;
  width: 1px;
  height: calc(100% - 40px);
  background: rgba(255, 255, 255, 0.08);
}

.process-step:last-child::after {
  display: none;
}

.step-index {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.process-step h4 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-family: "Syne", sans-serif;
  color: white;
}

.process-step p {
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  max-width: 420px;
}

.process-step.is-active .step-index {
  background: white;
  color: #111;
  border-color: white;
}

.process-step.is-active h4 {
  color: white;
}

body.light-theme .process-steps {
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .process-step::after {
  background: rgba(0, 0, 0, 0.08);
}

body.light-theme .step-index {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

body.light-theme .process-step h4,
body.light-theme .process-step.is-active h4 {
  color: #111;
}

body.light-theme .process-step p {
  color: rgba(0, 0, 0, 0.6);
}

body.light-theme .legend-dot {
  background: rgba(0, 0, 0, 0.5);
}
/* Terminal - Clean Light Theme */
body.light-theme #terminal-container {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255,255,255,0.1);
}
body.light-theme .bg-\[\#2d2d2d\] { 
  background-color: #999999 !important; 
  border-bottom: 1px solid #888888 !important;
}
body.light-theme #terminal-body {
  background-color: #acabab !important;
}
body.light-theme .text-\[\#ccc\] { color: #eeeeee !important; }
body.light-theme .text-\[\#cccccc\] { color: #ffffff !important; }
body.light-theme #terminal-input { color: #ffffff !important; }

/* Terminal Syntax Colors (Light Mode) */
body.light-theme .text-\[\#C9C1FC\] { color: #ffffff !important; } /* Purple */
body.light-theme .text-\[\#4c89c4\] { color: #ffffff !important; } /* Blue */

/* Outline Text Fix (Contact & Hover) */
body.light-theme .text-outline {
    -webkit-text-stroke: 2px rgb(255 255 255) !important;
    color: #ffffff24 !important;
}
body.light-theme .text-outline:hover {
  color: #ffffff !important;
  -webkit-text-stroke: 0px !important;
  text-shadow: none !important;
}

/* Creative Letter Hover in Light Theme */
body.light-theme .creative-letter:hover {
  color: #ffffff !important;
  text-shadow: 4px 4px 0px rgba(255, 0, 0, 0.5), -4px -4px 0px rgba(0, 0, 255, 0.5) !important;
}

/* Cursor - Solid Black */
body.light-theme .cursor-dot {
    background-color: #ffffff !important;
    mix-blend-mode: difference !important;
}
body.light-theme .cursor-circle {
    border-color: rgba(255,255,255,0.4) !important;
    mix-blend-mode: difference !important;
}

/* Selection */
body.light-theme ::selection {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  margin: 0;
  cursor: none;
}

/* Typography Utilities */
.font-serif {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}
.font-mono {
  font-family: "Space Mono", monospace;
}

/* Outline Text Effect */
.text-outline {
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
  color: transparent;
  transition: all 0.3s ease;
}
.text-outline:hover {
  color: #fff;
  -webkit-text-stroke: 0px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Creative Letter Animations */
.creative-letter {
  display: inline-block;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.creative-letter:hover {
  color: #fff;
  -webkit-text-stroke: 0px;
  transform: scale(1.1) skewX(-10deg);
  text-shadow: 4px 4px 0px rgba(255, 0, 0, 0.8), -4px -4px 0px rgba(0, 0, 255, 0.8);
}
.creative-letter:nth-child(even):hover {
  transform: scale(1.1) skewX(10deg);
}

/* Film Grain Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 3D Canvas */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* Behind text */
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Custom Cursor */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.1s;
}
.cursor-circle {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
  mix-blend-mode: difference;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ensure magnetic elements can be transformed */
a, button, .magnetic, .creative-letter {
  display: inline-block;
}

/* Hover States */
body.hovering .cursor-dot {
  opacity: 0;
}

/* Typing Cursor Blink */
.cursor-blink {
  animation: blink 1s step-end infinite;
}

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

/* Loader */
.loader-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #080808;
  z-index: 9950;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

/* Horizontal Scroll Layouts (Responsive) */
.horizontal-wrapper {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column; /* Stack by default on mobile */
}

.horizontal-slide {
  width: 100%;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  /* Solid background to cover 3D if it was visible */
  background: #080808;
}

/* Desktop Styles for Horizontal Scroll */
@media (min-width: 768px) {
  .horizontal-wrapper {
    width: 400%; /* 4 slides */
    height: 100%;
    flex-direction: row;
  }
  .horizontal-slide {
    width: 100vw;
    padding: 4rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
  }
}

/* Image Parallax Container */
.img-overflow {
  overflow: hidden;
}
.img-overflow img {
  transform: scale(1.2);
  transition: transform 0.5s ease-out;
}

/* Scrollbar Hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Terminal Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.terminal-msg {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Terminal Selection */
#terminal-output ::selection, #terminal-input::selection {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}
