/* =============================================
   ROOT TOKENS — Cinematic Dark Warm Palette
   ============================================= */
:root {
  --clr-bg:           #0d0804;
  --clr-text:         #f0e6d3;
  --clr-text-sub:     #d4c4a8;
  --clr-muted:        #a08868;
  --clr-dim:          #705840;
  --clr-gold:         #D4AF37;
  --clr-gold-light:   #F5D160;
  --clr-gold-dim:     rgba(212,175,55,0.18);
  --clr-amber:        #c87941;
  --clr-surface:      rgba(255,255,255,0.04);
  --clr-surface-h:    rgba(255,255,255,0.07);
  --clr-border:       rgba(212,175,55,0.14);
  --clr-border-h:     rgba(212,175,55,0.30);
  --shadow-sm:        0 2px 12px rgba(0,0,0,0.5);
  --shadow-md:        0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg:        0 20px 60px rgba(0,0,0,0.7);
  --shadow-gold:      0 0 30px rgba(212,175,55,0.12);
  --gradient-gold:    linear-gradient(135deg,#D4AF37,#F5D160);
  --font-sans:        'Inter',sans-serif;
  --font-display:     'Playfair Display',serif;
  --nav-h:            70px;
  --radius:           16px;
  --radius-sm:        10px;
  --transition:       0.35s cubic-bezier(0.4,0,0.2,1);
}



/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  overflow-x: hidden;
  line-height: 1.7;
  min-height: 100vh;
}

/* Re-enable default cursor — User request */
body.torch-mode {
  cursor: auto; 
}
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =============================================
   WALL TEXTURE BACKGROUND
   ============================================= */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    /* subtle horizontal brick mortar lines */
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.55) 0px, rgba(0,0,0,0.55) 2px,
      transparent 2px, transparent 52px
    ),
    /* brick column lines row-A */
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.45) 0px, rgba(0,0,0,0.45) 2px,
      transparent 2px, transparent 120px
    ),
    /* offset brick columns row-B (shifted 60px) */
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 60px,
      rgba(0,0,0,0.35) 60px, rgba(0,0,0,0.35) 62px,
      transparent 62px, transparent 180px
    ),
    /* base wall colour — dark warm brick brown */
    radial-gradient(ellipse at 50% 0%, #221408 0%, #150c05 60%, #0d0804 100%);
  background-size: auto 52px, 120px auto, 180px auto, cover;
  pointer-events: none;
}

/* Optional: use the generated wall image as a subtle overlay if available */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('wall.png') center/cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Film grain SVG filter (global) */
.grain-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* =============================================
   INTRO OVERLAY
   ============================================= */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1.1s ease, backdrop-filter 0.8s ease;
}

#intro-overlay.fading {
  opacity: 0;
  pointer-events: none;
}

#intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.intro-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.55);
  animation: gentlePulse 3s ease-in-out infinite;
}

#light-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #f5e8c0;
  letter-spacing: 0.03em;
  padding: 0.6rem 1.2rem;
  text-shadow:
    0 0 20px rgba(245,220,80,0.8),
    0 0 60px rgba(245,190,60,0.5),
    0 0 120px rgba(220,160,40,0.3);
  animation: btnPulse 2.8s ease-in-out infinite;
  transition: opacity 0.6s ease, transform 0.3s ease;
  outline: none;
}

#light-btn:hover {
  transform: scale(1.04);
  text-shadow:
    0 0 30px rgba(245,220,80,1),
    0 0 80px rgba(245,190,60,0.7),
    0 0 150px rgba(220,160,40,0.4);
}

.btn-glow-ring {
  position: absolute;
  inset: -12px;
  border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.15);
  animation: ringPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

.intro-hint {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  transition: opacity 0.5s ease;
}

/* =============================================
   TORCH CURSOR (The Physical Object)
   Appended to body by JS — position is updated inline
   ============================================= */
#torch-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 24px;
  height: 50px;
  z-index: 2010;
  pointer-events: none;
  transform-origin: top center;
  display: none;
  filter: drop-shadow(0 0 8px rgba(255,210,100,0.7));
  will-change: transform;
}

