/* ==========================================================================
   OPUS-G2-CO1 — REFINED MONOCHROME & TYPOGRAPHIC PRECISION
   Typography: Instrument Serif (Display), Instrument Sans (Headings),
              Inter (Body), JetBrains Mono (Technical)
   Signature: Crosshair Grid, Neon Celestial Stars, Prismatic Scan Beam,
   Interactive Magnetic Orb, Telemetry Marquee & Kinetic Counters
   ========================================================================== */

:root {
  /* DARK MODE (DEFAULT): TRUE OBSIDIAN BLACK + CRISP WHITE & NEUTRAL GRAYS */
  --bg: #030304;
  --bg-subtle: #09090c;
  --bg-elevated: #101014;
  --bg-card: #131317;
  
  --text-main: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --border: #26262b;
  --border-subtle: #18181d;
  --border-card: #202026;
  
  --accent-white: #ffffff;
  --accent-black: #000000;
  --glow-color: rgba(255, 255, 255, 0.35);

  /* Blueprint Dot Grid */
  --grid-dot: rgba(255, 255, 255, 0.095);
  --spotlight-color: rgba(255, 255, 255, 0.06);

  /* Neon Star Palette */
  --neon-cyan: #00f5ff;
  --neon-violet: #c084fc;
  --neon-rose: #f472b6;
  
  /* Typography Stack */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --max-width: 1400px;
  --transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-theme: background-color 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                      color 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                      border-color 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* LIGHT MODE: PURE PRISTINE WHITE + JET BLACK & SLATE GRAYS */
[data-theme="light"] {
  --bg: #fafafc;
  --bg-subtle: #f2f2f6;
  --bg-elevated: #eaeaf0;
  --bg-card: #f0f0f5;
  
  --text-main: #000000;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-card: #e2e8f0;
  
  --accent-white: #000000;
  --accent-black: #ffffff;
  --glow-color: rgba(0, 0, 0, 0.2);

  --grid-dot: rgba(0, 0, 0, 0.075);
  --spotlight-color: rgba(0, 0, 0, 0.035);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  /* Architectural Dot Grid — Fixed so content floats above */
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition-theme);
  overflow-x: hidden;
  position: relative;
}

/* Smooth Theme Switching on all Interactive Containers (isolated from opacity/transforms) */
div, section, article, aside, button, a {
  transition: background-color 0.28s ease, border-color 0.28s ease, color 0.22s ease;
}

/* --- 1. PRISMATIC NEON SCAN BEAM (PAGE LOAD) --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--neon-cyan) 25%, 
    var(--neon-violet) 50%, 
    var(--neon-rose) 75%, 
    transparent 100%);
  z-index: 9999;
  pointer-events: none;
  animation: pageTopScanWipe 0.82s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="light"] body::before {
  background: linear-gradient(90deg, transparent 0%, var(--text-main) 50%, transparent 100%);
}

@keyframes pageTopScanWipe {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* --- 2. SMOOTH PAGE EXIT TRANSITION (ON LINK NAVIGATION) --- */
body.page-is-exiting .page-container {
  opacity: 0 !important;
  transform: translateY(-28px) scale(0.98) !important;
  filter: blur(6px) !important;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 1, 1),
              transform 0.22s cubic-bezier(0.4, 0, 1, 1),
              filter 0.22s cubic-bezier(0.4, 0, 1, 1) !important;
}

/* --- 3. PROMINENT MULTI-WAVE PAGE ENTRANCE ANIMATIONS --- */
.page-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 3.5rem 0;
  flex: 1;
}

/* Keyframes: Bold 48px upward ascension + depth scale + camera lens focus bloom */
@keyframes pageProminentEntrance {
  0% {
    opacity: 0;
    transform: translateY(48px) scale(0.975);
    filter: blur(8px);
  }
  65% {
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
  }
}

/* WAVE 1: Badges, Status Pills & Primary Titles (Starts at 0.02s) */
.hero-status-pill,
.page-intro .page-eyebrow,
.hero-main-name,
.page-intro .page-title {
  animation: pageProminentEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.02s both;
  will-change: transform, opacity, filter;
}

/* WAVE 2: Subtitles, Bio Paragraph, Action Dock, Filter & Ledger Controls (Starts at 0.14s) */
.hero-role-title,
.hero-bio-lead,
.page-intro .page-subtitle,
.hero-actions-dock,
.projects-filter-bar,
.genre-ledger-dock,
.thematic-quote-strip {
  animation: pageProminentEntrance 0.88s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
  will-change: transform, opacity, filter;
}

