:root {
  --bg: #050714; /* Deep premium dark blue/black */
  --primary: #b829ea; /* Magenta */
  --accent: #00e5ff; /* Cyan */
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.6);
  --glass: rgba(10, 15, 30, 0.5);
  --glass-border: rgba(0, 229, 255, 0.15);
  --hover-glow: rgba(0, 229, 255, 0.4);
  
  --f-heading: 'Outfit', sans-serif;
  --f-body: 'Inter', sans-serif;
  --f-display: 'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Global Utilities */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-dim { color: var(--text-dim); }

.text-accent-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}

.section-padding { padding: 8rem 4rem; }
.section-border { border-bottom: 1px solid var(--glass-border); }

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

/* WebGL Background */
#webgl-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#smooth-wrapper {
  position: relative;
  z-index: 10;
  width: calc(100% - 80px); /* Leave space for HUD nav */
  margin-left: 80px;
}

/* ==============================================
   RESTORED HUD NAV & LOGO 
============================================== */
.logo-massive {
  position: fixed;
  top: 50vh;
  left: 50vw;
  transform: translate(-50%, -50%);
  width: 60vw;
  max-width: 700px;
  filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.2));
  z-index: 1001;
  pointer-events: none;
}

.hud-nav {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 80px;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4rem;
}

.hud-nav a {
  color: var(--text-dim);
  font-family: var(--f-heading);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transition: all 0.3s ease;
}
.hud-nav a:hover, .hud-nav a.active {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  transform: rotate(180deg) scale(1.1);
}

/* ==============================================
   1. Cinematic Hero 
============================================== */
.hero-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-content {
  text-align: center;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-subtitle {
  font-family: var(--f-heading);
  font-size: clamp(1rem, 2vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-top: 1rem;
}
.scroll-arrow { animation: float 2s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ==============================================
   3. Kinetic Typography 
============================================== */
.kinetic-section { overflow: hidden; }
.kinetic-wrapper { display: flex; flex-direction: column; gap: 2rem; }
.kinetic-text {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5.5vw, 8rem);
  font-weight: 800;
  line-height: 0.9;
  white-space: nowrap;
  text-transform: uppercase;
}
.kinetic-text-1 { transform: translateX(-10%); }

/* ==============================================
   10. Editorial Layout (Restored Texts)
============================================== */
.editorial-section { background-color: var(--bg); position: relative; z-index: 15; }
.editorial-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}
.editorial-col-2 { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; }
.editorial-col-7 { grid-column: span 7; }
.editorial-col-3 { 
  grid-column: span 3; 
  border-left: 1px solid var(--glass-border); 
  padding-left: 2rem; 
  display: flex; 
  flex-direction: column; 
  gap: 2rem;
}
.editorial-meta {
  font-family: var(--f-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.vertical-text {
  font-family: var(--f-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: 4rem;
}
.editorial-title {
  font-family: var(--f-display);
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 0.9;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.editorial-desc {
  font-size: 1.15rem;
  max-width: 650px;
  color: var(--text-dim);
  margin-bottom: 3rem;
  line-height: 1.8;
}

.interactive-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1.2rem 3rem;
  font-family: var(--f-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.interactive-btn:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.3);
}
.btn-primary {
  background: var(--primary);
  color: var(--text);
  border: none;
}
.btn-primary:hover {
  background: #d63cff;
  box-shadow: 0 10px 30px rgba(184, 41, 234, 0.4);
}

.status-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}
.status-box h4 { font-family: var(--f-heading); letter-spacing: 0.1em; font-size: 0.9rem; margin-bottom: 0.5rem; }

.tech-visual {
  flex: 1;
  background: #000;
  border: 1px solid var(--primary);
  position: relative;
  overflow: hidden;
  padding: 1rem;
  display: flex;
  align-items: flex-end;
}
.tech-visual span { font-family: monospace; font-size: 0.75rem; color: var(--primary); }
.tech-scan-line {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: scan 3s linear infinite;
}
@keyframes scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ==============================================
   5 & 8. Scroll Zoom & Mask 
============================================== */
.zoom-section {
  position: relative;
  height: 100vh;
  width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.zoom-mask-text {
  position: absolute;
  font-family: var(--f-display);
  font-size: clamp(5rem, 15vw, 20rem);
  color: var(--text);
  mix-blend-mode: exclusion;
  z-index: 10;
  pointer-events: none;
}
.zoom-image-wrapper {
  width: 30vw;
  height: 40vh;
  border-radius: 30px;
  overflow: hidden;
  will-change: transform, width, height, border-radius;
}
.zoom-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
}

/* ==============================================
   6. Horizontal Scrolling Gallery 
============================================== */
.horizontal-section {
  position: relative;
  height: 100vh;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}
.horizontal-label {
  position: absolute;
  top: 4rem; left: 4rem;
  font-family: var(--f-heading);
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.9rem;
  z-index: 10;
}
.horizontal-container {
  display: flex;
  height: 100%;
  padding-left: 20vw; 
  align-items: center;
  gap: 5vw;
  width: max-content; 
}
.project-card {
  width: 60vw;
  height: 70vh;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}
.project-img-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.project-img-wrapper img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.2);
  transition: filter 0.5s;
}
.project-card:hover .project-img-wrapper img {
  filter: grayscale(0) contrast(1);
}
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2rem;
}
.project-number { font-family: var(--f-display); font-size: 2rem; color: var(--accent); margin-right: 1rem; }
.project-title { font-family: var(--f-display); font-size: 2rem; display: inline; text-transform: uppercase; }
.project-cat { font-size: 0.95rem; color: var(--text-dim); }