#torch-cursor.active {
  display: block;
}

.torch-body {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 32px;
  background: linear-gradient(to right, #111, #282828, #0e0e0e);
  border-radius: 1px 1px 4px 4px;
  border: 1px solid #000;
}

/* Metallic grip ridges */
.torch-body::after {
  content: '';
  position: absolute;
  top: 10px; left: 0; right: 0; bottom: 10px;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 2px,
    rgba(255,255,255,0.05) 2px, rgba(255,255,255,0.05) 4px
  );
}



/* =============================================
   TORCH CURSOR (The Physical Object)
   ============================================= */

.torch-lens {
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: #fff9e6;
  box-shadow:
    0 0 12px 3px rgba(255, 249, 230, 0.95),
    0 0 24px 8px rgba(212, 175, 55, 0.5);
  animation: torchFlicker 3s ease-in-out infinite;
}

@keyframes torchFlicker {
  0%, 100% { opacity: 0.9; transform: scaleX(1); }
  50%       { opacity: 1;   transform: scaleX(1.1); }
}

/* Re-enable cursor for standard interactions if needed, but for now we keep it cinematic */
button, a {
  cursor: pointer;
}

/* =============================================
   TORCHLIGHT SPOTLIGHT
   The background is updated inline by JS every frame
   ============================================= */
#torch-overlay {
  position: fixed;
  inset: 0;
  z-index: 2004;
  pointer-events: none;
  background: rgba(0,0,0,1); /* full dark backdrop */
  opacity: 0;
  /* Mask reveals the CONTENT beneath it — using --x and --y from JS */
  -webkit-mask-image: radial-gradient(circle 320px at var(--x, 50%) var(--y, 50%), transparent 0%, black 80%);
  mask-image: radial-gradient(circle 320px at var(--x, 50%) var(--y, 50%), transparent 0%, black 80%);
}

#torch-overlay.active {
  opacity: 1;
  /* Background is set dynamically by JS for real-time spotlight */
}

/* Warm glow layer — also updated inline by JS */
#torch-highlight {
  position: fixed;
  inset: 0;
  z-index: 2007; /* above switch (2005) for warm glow overlay */
  pointer-events: none;
  background: transparent;
  mix-blend-mode: screen;
  opacity: 1;
}

/* =============================================
   SWITCH MINI-GAME
   ============================================= */
#switch-game-container {
  position: fixed;
  inset: 0;
  z-index: 2005; /* Must be above torch overlay (2004) so switch is clickable */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}
#switch-game-container.active {
  opacity: 1;
  pointer-events: auto;
}

#game-hint {
  position: absolute;
  top: 20%;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  letter-spacing: 0.15em;
  color: #fffaf0;
  text-shadow: 0 0 10px rgba(255, 230, 160, 0.6), 0 0 20px rgba(255, 200, 100, 0.3);
  text-transform: lowercase;
  pointer-events: none;
  animation: fadePulse 3s ease-in-out infinite;
}

#switch-board {
  position: absolute;
  width: 90px; /* Increased from 70px */
  height: 140px; /* Increased from 110px */
  background: linear-gradient(135deg, #2a2a2a, #111);
  border: 1px solid rgba(212, 175, 55, 0.4); /* Royal Golden border */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 
    0 15px 35px rgba(0,0,0,0.8),
    0 0 15px rgba(212, 175, 55, 0.15),
    inset 0 1px 1px rgba(255,255,255,0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  opacity: 0.15; /* Slightly more visible for easier identification */
  transform: scale(1);
}

#switch-board:hover {
  opacity: 0.8;
  border-color: #F5D160;
  box-shadow: 
    0 0 40px rgba(245, 209, 96, 0.5),
    0 20px 50px rgba(0,0,0,0.6);
  transform: scale(1.1);
}

#switch-board.found {
  opacity: 0.9;
  border-color: #D4AF37;
  box-shadow: 
    0 0 30px rgba(212, 175, 55, 0.4),
    0 0 60px rgba(212, 175, 55, 0.2);
  transform: scale(1);
}

.switch-plate {
  width: 44px;
  height: 84px;
  background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
  border: 1px solid #111;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
  position: relative;
}

