/* ========================================
   ILLUUGRAPHY — Kinetic Brutalism
   Awwwards Style Overhaul
   ======================================== */

/* ── Variables ── */
:root {
  --bg-color: #050505;
  --text-color: #f0f0f0;
  --accent-color: #ccff00; /* Neon Chartreuse */
  
  --font-sans: 'Clash Display', sans-serif;
  --font-serif: 'Instrument Serif', serif;
  --font-body: 'Space Grotesk', sans-serif;
  
  --padding-x: clamp(20px, 5vw, 60px);
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none; /* Hide default cursor for custom GSAP cursor */
}

/* Lenis smooth scrolling base */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Massive Digit Preloader ── */
.preloader {
  position: fixed; inset: 0;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.preloader-counter {
  font-family: var(--font-sans);
  font-size: clamp(8rem, 25vw, 30rem);
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  will-change: transform, opacity;
}

/* ── WebGL Canvas, Backgrounds & Noise ── */
.himalayas-bg {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  object-fit: cover;
  z-index: -3; pointer-events: none; opacity: 0.4;
  mix-blend-mode: screen; /* Blends the video into the fluid */
}

#gl-canvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: -2; pointer-events: none;
  opacity: 0.85; /* Allow mountains to slightly bleed through */
}
.noise-overlay {
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ── Custom Cursor ── */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 20px; height: 20px;
  background-color: var(--accent-color);
  border-radius: 50%;
  pointer-events: none; z-index: 10000;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  display: flex; justify-content: center; align-items: center;
  transition: width 0.3s, height 0.3s, background-color 0.3s;
}
.cursor.active {
  width: 100px; height: 100px;
  background-color: var(--text-color);
  mix-blend-mode: normal;
}
.cursor-text {
  font-family: var(--font-sans); font-size: 14px; font-weight: 700;
  color: var(--bg-color); opacity: 0; transition: opacity 0.3s;
  text-transform: uppercase;
}
.cursor.active .cursor-text { opacity: 1; }

/* ── Navigation (Brutalist) ── */
.nav-brutalist {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px var(--padding-x);
  z-index: 100;
  mix-blend-mode: difference;
}
.nav-logo { font-family: var(--font-sans); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.nav-right { display: flex; gap: 30px; font-family: var(--font-sans); font-weight: 600; font-size: 1rem; }
.nav-right a { color: var(--text-color); text-decoration: none; position: relative; }
.nav-right a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0%; height: 2px;
  background-color: var(--accent-color); transition: width 0.3s;
}
.nav-right a:hover::after { width: 100%; }

/* ── Typography Utilities ── */
.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-color); }
.highlight { color: var(--accent-color); }
.hollow-text { 
  -webkit-text-stroke: 4px var(--accent-color); 
  color: transparent; 
  opacity: 0.8;
  mix-blend-mode: normal; 
}
.hollow-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 3px var(--accent-color);
  opacity: 1;
  letter-spacing: -0.02em;
  mix-blend-mode: normal;
  text-shadow: 0 0 1px rgba(204, 255, 0, 0.5); /* Failsafe visibility */
}