/* ==============================================
   SUBPAGES: SERVICES, CONTACT, DEMO
============================================== */
/* Services Stacking Deck */
.stacking-container {
  position: relative;
  width: 100%;
}
.stack-card {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.8);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.stack-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(0.2) saturate(1.2);
  transform: scale(1.05); /* Prevent edge bleeding on scroll */
}
.stack-content {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  background: rgba(5, 7, 20, 0.7);
  backdrop-filter: blur(25px);
  padding: 4rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.stack-number {
  font-family: var(--f-display);
  font-size: 8rem;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}
.stack-title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: #fff;
  margin-bottom: 2rem;
  text-transform: uppercase;
}
.stack-desc {
  font-size: 1.25rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 2rem;
}
.stack-features {
  list-style: none;
  font-family: var(--f-heading);
}
.stack-features li {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stack-features li::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
@media (max-width: 900px) {
  .stack-content { grid-template-columns: 1fr; padding: 2rem; gap: 2rem; }
  .stack-number { font-size: 4rem; }
}

/* Contact Terminal Layout */
.contact-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
  padding-top: 100px;
}
.contact-info-hub {
  padding: 6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--glass-border);
}
.contact-form-hub {
  padding: 6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.premium-form .form-group {
  position: relative;
  margin-bottom: 3rem;
}
.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.2rem;
  padding: 10px 0;
  font-family: var(--f-body);
  transition: all 0.3s;
}
.form-input:focus { outline: none; border-bottom-color: var(--accent); }
.form-label {
  position: absolute;
  top: 10px;
  left: 0;
  color: var(--text-dim);
  transition: 0.3s;
  pointer-events: none;
}
.form-input:focus ~ .form-label, .form-input:valid ~ .form-label {
  top: -20px;
  font-size: 0.85rem;
  color: var(--accent);
}