.screw {
  width: 4px;
  height: 4px;
  background: #333;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
}

.status-light {
  width: 4px;
  height: 4px;
  background: #400; /* Dim red initially */
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 0 2px rgba(255,0,0,0.2);
  transition: background 0.3s ease;
}
#switch-board.found .status-light {
  background: #f00;
  box-shadow: 0 0 6px 1px rgba(255,0,0,0.6);
}
#switch-board.on .status-light {
  background: #0f0;
  box-shadow: 0 0 6px 1px rgba(0,255,0,0.8);
}

.switch-toggle {
  width: 18px;
  height: 36px;
  background: linear-gradient(to bottom, #555, #222);
  border-radius: 3px;
  box-shadow: 0 3px 8px rgba(0,0,0,1);
  transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  border: 1px solid #111;
}
#switch-board.on .switch-toggle {
  transform: translateY(12px);
  background: linear-gradient(to bottom, #D4AF37, #8a6d10);
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}

/* =============================================
   LAMPS (RESTORED)
   ============================================= */
#lamps-container {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.lamp-pivot {
  position: absolute;
  top: 0;
  transform-origin: 50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}
#lamp-pivot-left  { left: 1%; }
#lamp-pivot-right { right: 1%; }

.lamp { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  position: relative; 
  transform: scale(0.6); 
  transform-origin: top center; 
}

.lamp-cord {
  width: 2px; height: 80px;
  background: linear-gradient(to bottom, #2a1a0a, #4a2d14);
}

.lamp-housing { display: flex; flex-direction: column; align-items: center; position: relative; }
.lamp-cap { width: 34px; height: 10px; background: #2a1a0a; border-radius: 4px 4px 0 0; }
.lamp-shade {
  width: 100px; height: 64px;
  background: linear-gradient(160deg, #3a1f08 0%, #0d0804 100%);
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  border-bottom: 2px solid #5a3a1a;
}
.lamp-bulb {
  position: absolute; top: -48px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 20px;
  background: radial-gradient(circle, #fffce0, #f5c842 60%);
  border-radius: 50%; opacity: 0; transition: opacity 0.2s ease;
}
.lamp-bulb.on { opacity: 1; box-shadow: 0 0 20px 8px rgba(245,200,80,0.6); }

.lamp-cone {
  position: absolute; top: 180px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 600px;
  clip-path: polygon(36% 0%, 64% 0%, 100% 100%, 0% 100%);
  background: radial-gradient(ellipse at 50% 0%, rgba(255,200,80,0.1) 0%, transparent 75%);
  opacity: 0; transition: opacity 1.2s ease;
}
.lamp-cone.on { opacity: 1; }

.lamp-halo {
  position: absolute; top: 110px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,180,60,0.2) 0%, transparent 70%);
  opacity: 0; transition: opacity 1.2s ease;
}
.lamp-halo.on { opacity: 1; }
#ambient-glow {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.2s ease;
  background:
    radial-gradient(ellipse at 22% 0%, rgba(245,180,60,0.22) 0%, transparent 42%),
    radial-gradient(ellipse at 78% 0%, rgba(245,180,60,0.22) 0%, transparent 42%),
    radial-gradient(ellipse at 50% 0%, rgba(200,121,65,0.08) 0%, transparent 60%);
}
#ambient-glow.visible { opacity: 1; }

/* =============================================
   DUST CANVAS
   ============================================= */
#dustCanvas {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* =============================================
   PORTFOLIO WRAP — hidden until lights on
   ============================================= */
#portfolio-wrap {
  position: relative;
  z-index: 10;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.2s ease;
  filter: blur(10px);
  pointer-events: none;
}
#portfolio-wrap.search-mode {
  opacity: 1 !important;
  transform: scale(1);
  filter: none !important;
  pointer-events: none;
}
#portfolio-wrap.revealed {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  pointer-events: auto;
}

/* =============================================
   NAVIGATION
   ============================================= */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 500;
  transition: background var(--transition), box-shadow var(--transition);
}
#navbar.scrolled {
  background: rgba(13,8,4,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(212,175,55,0.15);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.5px;
}
.nav-logo .dot { color: var(--clr-gold); }

