/* ==========================================================================
   OBSIDIAN ATELIER — DESIGN SYSTEM & TOKENS
   Awwwards-Grade Luxury Digital Portfolio System for Yogesh Maurya
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@700,800,900,500,400&display=swap');

:root {
  /* Surfaces & Layered Elevation (Anti-OLED-Smear) */
  --surface-canvas: #070708;
  --surface-raised: #0F0F12;
  --surface-overlay: #17171C;
  --surface-subtle: #22222A;
  --surface-hover: #2A2A34;

  /* Typography Colors (Anti-Halation Balanced) */
  --text-primary: #F4F4F6;
  --text-secondary: #9E9EA8;
  --text-tertiary: #5E5E6A;
  --text-muted: #42424C;

  /* Luxury Accents */
  --accent-gold: #E6C687;
  --accent-gold-glow: rgba(230, 198, 135, 0.15);
  --accent-blue: #3E7BFA;
  --accent-emerald: #10B981;
  --accent-violet: #8B5CF6;

  /* Translucent Borders & Specular Glass */
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(230, 198, 135, 0.4);
  --glass-bg: rgba(15, 15, 18, 0.75);
  --glass-blur: blur(16px);

  /* Fonts */
  --font-display: 'Satoshi', -apple-system, sans-serif;
  --font-editorial: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Easing & Motion Tokens */
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-cinematic: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-micro: 200ms;
  --duration-layout: 450ms;
}

/* ==========================================================================
   GLOBAL RESET & SEED STYLES
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--surface-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto; /* Managed by Lenis */
  overflow-x: hidden;
}

/* Lenis Smooth Scroll Recommended Engine Standards */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  background-color: var(--surface-canvas);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Custom Selection */
::selection {
  background: var(--accent-gold);
  color: #070708;
}

/* ==========================================================================
   NOISE TEXTURE OVERLAY
   ========================================================================== */

.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  content: "";
  opacity: 0.035;
  pointer-events: none;
  z-index: 999;
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   CUSTOM CURSOR (Desktop pointer-fine only)
   ========================================================================== */

@media (pointer: fine) {
  body {
    cursor: default;
  }
  
  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(230, 198, 135, 0.4);
    border: 1px solid rgba(230, 198, 135, 0.8);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--ease-snappy), height 0.25s var(--ease-snappy), background-color 0.25s ease, border-color 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: #070708;
    font-weight: 700;
    letter-spacing: 0.05em;
  }

  .custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px dashed rgba(230, 198, 135, 0.3);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.12s ease-out;
  }

  .custom-cursor.active {
    width: 72px;
    height: 72px;
    background-color: var(--accent-gold);
    color: #070708;
    box-shadow: 0 0 30px rgba(230, 198, 135, 0.4);
  }

  .custom-cursor.hidden {
    opacity: 0;
  }
}

@media (pointer: coarse) {
  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }
}

/* ==========================================================================
   TYPOGRAPHY UTILITIES
   ========================================================================== */

.font-display {
  font-family: var(--font-display);
}

.font-editorial {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
}

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

.font-body {
  font-family: var(--font-body);
}