/* Demo Glass Container */
.demo-glass-container {
  width: 90%;
  max-width: 1000px;
  min-height: 80vh;
  height: auto;
  margin: 150px auto 100px auto;
  background: rgba(10, 15, 30, 0.4);
  backdrop-filter: blur(30px);
  border: 1px solid var(--primary);
  box-shadow: 0 0 40px rgba(184, 41, 234, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 4rem;
}

@media (max-width: 1024px) {
  .contact-split-layout { grid-template-columns: 1fr; }
  .contact-info-hub { border-right: none; border-bottom: 1px solid var(--glass-border); padding: 3rem; }
  .contact-form-hub { padding: 3rem; }
}

/* ==============================================
   Final CTA & Footer
============================================== */
.final-cta {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: var(--bg);
  position: relative;
}
.cta-content { max-width: 1000px; z-index: 10; margin-top: auto; margin-bottom: auto; }
.cta-title { font-family: var(--f-display); font-size: clamp(3rem, 6vw, 6rem); line-height: 0.9; text-transform: uppercase; margin-bottom: 2rem; }
.cta-desc { font-size: 1.2rem; color: var(--text-dim); margin-bottom: 4rem; }

/* ==============================================
   2. Katana Transition Effects 
============================================== */
.katana-blade {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 200vw;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 20px 5px #fff, 0 0 40px 15px var(--accent);
  transform: translate(-50%, -50%) rotate(35deg);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.katana-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 1024px) {
  .demo-glass-container { padding: 2rem; }
}

/* ==============================================
   NEW HOMEPAGE COMPONENTS
================================================= */

/* 1. Data Overload Terminal */
.data-overload-section {
  position: relative;
  overflow: hidden;
}
.overload-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}
.glitch-title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  text-transform: uppercase;
  line-height: 1.1;
}
.glitch-text {
  position: relative;
  display: inline-block;
}
.overload-right {
  background: #000;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.1);
  transition: all 0.5s ease;
  position: relative;
  min-height: 350px;
}
.overload-right:hover {
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.2);
  border-color: var(--primary);
}
.terminal-header {
  background: #111;
  padding: 10px 15px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  gap: 8px;
}
.terminal-header .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title { margin-left: 1rem; color: #666; font-size: 0.8rem; letter-spacing: 0.1em; }
.terminal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.code-line {
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  animation: codeLineIn 0.3s forwards;
}
.code-line.error { color: #ff5f56; text-shadow: 0 0 5px rgba(255, 95, 86, 0.5); }
.code-line.success { color: #00e5ff; text-shadow: 0 0 5px rgba(0, 229, 255, 0.5); }

@keyframes codeLineIn {
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
  .overload-container { grid-template-columns: 1fr; }
}

/* 2. HUD Dashboard */
.hud-dashboard-section {
  position: relative;
}
.hud-bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 1;
  opacity: 0.5;
}
.hud-panel-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 3rem;
  margin-top: 4rem;
}
.hud-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 250px;
}
.hud-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 2rem;
}
.hud-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.hud-circle-bg {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 2;
}
.hud-circle-progress {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283; /* Start empty */
  transition: stroke-dashoffset 2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress-accent { stroke: var(--accent); filter: drop-shadow(0 0 10px var(--accent)); }
.progress-primary { stroke: var(--primary); filter: drop-shadow(0 0 10px var(--primary)); }
.progress-white { stroke: #fff; filter: drop-shadow(0 0 10px #fff); }
.hud-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-display);
  font-size: 3rem;
  color: #fff;
  display: flex;
  align-items: baseline;
}
.hud-unit { font-size: 1.5rem; color: var(--text-dim); margin-left: 0.2rem; }
.hud-label {
  font-family: var(--f-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
}

/* 3. Tech Marquee */
.tech-marquee-container {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.tech-marquee-container::before, .tech-marquee-container::after {
  content: "";
  position: absolute;
  top: 0;
  width: 150px;
  height: 100%;
  z-index: 2;
}
.tech-marquee-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.tech-marquee-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}
.tech-marquee-track {
  display: inline-block;
  animation: marquee 30s linear infinite;
}
.tech-marquee-item {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 4rem;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.2);
  margin: 0 3rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.tech-marquee-item:hover {
  -webkit-text-stroke: 1px var(--primary);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 4. Industry Use Cases */
.industry-usecases-section { cursor: default; }
.industry-list { list-style: none; padding: 0; margin: 0; }
.industry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}
.industry-item:first-child { border-top: 1px solid rgba(255,255,255,0.1); }
.industry-name {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--text-dim);
  transition: all 0.3s ease;
}
.industry-arrow {
  font-size: 2rem;
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s ease;
}
.industry-item:hover .industry-name { color: #fff; padding-left: 2rem; }
.industry-item:hover .industry-arrow { opacity: 1; transform: translateX(0); color: var(--primary); }
.industry-images-container {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
.industry-img {
  position: absolute;
  width: 400px;
  height: 500px;
  object-fit: cover;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  pointer-events: none;
}
.industry-img.active {
  opacity: 0.6;
  transform: translate(-50%, -50%) scale(1);
}
@media (max-width: 768px) {
  .industry-img { display: none; }
  .industry-item:hover .industry-name { padding-left: 0; color: var(--primary); }
}

@media (max-width: 1024px) {
  #smooth-wrapper { width: 100%; margin-left: 0; }
  .hud-nav, .logo-glass-bg { display: none; }
  
  .editorial-col-2, .editorial-col-3, .editorial-col-7 { grid-column: span 12; }
  .editorial-col-3 { border-left: none; border-top: 1px solid var(--glass-border); padding-left: 0; padding-top: 2rem; }
  .vertical-text { writing-mode: horizontal-tb; transform: none; margin-top: 1rem; margin-bottom: 2rem; }
  
  .horizontal-container { padding-left: 5vw; gap: 5vw; }
  .project-card { width: 90vw; height: auto; }
}
