/* ==========================================================================
   Hansraj D — Luxury Obsidian & Chrome Design System
   Inspired by Pinterest Luxury Dark UI Reference
   High-Contrast Monochrome, Mercury Chrome Highlights, Architectural Grid & Pill UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  /* ==========================================================================
     Dark Theme: "Obsidian & Chrome Astral" (Default - Pinterest Ref)
     Deepest Luxury Black, Pure Starlight White, Mercury Silver & Chrome Borders
     ========================================================================== */
  --bg-primary: #050507;
  --bg-secondary: #0c0c10;
  --bg-tertiary: #131318;
  --bg-elevated: #1a1a22;
  --bg-glass: rgba(10, 10, 14, 0.82);
  --bg-glass-card: rgba(16, 16, 22, 0.75);
  
  --text-primary: #ffffff;
  --text-secondary: #9a9aa2;
  --text-muted: #5e5e67;
  --text-inverse: #050507;

  /* Luxury Chrome Specular Accents */
  --accent-chrome: #ffffff;
  --accent-mercury: #e2e2e8;
  --accent-silver: #a0a0ab;
  --accent-primary: #ffffff;
  --accent-secondary: #e2e2e8;
  --accent-gradient: linear-gradient(135deg, #ffffff 0%, #d4d4dc 50%, #9e9ea8 100%);
  --accent-glow: rgba(255, 255, 255, 0.22);
  --accent-glow-subtle: rgba(255, 255, 255, 0.08);

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-medium: rgba(255, 255, 255, 0.22);
  --border-focus: #ffffff;

  --spotlight-color: rgba(255, 255, 255, 0.9);

  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.64s cubic-bezier(0.16, 1, 0.3, 1);

  --container-max: 1220px;
  --header-height: 72px;

  color-scheme: dark;
}

[data-theme="light"] {
  /* ==========================================================================
     Light Theme: "Luxury Editorial Gallery"
     Warm Ivory Paper with Deep Onyx and Brushed Platinum Accents
     ========================================================================== */
  --bg-primary: #fbfbfa;
  --bg-secondary: #f3f3f0;
  --bg-tertiary: #e8e8e4;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(251, 251, 250, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.92);

  --text-primary: #08080a;
  --text-secondary: #484850;
  --text-muted: #787882;
  --text-inverse: #ffffff;

  --accent-chrome: #08080a;
  --accent-mercury: #282830;
  --accent-silver: #60606a;
  --accent-primary: #08080a;
  --accent-secondary: #282830;
  --accent-gradient: linear-gradient(135deg, #08080a 0%, #303038 100%);
  --accent-glow: rgba(0, 0, 0, 0.12);
  --accent-glow-subtle: rgba(0, 0, 0, 0.05);

  --border-subtle: #e5e5e0;
  --border-medium: #c8c8c0;
  --border-focus: #08080a;

  --spotlight-color: rgba(8, 8, 10, 0.5);

  color-scheme: light;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  /* Architectural luxury perspective grid matching reference */
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  background-size: 72px 72px, 72px 72px, 100% 100%;
  background-position: center top;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

[data-theme="light"] body {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 25%, rgba(0, 0, 0, 0.02) 0%, transparent 70%);
}

/* Subtle Film Grain */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  opacity: 0.03;
  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");
  background-repeat: repeat;
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  z-index: 1000;
  transition: width 0.08s ease-out;
}

[data-theme="light"] #scroll-progress {
  background: #08080a;
  box-shadow: 0 0 10px rgba(8, 8, 10, 0.4);
}

/* Typography Utilities */
.mono {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mono-accent {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent-chrome);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

/* Section Common Container */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

section {
  position: relative;
  padding: clamp(60px, 8vh, 88px) 0;
  min-height: auto;
}

/* Luxury Pill Section Tag */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.section-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: 0 0 6px var(--text-primary);
}

.section-title {
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  letter-spacing: -0.04em;
  margin-bottom: 32px;
  text-transform: uppercase;
  max-width: 18ch;
}

/* Reveal on Scroll Elements */
.reveal-init {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-init.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   CHROME HUD RETICLE CURSOR (Desktop fine pointer only)
   ========================================================================== */
#cyber-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100000;
  display: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  will-change: transform;
}

/* Precision Crosshair Center */
.cursor-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background-color: var(--text-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--text-primary);
  transition: transform 0.15s ease, background-color 0.2s;
}

.cursor-crosshair::before,
.cursor-crosshair::after {
  content: "";
  position: absolute;
  background-color: var(--text-primary);
  opacity: 0.55;
}

.cursor-crosshair::before {
  top: -8px;
  left: 2px;
  width: 1px;
  height: 20px;
}

.cursor-crosshair::after {
  top: 2px;
  left: -8px;
  width: 20px;
  height: 1px;
}

/* Orbital Rotating Ring */
.cursor-ring-orbital {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: cursor-spin 14s linear infinite;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}

[data-theme="light"] .cursor-ring-orbital {
  border-color: rgba(0, 0, 0, 0.35);
}

@keyframes cursor-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Corner Cyber Brackets */
.cursor-brackets {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cursor-brackets span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-color: var(--text-primary);
  border-style: solid;
  transition: border-color 0.2s;
}

.bracket-tl { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.bracket-tr { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }
.bracket-bl { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }
.bracket-br { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

/* Real-Time Telemetry HUD Label */
.cursor-telemetry {
  position: absolute;
  left: 26px;
  top: -22px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
  background: var(--bg-glass);
  padding: 1px 6px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
}

/* Hover Contextual Action Badge */
.cursor-badge {
  position: absolute;
  left: 26px;
  top: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-inverse);
  background: var(--text-primary);
  padding: 3px 10px;
  border-radius: 99px;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hover Lock-On State */
#cyber-cursor.hovering-target .cursor-ring-orbital {
  width: 54px;
  height: 54px;
  border-color: var(--text-primary);
  border-style: solid;
}

#cyber-cursor.hovering-target .cursor-brackets {
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%) rotate(45deg);
}

#cyber-cursor.hovering-target .cursor-badge {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
  a, button, input, textarea, select {
    cursor: none;
  }
  #cyber-cursor {
    display: block;
  }
}

/* Luxury Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  border-radius: 99px;
  backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  transform: translateY(101%);
  transition: transform var(--transition-normal);
  z-index: 0;
}

.btn span {
  position: relative;
  z-index: 1;
  transition: color var(--transition-normal);
}

.btn:hover {
  border-color: #ffffff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn:hover::before {
  transform: translateY(0);
}

.btn:hover span {
  color: #050507;
  font-weight: 600;
}

.btn-primary {
  background: #ffffff;
  color: #050507;
  border-color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25);
}

.btn-primary::before {
  background: var(--bg-primary);
}

.btn-primary span {
  color: #050507;
}

.btn-primary:hover span {
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Badges & Tags */
.tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-radius: 99px;
  transition: all var(--transition-fast);
}

.tech-tag:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* Reduced Motion Mode */
@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;
  }
  .reveal-init {
    opacity: 1 !important;
    transform: none !important;
  }
  .cursor-ring-orbital {
    animation: none !important;
  }
}