/* Text Gradient */
.text-gradient-gold {
  background: linear-gradient(135deg, #FFF 20%, #E6C687 70%, #C99B49 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-subtle {
  background: linear-gradient(180deg, #FFFFFF 0%, #A0A0AA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   GLASSMORPHISM & SURFACE ELEVATION
   ========================================================================== */

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-hairline);
}

.glass-card {
  background: rgba(18, 18, 22, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-hairline);
  transition: all var(--duration-layout) var(--ease-snappy);
}

.glass-card:hover {
  background: rgba(26, 26, 32, 0.85);
  border-color: var(--border-subtle);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 24px -4px rgba(230, 198, 135, 0.1);
}

.card-gold-hover:hover {
  border-color: var(--border-accent);
}

/* ==========================================================================
   HOLOGRAPHIC FOIL SHADER (For Credentials & Badges)
   ========================================================================== */

.holographic-badge {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(23, 23, 28, 0.9), rgba(15, 15, 18, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.4s var(--ease-snappy), border-color 0.4s ease;
}

.holographic-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 180deg at 50% 50%,
    rgba(230, 198, 135, 0) 0deg,
    rgba(230, 198, 135, 0.15) 60deg,
    rgba(62, 123, 250, 0.18) 120deg,
    rgba(16, 185, 129, 0.15) 180deg,
    rgba(139, 92, 246, 0.18) 240deg,
    rgba(230, 198, 135, 0.15) 300deg,
    rgba(230, 198, 135, 0) 360deg
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  transform: rotate(0deg);
}

.holographic-badge:hover::before {
  opacity: 1;
  animation: holoRotate 8s linear infinite;
}

.holographic-badge:hover {
  border-color: rgba(230, 198, 135, 0.5);
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(230, 198, 135, 0.2);
}

@keyframes holoRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MAGNETIC BUTTONS
   ========================================================================== */

.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 9999px;
  overflow: hidden;
  transition: transform 0.25s var(--ease-snappy), box-shadow 0.25s ease, background-color 0.25s ease;
  will-change: transform;
}

.magnetic-btn-primary {
  background-color: var(--accent-gold);
  color: #070708;
}

.magnetic-btn-primary:hover {
  background-color: #F0D59E;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -2px rgba(230, 198, 135, 0.4);
}

.magnetic-btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  backdrop-filter: blur(10px);
}

.magnetic-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: var(--border-subtle);
  transform: translateY(-2px);
}

/* ==========================================================================
   EDITORIAL PROJECT DRAWER / HOVER PEEK
   ========================================================================== */

.project-row {
  border-bottom: 1px solid var(--border-hairline);
  transition: all 0.3s var(--ease-snappy);
  position: relative;
}

.project-row:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom-color: rgba(230, 198, 135, 0.4);
}

.floating-preview {
  position: fixed;
  width: 320px;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-snappy);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-accent);
}

.floating-preview.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   SLIDE-OVER DRAWER MODAL
   ========================================================================== */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7, 7, 8, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 680px;
  height: 100vh;
  background-color: var(--surface-raised);
  border-left: 1px solid var(--border-subtle);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease-spring);
  overflow-y: auto;
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8);
}

#resume-modal > div,
#athletics-modal > div {
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.drawer-overlay.open .drawer-panel {
  transform: translateX(0);
}

/* ==========================================================================
   TOAST NOTIFICATION (Emil Kowalski Sonner-Style)
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--surface-overlay);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s var(--ease-snappy);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   PRELOADER ANIMATION
   ========================================================================== */

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--surface-canvas);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s var(--ease-cinematic);
}

.preloader.complete {
  transform: translateY(-100%);
  pointer-events: none;
}

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--surface-canvas);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-subtle);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Athletic Pill Active State */
.athletics-pill.active {
  background: rgba(230, 198, 135, 0.18) !important;
  color: #E6C687 !important;
  border-color: rgba(230, 198, 135, 0.6) !important;
  font-weight: 600 !important;
}