/* WAVE 3: Primary Decks, Matrix Sidebar & Section Titles (Starts at 0.24s) */
.hero-exec-matrix,
.column-section-title,
.portfolio-wide-split > div,
.contact-briefing-card,
.contact-channels-deck {
  animation: pageProminentEntrance 0.92s cubic-bezier(0.16, 1, 0.3, 1) 0.24s both;
  will-change: transform, opacity, filter;
}

/* WAVE 4: Staggered Child Cards Cascade (Starts at 0.30s in Waterfall Waves) */
.preview-card,
.project-full-card,
.article-dossier-card,
.research-dossier-card,
.exp-firm-block,
.skill-block,
.cert-vendor-card,
.academic-box,
.channel-card {
  animation: pageProminentEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity, filter;
}

/* Waterfall Delays for Grid Children */
.preview-card:nth-child(1),
.project-full-card:nth-child(1),
.article-dossier-card:nth-child(1),
.research-dossier-card:nth-child(1),
.exp-firm-block:nth-child(1),
.skill-block:nth-child(1),
.cert-vendor-card:nth-child(1),
.channel-card:nth-child(1) {
  animation-delay: 0.30s;
}

.preview-card:nth-child(2),
.project-full-card:nth-child(2),
.article-dossier-card:nth-child(2),
.research-dossier-card:nth-child(2),
.exp-firm-block:nth-child(2),
.skill-block:nth-child(2),
.cert-vendor-card:nth-child(2),
.channel-card:nth-child(2) {
  animation-delay: 0.40s;
}

.preview-card:nth-child(3),
.project-full-card:nth-child(3),
.article-dossier-card:nth-child(3),
.research-dossier-card:nth-child(3),
.exp-firm-block:nth-child(3),
.skill-block:nth-child(3),
.cert-vendor-card:nth-child(3),
.channel-card:nth-child(3) {
  animation-delay: 0.50s;
}

.preview-card:nth-child(4),
.project-full-card:nth-child(4),
.article-dossier-card:nth-child(4),
.research-dossier-card:nth-child(4),
.exp-firm-block:nth-child(4),
.skill-block:nth-child(4),
.cert-vendor-card:nth-child(4),
.channel-card:nth-child(4) {
  animation-delay: 0.60s;
}

.preview-card:nth-child(5),
.project-full-card:nth-child(5),
.article-dossier-card:nth-child(5),
.research-dossier-card:nth-child(5),
.exp-firm-block:nth-child(5),
.skill-block:nth-child(5),
.cert-vendor-card:nth-child(5) {
  animation-delay: 0.70s;
}

.preview-card:nth-child(6),
.project-full-card:nth-child(6),
.article-dossier-card:nth-child(6),
.research-dossier-card:nth-child(6),
.exp-firm-block:nth-child(6),
.skill-block:nth-child(6),
.cert-vendor-card:nth-child(6) {
  animation-delay: 0.80s;
}