.nav-links { display: flex; gap: 2.5rem; }

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--clr-muted);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 3px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--gradient-gold);
  border-radius: 2px;
  transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--clr-gold-light); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Lights toggle & Theme toggle button */
.lights-toggle, .theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--clr-gold-dim);
  border: 1px solid var(--clr-border);
  color: var(--clr-gold-light);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Initially hide theme toggle to keep cinematic darkness immersion */
.theme-toggle {
  display: none !important;
}

/* Show theme toggle only after lights are revealed */
#portfolio-wrap.revealed .theme-toggle {
  display: flex !important;
}

.lights-toggle:hover, .theme-toggle:hover {
  background: rgba(212,175,55,0.28);
  border-color: var(--clr-border-h);
  transform: translateY(-1px);
}

/* Light Mode Overrides for Theme Toggle */
body.light-theme .theme-toggle,
body.light-mode .theme-toggle {
  background: rgba(139, 101, 8, 0.1) !important;
  border-color: rgba(139, 101, 8, 0.2) !important;
  color: #8B6508 !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--clr-muted);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(13,8,4,0.96);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem;
  gap: 1rem;
  z-index: 490;
  border-bottom: 1px solid var(--clr-border);
  transform: translateY(-110%);
  transition: transform var(--transition);
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
}
.mobile-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--clr-text-sub);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--clr-border);
}

/* =============================================
   SECTION SHARED STYLES
   ============================================= */
section {
  padding: 6rem 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: 0.75rem;
  opacity: 0.8;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 3rem;
  line-height: 1.2;
}

/* =============================================
   HERO
   ============================================= */
#hero {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}
.hero-content { flex: 1; max-width: 620px; }

.hero-badge {
  display: inline-block;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 50px;
  padding: 0.4rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-gold-light);
  margin-bottom: 1.5rem;
  animation: fadeSlideIn 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--clr-text);
  margin-bottom: 1rem;
  animation: fadeSlideIn 0.7s 0.1s ease both;
}

.highlight {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--clr-muted);
  margin-bottom: 1rem;
  animation: fadeSlideIn 0.7s 0.2s ease both;
}
.brand { color: var(--clr-gold-light); font-weight: 600; }

.hero-desc {
  font-size: 1rem;
  color: var(--clr-muted);
  margin-bottom: 2.5rem;
  line-height: 1.82;
  animation: fadeSlideIn 0.7s 0.3s ease both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeSlideIn 0.7s 0.4s ease both;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-size: 0.90rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font-sans);
}
.btn-primary {
  background: var(--gradient-gold);
  color: #1a0d04;
  box-shadow: 0 4px 20px rgba(212,175,55,0.30);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212,175,55,0.45);
}
.btn-outline {
  background: transparent;
  color: var(--clr-gold-light);
  border: 1.5px solid rgba(212,175,55,0.30);
}
.btn-outline:hover {
  background: rgba(212,175,55,0.08);
  border-color: rgba(212,175,55,0.55);
  transform: translateY(-2px);
}

.hero-socials {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  animation: fadeSlideIn 0.7s 0.5s ease both;
}

.social-bubble {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--clr-border);
  border-radius: 50%;
  color: var(--clr-gold);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              background 0.3s ease, 
              border-color 0.3s ease, 
              box-shadow 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.social-bubble svg {
  transition: transform 0.4s ease, stroke 0.3s ease;
}

.social-bubble:hover {
  transform: scale(1.25) translateY(-5px);
  background: var(--clr-surface-h);
  border-color: var(--clr-gold-light);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.25);
  color: var(--clr-gold-light);
}

.social-bubble:hover svg {
  transform: scale(1.1);
}