/* ==========================================================================
   ISOLATED EXECUTIVE PRINT STYLES (EXACT 1:1 REPLICA OF PREVIEW MODAL)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 15mm 10mm 15mm;
  }

  /* Reset document canvas to clean white */
  html, body {
    background: #FFFFFF !important;
    color: #111827 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 8.5pt !important;
    line-height: 1.4 !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Suppress ALL website chrome, navigation, canvas, sections, drawers, and unrelated modals */
  #preloader,
  header,
  nav,
  footer,
  section,
  #hero,
  #journey,
  #academics,
  #projects,
  #lab,
  #activities,
  #credentials,
  #skills,
  #resume,
  #contact,
  #hero-canvas,
  .custom-cursor,
  .custom-cursor-follower,
  .bg-noise,
  .toast-container,
  #drawer-overlay,
  .drawer-panel,
  #athletics-modal,
  .no-print {
    display: none !important;
  }

  /* Force Resume Modal to render as a direct, unstyled document */
  #resume-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
    z-index: auto !important;
  }

  #resume-modal > div {
    display: block !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  /* Hide interactive action bar inside modal (Print & Close buttons) */
  #resume-modal .sticky,
  #resume-modal button {
    display: none !important;
  }

  /* Format Printable Resume Container: Exact 1:1 match to Preview Modal */
  #printable-resume {
    display: block !important;
    background: #FFFFFF !important;
    color: #111827 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 8.5pt !important;
    line-height: 1.4 !important;
  }

  /* Header exact match to preview */
  #printable-resume .resume-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    width: 100% !important;
  }

  #printable-resume .border-b-2 {
    border-bottom: 2px solid #111827 !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
  }

  #printable-resume h1 {
    font-size: 26pt !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.025em !important;
    color: #030712 !important;
    margin: 0 0 3px 0 !important;
  }

  #printable-resume p.text-amber-800 {
    font-size: 8pt !important;
    font-weight: 700 !important;
    color: #92400e !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin: 0 !important;
  }

  #printable-resume .resume-contact {
    text-align: right !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
    font-size: 7.5pt !important;
    line-height: 1.5 !important;
    color: #4b5563 !important;
  }

  #printable-resume .resume-contact .text-emerald-700 {
    color: #047857 !important;
    font-weight: 700 !important;
  }

  /* Section Headings: EXACT match to preview modal */
  #printable-resume h2 {
    font-size: 7.5pt !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    color: #78350f !important;
    border-bottom: 1px solid #E5E7EB !important;
    padding-bottom: 3px !important;
    margin-top: 10px !important;
    margin-bottom: 5px !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  #printable-resume p {
    font-size: 7.5pt !important;
    line-height: 1.45 !important;
    color: #374151 !important;
  }

  /* Core Competencies: 3 crisp columns on pure white background matching preview */
  #printable-resume .resume-competencies-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-top: 4px !important;
  }

  #printable-resume .resume-competencies-grid > div {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }

  #printable-resume .resume-competencies-grid span.font-bold {
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    color: #111827 !important;
    display: block !important;
    margin-bottom: 2px !important;
  }

  #printable-resume .resume-competencies-grid p {
    font-size: 7pt !important;
    line-height: 1.4 !important;
    color: #4b5563 !important;
  }

  /* Flex rows for Role - Date and Degree - Date */
  #printable-resume .flex.justify-between {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    width: 100% !important;
  }

  #printable-resume .font-bold.text-gray-900 {
    font-size: 8pt !important;
    font-weight: 700 !important;
    color: #111827 !important;
  }

  #printable-resume .font-mono.text-\[11px\] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 7.5pt !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
  }

  #printable-resume p.italic {
    font-size: 7pt !important;
    color: #4b5563 !important;
    font-style: italic !important;
    margin-bottom: 2px !important;
  }

  /* Bullet points: clean disc, aligned */
  #printable-resume ul {
    list-style-type: disc !important;
    padding-left: 14px !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
  }

  #printable-resume li {
    font-size: 7pt !important;
    line-height: 1.38 !important;
    color: #374151 !important;
    margin-bottom: 1.5px !important;
    padding-left: 2px !important;
  }

  /* Leadership & Certifications grids: 2 balanced columns matching preview */
  #printable-resume .resume-leadership-grid,
  #printable-resume .resume-certs-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px 16px !important;
    font-size: 7pt !important;
    line-height: 1.38 !important;
    color: #374151 !important;
  }

  #printable-resume a {
    color: #92400e !important;
    text-decoration: none !important;
  }

  #printable-resume .mb-6 {
    margin-bottom: 8px !important;
  }

  #printable-resume .space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 5px !important;
  }

  #printable-resume .space-y-3 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 4px !important;
  }

  #printable-resume .space-y-2 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 3px !important;
  }

  /* Prevent awkward mid-entry page breaks */
  #printable-resume .space-y-4 > div,
  #printable-resume .space-y-3 > div,
  #printable-resume .space-y-2 > div,
  #printable-resume .mb-6 {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}