/* Chrome Float-in for Top Floating Utilities & Navigation */
@keyframes chromeFloatIn {
  0% {
    opacity: 0;
    transform: translateY(-14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Top Subtle Utilities Dock (Theme & Resume) */
.top-utilities-dock {
  position: absolute;
  top: 1.75rem;
  right: 3.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  animation: chromeFloatIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.top-util-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), opacity var(--transition);
}

.top-util-link:hover {
  color: var(--text-main);
}

.btn-theme-minimal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color var(--transition), transform 0.18s ease;
}

.btn-theme-minimal:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn-theme-minimal:active {
  transform: scale(0.96);
}

/* PAGE INTRO BLOCK */
.page-intro {
  padding: 2rem 0 3.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 3.5rem;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title {
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 860px;
  line-height: 1.7;
}

/* Typography Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition), color var(--transition), transform var(--transition);
}

ul {
  list-style: none;
}

code, .mono {
  font-family: var(--font-mono);
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 4rem;
  margin-top: 6rem;
  width: 100%;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a:hover {
  color: var(--text-main);
}

/* ==========================================================================
   OPUS-G2-CO1 — ARTISANAL SIGNATURE INTERACTION STYLES
   ========================================================================== */

/* 1. AMBIENT MOUSE SPOTLIGHT (DESKTOP) */
.ambient-mouse-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(900px circle at var(--mouse-x, 50vw) var(--mouse-y, 50vh), var(--spotlight-color), transparent 70%);
  transition: opacity 0.5s ease;
  animation: spotlightBreathing 4s ease-in-out infinite;
}

@keyframes spotlightBreathing {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 2. CONTINUOUS KINETIC TELEMETRY TICKER */
.telemetry-ticker-bar {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
  margin: 3.5rem 0 2rem;
  background: rgba(10, 10, 14, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
}

[data-theme="light"] .telemetry-ticker-bar {
  background: rgba(244, 244, 248, 0.65);
}

.ticker-track {
  display: inline-flex;
  gap: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  animation: tickerContinuousScroll 38s linear infinite;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

/* Ticker Separator Dots — Subtle Signal Pulse */
.ticker-dot {
  color: var(--accent-white);
  opacity: 0.45;
  animation: tickerDotPulse 3s ease-in-out infinite;
}

.ticker-dot:nth-child(4n) { animation-delay: 0.75s; }
.ticker-dot:nth-child(4n+2) { animation-delay: 1.5s; }

@keyframes tickerDotPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

@keyframes tickerContinuousScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 3. PRECISION ARCHITECTURAL VIEWFINDER CORNER BRACKETS */
.corner-bracket {
  position: relative;
}

.corner-bracket::before,
.corner-bracket::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(255, 255, 255, 0.28);
  border-style: solid;
  pointer-events: none;
  transition: border-color 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

[data-theme="light"] .corner-bracket::before,
[data-theme="light"] .corner-bracket::after {
  border-color: rgba(0, 0, 0, 0.22);
}

.corner-bracket::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.corner-bracket::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.corner-bracket:hover::before {
  transform: translate(-3px, -3px);
  border-color: var(--accent-white);
}

.corner-bracket:hover::after {
  transform: translate(3px, 3px);
  border-color: var(--accent-white);
}

/* 4. CARD SURFACE REACTIVE GLOW */
.card-reactive-glow {
  position: relative;
  overflow: hidden;
}

.card-reactive-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(350px circle at var(--card-x, 50%) var(--card-y, 50%), rgba(255, 255, 255, 0.08), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

[data-theme="light"] .card-reactive-glow::before {
  background: radial-gradient(350px circle at var(--card-x, 50%) var(--card-y, 50%), rgba(0, 0, 0, 0.045), transparent 70%);
}

.card-reactive-glow:hover::before {
  opacity: 1;
}

/* 5. KINETIC COUNTER DIGIT FLIP */
.stat-counter-val {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

/* ==========================================================================
   6. CELESTIAL SHOOTING STAR STREAKS — NEON TINTED (SUBTLE NIGHT SKY)
   ========================================================================== */
.celestial-sky-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.shooting-star {
  position: absolute;
  height: 1px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transform-origin: left center;
  will-change: transform, opacity;
}

/* Star 1: Cool Cyan — Fast high streak from upper right */
.shooting-star.star-1 {
  top: 14%;
  right: 18%;
  width: 140px;
  background: linear-gradient(90deg, var(--neon-cyan) 0%, rgba(0, 245, 255, 0.3) 45%, transparent 100%);
  box-shadow: 0 0 6px rgba(0, 245, 255, 0.4);
  transform: rotate(-38deg);
  animation: meteorPass1 16s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: 2.2s;
}

/* Star 2: Soft Violet — Deep angled streak across center */
.shooting-star.star-2 {
  top: 26%;
  right: 48%;
  width: 160px;
  background: linear-gradient(90deg, var(--neon-violet) 0%, rgba(192, 132, 252, 0.25) 45%, transparent 100%);
  box-shadow: 0 0 6px rgba(192, 132, 252, 0.35);
  transform: rotate(-44deg);
  animation: meteorPass2 23s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: 8.5s;
}

/* Star 3: Warm Rose — Distant faint trajectory near upper boundary */
.shooting-star.star-3 {
  top: 7%;
  right: 70%;
  width: 110px;
  background: linear-gradient(90deg, var(--neon-rose) 0%, rgba(244, 114, 182, 0.2) 45%, transparent 100%);
  box-shadow: 0 0 5px rgba(244, 114, 182, 0.3);
  transform: rotate(-34deg);
  animation: meteorPass3 31s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: 14.7s;
}

/* Light Mode: Subtle graphite wisps */
[data-theme="light"] .shooting-star.star-1 {
  background: linear-gradient(90deg, rgba(100, 116, 139, 0.5) 0%, rgba(100, 116, 139, 0.15) 45%, transparent 100%);
  box-shadow: 0 0 3px rgba(100, 116, 139, 0.2);
}
[data-theme="light"] .shooting-star.star-2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.5) 0%, rgba(148, 163, 184, 0.15) 45%, transparent 100%);
  box-shadow: 0 0 3px rgba(148, 163, 184, 0.2);
}
[data-theme="light"] .shooting-star.star-3 {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.5) 0%, rgba(203, 213, 225, 0.12) 45%, transparent 100%);
  box-shadow: 0 0 3px rgba(203, 213, 225, 0.15);
}

@keyframes meteorPass1 {
  0% {
    opacity: 0;
    transform: rotate(-38deg) translateX(0) scaleX(0);
  }
  3% {
    opacity: 0.55;
    transform: rotate(-38deg) translateX(-40px) scaleX(1);
  }
  12% {
    opacity: 0.45;
    transform: rotate(-38deg) translateX(-280px) scaleX(1.3);
  }
  18% {
    opacity: 0;
    transform: rotate(-38deg) translateX(-440px) scaleX(0.2);
  }
  100% {
    opacity: 0;
    transform: rotate(-38deg) translateX(-440px) scaleX(0);
  }
}

@keyframes meteorPass2 {
  0% {
    opacity: 0;
    transform: rotate(-44deg) translateX(0) scaleX(0);
  }
  2.5% {
    opacity: 0.5;
    transform: rotate(-44deg) translateX(-50px) scaleX(1);
  }
  11% {
    opacity: 0.4;
    transform: rotate(-44deg) translateX(-320px) scaleX(1.4);
  }
  17% {
    opacity: 0;
    transform: rotate(-44deg) translateX(-500px) scaleX(0.15);
  }
  100% {
    opacity: 0;
    transform: rotate(-44deg) translateX(-500px) scaleX(0);
  }
}

@keyframes meteorPass3 {
  0% {
    opacity: 0;
    transform: rotate(-34deg) translateX(0) scaleX(0);
  }
  3% {
    opacity: 0.4;
    transform: rotate(-34deg) translateX(-30px) scaleX(1);
  }
  10% {
    opacity: 0.32;
    transform: rotate(-34deg) translateX(-220px) scaleX(1.2);
  }
  16% {
    opacity: 0;
    transform: rotate(-34deg) translateX(-360px) scaleX(0.1);
  }
  100% {
    opacity: 0;
    transform: rotate(-34deg) translateX(-360px) scaleX(0);
  }
}

/* ==========================================================================
   7. LIVE SIGNAL TELEMETRY EQUALIZER WAVE (HERO STATUS PILL)
   ========================================================================== */
.live-signal-wave {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 12px;
  margin-right: 0.25rem;
}

.wave-bar {
  width: 2px;
  background: var(--accent-white);
  border-radius: 1px;
  opacity: 0.85;
  animation: signalWavePulse 1.4s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { height: 4px; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 9px; animation-delay: 0.3s; }
.wave-bar:nth-child(3) { height: 6px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 11px; animation-delay: 0.4s; }

[data-theme="light"] .wave-bar {
  background: var(--accent-black);
}

@keyframes signalWavePulse {
  0% {
    transform: scaleY(0.4);
    opacity: 0.45;
  }
  100% {
    transform: scaleY(1.3);
    opacity: 1;
  }
}

/* ==========================================================================
   8. HOLOGRAPHIC BORDER BEAM — CYAN NEON TINT (EXECUTIVE MATRIX)
   ========================================================================== */
.hero-exec-matrix {
  position: relative;
}

.hero-exec-matrix::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 80px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: borderScanSweep 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
  opacity: 0.65;
}

[data-theme="light"] .hero-exec-matrix::before {
  background: linear-gradient(90deg, transparent, var(--accent-white), transparent);
  opacity: 0.5;
}

@keyframes borderScanSweep {
  0% {
    left: 0;
    opacity: 0;
  }
  20% {
    opacity: 0.65;
  }
  80% {
    opacity: 0.65;
  }
  100% {
    left: calc(100% - 80px);
    opacity: 0;
  }
}

/* ==========================================================================
   9. CYBERNETIC SCRAMBLE TEXT FLOP
   ========================================================================== */
.text-scramble-active {
  color: var(--text-main) !important;
  text-shadow: 0 0 8px var(--glow-color);
  transition: text-shadow 0.2s ease;
}