/* ── Hero Section ── */
.hero-brutalist {
  min-height: 100vh; padding: 150px var(--padding-x) 50px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero-subtext {
  font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.1em;
  text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 10px; max-width: 400px;
}
.hero-subtext.right { margin-left: auto; text-align: right; margin-top: 20px; border-bottom: none; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 10px; }

.hero-title-wrap { margin-top: auto; margin-bottom: 50px; }
.hero-title {
  font-family: var(--font-sans);
  font-weight: 700; line-height: 0.9; text-transform: uppercase;
  display: flex; flex-direction: column;
}
.hero-title .line-1 { font-size: clamp(2rem, 5vw, 5rem); padding-left: 0; display: block; margin-bottom: -1vw; }
.hero-title .line-2 { font-size: clamp(3.5rem, 13vw, 16rem); margin: 0; z-index: 2; position: relative; padding-left: 5vw; display: block; transition: all 0.4s cubic-bezier(0.2, 1, 0.2, 1); cursor: pointer; } 
.hero-title .line-3 { font-size: clamp(2rem, 5vw, 5rem); padding-left: 15vw; display: block; margin-top: -2vw; }

.interactive-text:hover {
  -webkit-text-stroke: 4px var(--text-color);
  transform: scale(1.02) skewX(-2deg);
}

.hero-bottom { max-width: 600px; margin-left: auto; }
.hero-desc { font-family: var(--font-body); font-size: clamp(1rem, 1.5vw, 1.5rem); line-height: 1.5; font-weight: 400; }

/* ── Infinite Marquee ── */
.marquee-section { padding: 50px 0; border-top: 1px solid rgba(255,255,255,0.2); border-bottom: 1px solid rgba(255,255,255,0.2); background: var(--accent-color); color: var(--bg-color); overflow: hidden; }
.marquee { display: flex; white-space: nowrap; }
.marquee-track { display: flex; gap: 50px; font-family: var(--font-sans); font-size: clamp(3rem, 8vw, 6rem); font-weight: 700; text-transform: uppercase; }
.marquee-track .dot { color: var(--bg-color); font-size: 0.5em; vertical-align: middle; }

/* ── Mission / About ── */
.mission-section { padding: 150px var(--padding-x); background: var(--bg-color); position: relative; z-index: 2; }
.mission-text { font-family: var(--font-sans); font-size: clamp(2.5rem, 5vw, 6rem); font-weight: 600; line-height: 1.1; text-transform: uppercase; max-width: 1400px; margin-bottom: 100px; }

.mission-grid { display: flex; flex-direction: column; border-top: 2px solid var(--text-color); padding-top: 40px; max-width: 1200px; }
.mission-row { display: grid; grid-template-columns: 120px 1fr; gap: 40px; align-items: start; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 40px; margin-bottom: 40px; }
.mission-row:last-child { border-bottom: none; }
.mission-num { font-family: var(--font-sans); font-size: clamp(2rem, 4vw, 4rem); font-weight: 700; color: var(--accent-color); line-height: 1; }
.mission-info h3 { font-family: var(--font-sans); font-size: 1.5rem; letter-spacing: 0.1em; opacity: 0.8; margin-bottom: 15px; text-transform: uppercase; }
.mission-info p { font-family: var(--font-body); font-size: 1.3rem; line-height: 1.6; color: var(--text-color); font-weight: 400; }

/* ── 12 Core Pillars (Brutalist List) ── */
.pillars-section { padding: 50px var(--padding-x) 150px; background: var(--bg-color); }
.pillars-list { display: flex; flex-direction: column; border-top: 2px solid var(--text-color); }
.pillar-item { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 0; border-bottom: 1px solid rgba(255,255,255,0.2); align-items: start; transition: background 0.3s; }
.pillar-item:hover { background: rgba(255,255,255,0.02); }
.pillar-title h2 { font-family: var(--font-sans); font-size: clamp(2rem, 5vw, 4rem); font-weight: 700; line-height: 1; transition: color 0.3s; }
.pillar-item:hover .pillar-title h2 { color: var(--accent-color); padding-left: 20px; }
.pillar-details p { font-family: var(--font-body); font-size: 1.2rem; margin-bottom: 15px; line-height: 1.5; }
.pillar-details .outputs { display: block; font-family: var(--font-body); font-size: 0.9rem; letter-spacing: 0.05em; color: var(--accent-color); text-transform: uppercase; }

/* ── Selected Work (Image Mask Reveals) ── */
.work-section { padding: 100px var(--padding-x) 200px; background: var(--bg-color); }
.section-header-huge { font-family: var(--font-sans); font-size: clamp(4rem, 10vw, 12rem); font-weight: 700; line-height: 1; text-transform: uppercase; margin-bottom: 100px; border-bottom: 2px solid var(--text-color); padding-bottom: 20px; }
.work-gallery { display: flex; flex-direction: column; gap: 100px; }
.project-row { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: center; }
.project-row:nth-child(even) { grid-template-columns: 2fr 1fr; }
.project-row:nth-child(even) .project-info { order: 2; text-align: right; }
.project-info h3 { font-family: var(--font-sans); font-size: clamp(2rem, 4vw, 4rem); font-weight: 700; margin-bottom: 10px; }
.project-info p { font-family: var(--font-body); font-size: 1rem; letter-spacing: 0.1em; color: var(--accent-color); }
.project-image-mask { width: 100%; aspect-ratio: 16/9; overflow: hidden; position: relative; border-radius: 20px; } /* Clean, stable corners */
.project-image-inner { width: 100%; height: 100%; transform: scale(1.1); opacity: 0; } /* Will be smoothly faded up via JS */

/* ── Phone Image Fix ── */
.phone-mask { overflow: visible !important; clip-path: none !important; }
.phone-mask img { filter: drop-shadow(0 20px 50px rgba(0,0,0,0.5)); }

/* ── Ecosystem Backgrounds ── */
.q-nepal-bg { background: url('assets/portfolio-4.png') center/cover; display: flex; align-items: center; justify-content: center; }
.chill-bg { background: url('assets/portfolio-5.png') center/cover; display: flex; align-items: center; justify-content: center; }
.idea-bg { background: url('assets/portfolio-6.png') center/cover; display: flex; align-items: center; justify-content: center; }
.tech-bg { display: flex; align-items: center; justify-content: center; background: transparent; }

.eco-title { font-family: var(--font-sans); color: var(--bg-color); opacity: 0.9; mix-blend-mode: difference; font-size: clamp(3rem, 8vw, 8rem); margin: 0; }
.tech-phone-img { width: auto !important; height: 120% !important; object-fit: contain !important; transform: scale(1.1); filter: drop-shadow(0 20px 50px rgba(0,0,0,0.5)); }

/* ── Trust Metrics ── */
.trust-section { padding: 100px var(--padding-x); background: var(--bg-color); border-top: 1px solid rgba(255,255,255,0.2); position: relative; z-index: 2; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; max-width: 1600px; margin: 0 auto; }
.trust-item h3 { font-family: var(--font-sans); font-size: clamp(3rem, 6vw, 6rem); font-weight: 700; color: var(--accent-color); line-height: 1; margin-bottom: 10px; }
.trust-item p { font-family: var(--font-body); font-size: 1.1rem; letter-spacing: 0.05em; opacity: 0.8; text-transform: uppercase; }

/* ── Dynamic Transforms (controlled by JS) ── */
.skew-element { transform-origin: left center; will-change: transform; }
.velocity-distort { will-change: transform, filter; transform-origin: center center; }

/* ── Footer ── */
.footer-brutalist { padding: 150px var(--padding-x) 50px; background: var(--text-color); color: var(--bg-color); }
.footer-massive-text { font-family: var(--font-sans); font-size: clamp(5rem, 18vw, 25rem); font-weight: 700; line-height: 0.8; text-transform: uppercase; margin-bottom: 100px; }
.footer-bottom-flex { display: flex; justify-content: space-between; align-items: flex-end; }
.footer-cta-group { display: flex; gap: 40px; align-items: flex-end; flex-wrap: wrap; }
.btn-brutalist { font-family: var(--font-sans); font-size: clamp(2rem, 4vw, 4rem); font-weight: 700; text-decoration: none; color: var(--bg-color); border-bottom: 4px solid var(--bg-color); transition: opacity 0.3s; }
.btn-brutalist.outline { opacity: 0.5; border-bottom: 4px solid transparent; }
.btn-brutalist.outline:hover { opacity: 1; border-bottom: 4px solid var(--bg-color); }
.footer-links { text-align: right; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em; display: flex; flex-direction: column; gap: 10px; }

/* Responsive Adjustments */
@media (max-width: 768px) {
  /* Hide custom cursor on mobile */
  .cursor { display: none !important; }

  /* Navigation */
  .nav-brutalist { flex-direction: row; justify-content: space-between; align-items: center; padding: 20px var(--padding-x); }
  .nav-right a[href="#vision"], 
  .nav-right a[href="#pillars"], 
  .nav-right a[href="#ecosystem"] { display: none; }
  
  /* Hero Text & Subtext Fixes (Removing massive gaps) */
  .hero-brutalist { padding-top: 100px; justify-content: center; gap: 40px; min-height: auto; padding-bottom: 80px; }
  .hero-title-wrap { margin: 0; }
  .hero-subtext, .hero-subtext.right { border: none; padding: 0; margin: 0; text-align: left; }
  
  .hero-title .line-1 { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 0; }
  .hero-title .line-2 { padding-left: 0; font-size: clamp(3.5rem, 16vw, 6rem); margin: 0; -webkit-text-stroke: 2px var(--accent-color); }
  .hero-title .line-3 { padding-left: 0; font-size: clamp(2rem, 8vw, 3rem); margin-top: 0; }
  
  .hollow-italic { -webkit-text-stroke: 2px var(--accent-color); }
  .interactive-text:hover { transform: none; } /* Disable heavy hover effect on mobile */
  
  /* Preloader */
  .preloader-counter { font-size: clamp(5rem, 20vw, 25rem); }
  
  /* Grids */
  .project-row { grid-template-columns: 1fr; gap: 20px; }
  .project-row:nth-child(even) { grid-template-columns: 1fr; }
  .project-row:nth-child(even) .project-info { order: -1; text-align: left; }
  
  /* Pillars & Mission */
  .pillar-item { grid-template-columns: 1fr; gap: 15px; padding: 30px 0; }
  .pillar-item:hover .pillar-title h2 { padding-left: 0; }
  .mission-row { grid-template-columns: 1fr; gap: 10px; }
  
  /* Footer */
  .footer-bottom-flex { flex-direction: column; align-items: flex-start; gap: 40px; }
  .footer-cta-group { flex-direction: column; gap: 20px; align-items: flex-start; }
  .footer-links { text-align: left; }
  .btn-brutalist { border-bottom: 2px solid var(--bg-color); font-size: clamp(1.5rem, 6vw, 2.5rem); }
  .btn-brutalist.outline { border-bottom: 2px solid transparent; }
  
  /* Trust Grid */
  .trust-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

/* Accessibility: 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; }
  .skew-element, .velocity-distort, .interactive-text { transform: none !important; filter: none !important; }
}