.hero-scroll-hint {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem; /* Reduced from 3rem */
  color: var(--clr-dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeSlideIn 0.7s 0.7s ease both;
}
.scroll-line {
  width: 40px; height: 1px;
  background: linear-gradient(90deg, var(--clr-gold), transparent);
  animation: scrollPulse 2s infinite;
}

/* Hero Visual */
.hero-visual {
  flex: 0 0 auto;
  position: relative;
  animation: fadeSlideIn 0.8s 0.3s ease both;
}
.avatar-ring {
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(212,175,55,0.15), rgba(200,121,65,0.08), transparent 70%);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 12px rgba(212,175,55,0.04),
    0 0 0 24px rgba(200,121,65,0.025),
    var(--shadow-lg);
  animation: breathe 4s ease-in-out infinite;
}
.avatar-inner {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212,175,55,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}
.floating-tag {
  position: absolute;
  background: rgba(20,12,5,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--clr-border);
  border-radius: 50px;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clr-text-sub);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.tag-1 { top: 10%;   right: -24px; animation: floatTag 3.5s ease-in-out infinite; }
.tag-2 { bottom: 18%;right: -34px; animation: floatTag 4s   ease-in-out infinite 0.5s; }
.tag-3 { bottom:-10%;left: 0;      animation: floatTag 3.8s ease-in-out infinite 1s; }

/* =============================================
   ABOUT
   ============================================= */
#about { background: transparent; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.about-text p {
  color: var(--clr-text-sub);
  margin-bottom: 1.2rem;
  font-size: 1.02rem;
  line-height: 1.88;
}
.about-text strong { color: var(--clr-text); }

.about-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--clr-border);
}
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--clr-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.info-card {
  background: var(--clr-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md), var(--shadow-gold);
}
.info-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--clr-border);
}
.info-row:last-child { border-bottom: none; }
.info-icon { font-size: 1.3rem; flex-shrink: 0; }
.info-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--clr-dim);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.2rem;
}
.info-value {
  display: block;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--clr-text);
}

/* =============================================
   PROJECTS
   ============================================= */
#projects { background: transparent; }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1.5rem;
}
.project-card {
  background: var(--clr-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  border-color: var(--clr-border-h);
  background: var(--clr-surface-h);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}
.project-icon { font-size: 2rem; }
.project-badge {
  background: rgba(212,175,55,0.12);
  color: var(--clr-gold-light);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: 1px solid rgba(212,175,55,0.2);
}
.project-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.project-desc {
  font-size: 0.88rem;
  color: var(--clr-muted);
  line-height: 1.78;
  margin-bottom: 1.5rem;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  background: rgba(212,175,55,0.08);
  color: var(--clr-gold);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem;
  border-radius: 50px;
  border: 1px solid rgba(212,175,55,0.16);
}

/* =============================================
   SKILLS
   ============================================= */
#skills { background: transparent; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1.5rem;
}
.skill-card {
  perspective: 1200px;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  height: 240px;
}

.skill-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.skill-card.flipped .skill-card-inner {
  transform: rotateY(180deg);
}

.skill-card-front,
.skill-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.3); /* Subtle golden border */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background: rgba(13, 8, 4, 0.95) !important; /* Royal Faded Black */
  backdrop-filter: blur(20px);
  transition: all var(--transition);
  color: #F5D160 !important; /* Golden Royal Text base */
}

.skill-card-back {
  transform: rotateY(180deg);
  background: rgba(10, 6, 2, 0.98) !important; /* Slightly deeper back for contrast */
  align-items: flex-start;
  text-align: left;
}

.skill-card:hover .skill-card-front,
.skill-card:hover .skill-card-back {
  border-color: #F5D160;
  box-shadow: 0 20px 45px rgba(212, 175, 55, 0.3);
}

.skill-card-front .flip-hint {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-gold);
  margin-top: 12px;
  font-weight: 700;
  opacity: 0.8;
}

.skill-name-front {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #F5D160 !important;
  margin: 0;
}

.skill-card.skill-learning .skill-card-front,
.skill-card.skill-learning .skill-card-back {
  background: rgba(18, 12, 6, 0.95) !important;
  border-color: rgba(212, 175, 55, 0.45);
}
.skill-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #F5D160 !important;
  margin-bottom: 0.5rem;
}
.skill-desc {
  font-size: 0.86rem;
  color: rgba(212, 175, 55, 0.8) !important;
  line-height: 1.65;
  margin-bottom: 1rem;
}
.skill-bar {
  width: 100%;
  height: 5px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.1);
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8B6508, #D4AF37, #F5D160);
  border-radius: 50px;
  transition: width 1.3s cubic-bezier(0.4,0,0.2,1);
}
.skill-card.in-view .skill-fill { width: var(--fill); }

