/* ============================================
   PORTFOLIO — SPIDER-NOIR DESIGN SYSTEM
   Black & White · Rainy Mumbai · Film Grain
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Special+Elite&display=swap');

/* ─── TOKENS ─── */
:root {
  /* Noir Palette */
  --bg:           #050505;
  --bg-mid:       #0A0A0A;
  --bg-surface:   rgba(12, 12, 12, 0.90);
  --bg-card:      rgba(16, 16, 16, 0.85);

  /* Earthy Vintage Palette */
  --accent-base: #755C1B;   /* Olive Bark */
  --accent-bright: #7A4419; /* Saddle Brown */
  --accent-glow: rgba(122, 68, 25, 0.4);
  --accent-dark: #400406;   /* Rich Mahogany */

  /* Web / thread color — aged parchment */
  --web:          rgba(210, 205, 195, 0.65);
  --web-dim:      rgba(210, 205, 195, 0.2);

  /* City tones — dark grays */
  --city-dark:    #060606;
  --city-mid:     #0E0E0E;
  --city-light:   #1C1C1C;

  /* Window lights — desaturated */
  --window-warm:  rgba(230, 220, 200, 0.7);
  --window-cold:  rgba(200, 215, 230, 0.5);

  /* Text */
  --text:         #D8D8D8;
  --text-mid:     rgba(216, 216, 216, 0.55);
  --text-dim:     rgba(216, 216, 216, 0.28);
  --text-bright:  #F5F5F5;

  /* Borders */
  --border:       rgba(255, 255, 255, 0.07);
  --border-mid:   rgba(255, 255, 255, 0.13);

  /* Glass */
  --glass:        rgba(8, 8, 8, 0.75);

  /* Rain */
  --rain-color:   rgba(190, 200, 215, 0.18);

  --radius:       4px;
  --font-display: 'Bebas Neue', 'Special Elite', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-noir:    'Special Elite', serif;
  --header-h:     72px;
}

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

html, body {
  scroll-behavior: auto;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
}

/* ─── FILM GRAIN OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.7;
  mix-blend-mode: overlay;
}

/* ─── CUSTOM CURSOR ─── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  background: var(--accent-bright);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
  transition: width 0.4s ease, height 0.4s ease, border-color 0.3s;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: 0.03em; line-height: 0.9; }
h1 { font-size: clamp(4rem, 12vw, 10rem); }
h2 { font-size: clamp(2.5rem, 6vw, 5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
p  { font-family: var(--font-body); line-height: 1.7; }

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mid);
}

/* ─── SELECTION ─── */
::selection { background: rgba(255,255,255,0.15); color: var(--text-bright); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ─── LOADING SCREEN ─── */
#loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}
.loader-web { width: 60px; height: 60px; }
.loader-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}
.loader-bar {
  width: 200px;
  height: 1px;
  background: rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.loader-bar::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  animation: loaderSweep 1.4s ease-in-out infinite;
}
@keyframes loaderSweep { to { left: 200%; } }

/* ─── NAV ─── */
nav#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 500;
  padding: 0 clamp(24px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(5,5,5,0.98) 0%, transparent 100%);
  transition: background 0.4s;
}
nav#main-nav.scrolled {
  background: rgba(5,5,5,0.95);
  backdrop-filter: blur(24px) saturate(0);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: 0.08em;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.25s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text-bright); }
.nav-links a:hover::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 24px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text-mid);
  border-radius: 2px;
  cursor: none;
  text-decoration: none;
  transition: all 0.3s ease;
}
.nav-cta:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-bright);
  border-color: rgba(255,255,255,0.5);
}

/* ─── WEATHER BADGE ─── */
.weather-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(5,5,5,0.6);
  backdrop-filter: blur(8px);
  transition: border-color 0.4s, color 0.4s;
  cursor: default;
}
.weather-icon {
  font-size: 0.9rem;
  line-height: 1;
}
/* State variants applied by JS */
.weather-badge.state-rain   { border-color: rgba(130, 150, 160, 0.4); color: rgba(180,200,210,0.8); }
.weather-badge.state-clear  { border-color: rgba(122, 68, 25, 0.5);  color: rgba(200,170,110,0.8); }
.weather-badge.state-cloudy { border-color: rgba(80, 80, 80, 0.4);   color: rgba(160,155,145,0.8); }



/* ─── SECTION BASE ─── */
section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* ─── GLASS CARD — Noir style ─── */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.glass-card:hover {
  border-color: var(--border-mid);
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.025) 0%, transparent 60%);
  pointer-events: none;
}

/* ─── ACCENT LINE ─── */
.accent-line {
  display: block;
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.4);
  margin: 16px 0;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 32px;
  border-radius: 2px;
  cursor: none;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  z-index: -1;
}
.btn:hover::before { transform: scaleX(1); }
.btn-primary {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}
.btn-primary:hover { color: #000; box-shadow: 0 0 30px rgba(255,255,255,0.15); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-mid);
}
.btn-outline:hover { color: #000; border-color: #fff; }

/* ─── NUMBER BADGE ─── */
.num-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 8px;
}

/* ─── SECTION NUMBER ─── */
.section-num {
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 14rem);
  color: rgba(255, 255, 255, 0.025);
  position: absolute;
  top: 0;
  right: 0;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* ─── GLOW ORBS — desaturated ─── */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.08;
}
.glow-orb-red {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, transparent 70%);
}
.glow-orb-blue {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(180,190,210,0.4) 0%, transparent 70%);
}

/* ─── WEB CORNER ─── */
.web-corner {
  position: absolute;
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(1);
}

/* ─── SCROLL PROGRESS ─── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: rgba(255,255,255,0.5);
  z-index: 600;
  transition: width 0.1s linear;
}

/* ─── UTILITY ─── */
.split-line { overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 80px); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  
  nav#main-nav { 
    padding: 0 clamp(16px, 4vw, 24px); 
  }
  .nav-right { gap: 12px; }
  
  .weather-badge {
    padding: 4px 8px;
  }
  .weather-label {
    display: none;
  }
  
  .nav-cta {
    padding: 6px 14px;
    font-size: 0.65rem;
  }
}