/* =============================================
   CONTACT SECTION 2.0
   ============================================= */
#contact { background: transparent; }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.contact-subtitle {
  font-size: 1.02rem;
  color: var(--clr-muted);
  max-width: 500px;
  margin-bottom: 2.5rem;
  line-height: 1.82;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--clr-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.contact-card:hover {
  transform: translateX(10px);
  border-color: var(--clr-border-h);
  box-shadow: var(--shadow-md), var(--shadow-gold);
}

.contact-icon { font-size: 1.8rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.brand-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--clr-gold);
  transition: transform 0.3s ease;
}
.contact-card:hover .brand-icon svg {
  transform: scale(1.1);
  stroke: var(--clr-gold-light);
}
.contact-info-text { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.contact-label { font-size: 0.72rem; font-weight: 600; color: var(--clr-dim); text-transform: uppercase; letter-spacing: 0.09em; }
.contact-value { font-size: 0.93rem; font-weight: 600; color: var(--clr-text); }
.contact-arrow { font-size: 1.2rem; color: var(--clr-gold); transition: transform var(--transition); }
.contact-card:hover .contact-arrow { transform: translateX(6px); }

.contact-note {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(212,175,55,0.07);
  border: 1px solid rgba(212,175,55,0.18);
  color: var(--clr-gold);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  width: fit-content;
}

/* Playful Heading */
.playful-heading {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--clr-gold-light);
  margin-bottom: 2.5rem;
  position: relative;
  font-style: italic;
}

/* Form Styling */
.contact-form-container {
  padding-left: 2rem;
  border-left: 1px solid var(--clr-border);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--clr-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.textarea-icon {
  top: 1.2rem;
  transform: none;
}

.form-input {
  width: 100%;
  padding: 1rem 1.2rem 1rem 3rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  background: var(--clr-surface-h);
  border-color: var(--clr-gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-input:focus + .input-icon {
  opacity: 1;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  margin-top: 1rem;
  justify-content: center;
  position: relative;
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

.submit-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.submit-btn.loading .btn-text {
  opacity: 0;
}

.btn-loader {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-loader {
  opacity: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-status {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
  min-height: 1.4rem;
}

.form-status.success { color: #4CAF50; }
.form-status.error { color: #f44336; }

/* =============================================
   FOOTER
   ============================================= */
footer {
  border-top: 1px solid var(--clr-border);
  padding: 2rem;
  background: rgba(13,8,4,0.6);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--clr-dim);
}
.footer-inner strong { color: var(--clr-text-sub); }
.footer-year { font-weight: 600; }

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatTag {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%       { transform: translateY(-8px) rotate(1deg); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.035); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleX(1); }
  50%       { opacity: 1;   transform: scaleX(1.3); }
}
@keyframes btnPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(245,220,80,0.8), 0 0 60px rgba(245,190,60,0.5), 0 0 120px rgba(220,160,40,0.3); }
  50%       { text-shadow: 0 0 30px rgba(245,220,80,1.0), 0 0 90px rgba(245,190,60,0.7), 0 0 160px rgba(220,160,40,0.4); }
}
@keyframes gentlePulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 0.85; }
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1);    opacity: 0.3; }
  50%       { transform: scale(1.06); opacity: 0.7; }
}
@keyframes lampFlicker {
  0%   { opacity: 0; }
  8%   { opacity: 0.9; }
  12%  { opacity: 0.1; }
  18%  { opacity: 1; }
  22%  { opacity: 0.3; }
  28%  { opacity: 0.95; }
  34%  { opacity: 0.15; }
  40%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes fadePulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; transform: scale(1.02); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  #hero { gap: 2rem; }
  .avatar-ring { width: 380px !important; height: 380px !important; }
}

@media (max-width: 900px) {
  #hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 3rem;
    padding-top: calc(var(--nav-h) + 4rem);
    justify-content: flex-start;
  }
  .hero-content { max-width: 100%; order: 2; }
  .hero-visual { order: 1; transform: scale(0.9); }
  .hero-cta { justify-content: center; }
  .hero-socials { justify-content: center; }
  .hero-scroll-hint { justify-content: center; display: none; }
  
  .about-grid { grid-template-columns: 1fr; gap: 4rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  
  .section-inner { padding: 0 1.5rem; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  
  #hero { padding-top: calc(var(--nav-h) + 2rem); }
  .hero-title { font-size: 2.5rem; }
  .avatar-ring { width: 320px !important; height: 320px !important; }
  
  .contact-layout { grid-template-columns: 1fr; }
  .lamp-cone { width: 180px; height: 280px; }
  .lamp-halo { width: 120px; height: 120px; }
  #torch-cursor { transform: scale(0.85); transform-origin: top center; }
  .mobile-link { border-bottom: 1px solid rgba(255,255,255,0.05); }
}


@media (max-width: 480px) {
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; text-align: center; }
  
  .avatar-ring { width: 260px !important; height: 260px !important; }
  .skills-grid { grid-template-columns: 1fr; }
  
  .lights-toggle span:not(:first-child), 
  .theme-toggle .theme-text { display: none; }
  .lights-toggle, .theme-toggle { padding: 0.5rem 0.8rem; }
  
  .marquee-text { font-size: 0.9rem; padding-right: 30px; }
  .gallery-container { height: 400px !important; }
  
  .project-media { height: 180px !important; }
  .section-title { font-size: 1.8rem; margin-bottom: 2rem; }
  section { padding: 4rem 1.2rem; }
}



/* =============================================
   LIGHT THEME OVERRIDES (PLACED HERE TO ENSURE CSS CASCADING OVERRIDES)
   ============================================= */
body.light-theme {
  --clr-bg:           #F7F7F7;
  --clr-text:         #1c1c24; /* deep bluish-grey, sharp high-key text */
  --clr-text-sub:     #4c4c5a;
  --clr-muted:        #7a7a8c;
  --clr-dim:          #a0a0b2;
  --clr-surface:      rgba(255, 255, 255, 0.45); /* glassy, airy surface */
  --clr-surface-h:    rgba(255, 255, 255, 0.85);
  --clr-border:       rgba(239, 238, 245, 0.8);
  --clr-border-h:     rgba(255, 255, 255, 1);
  /* deep highly diffused ambient occlusion shadows in a subtle lavender-grey tint */
  --shadow-sm:        0 8px 24px rgba(180, 178, 196, 0.15);
  --shadow-md:        0 24px 48px rgba(150, 148, 170, 0.2);
  --shadow-lg:        0 40px 80px rgba(130, 128, 150, 0.25);
  --shadow-gold:      0 12px 36px rgba(180, 178, 196, 0.3);
  background: var(--clr-bg) !important;
  color: var(--clr-text);
  transition: background 0.8s ease, color 0.8s ease;
}

body.light-theme::before {
  content: '';
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: 
    radial-gradient(circle at 15% 15%, #ffffff 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, #EFEEF5 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, #F7F7F7 0%, #EFEEF5 100%) !important;
  opacity: 1 !important;
  pointer-events: none;
}

body.light-theme::after {
  content: '';
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 1; /* just above the gradient, below everything else */
  /* Gobo lighting effect: soft sunlight streaming through a window pane */
  background: 
    linear-gradient(25deg, 
      transparent 20%, 
      rgba(255, 255, 255, 0.5) 25%, 
      rgba(255, 255, 255, 0.8) 35%, 
      transparent 38%, 
      transparent 42%, 
      rgba(255, 255, 255, 0.7) 46%, 
      transparent 55%) !important;
  filter: blur(12px) !important;
  mix-blend-mode: hard-light !important;
  opacity: 0.9 !important;
  pointer-events: none;
}

body.light-theme .grain-layer {
  opacity: 0.02 !important;
}

body.light-theme #navbar.scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
}

body.light-theme .mobile-menu {
  background: rgba(255, 255, 255, 0.98) !important;
}

body.light-theme footer {
  background: rgba(250, 250, 250, 0.9) !important;
}
