/* ==============================================================================
   DARK CHARCOAL & GLOSSY MONOCHROME - CUSTOM STYLES
   Designed with intentionality, WCAG AA compliance, and clean developer aesthetics.
   Inspired by modern developer tools & liquid glass floating pill navigation.
   ============================================================================== */

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

:root {
  --bg-primary: #08080a;
  --bg-secondary: #0e0e12;
  --bg-tertiary: #141419;
  --bg-capsule: rgba(12, 12, 16, 0.88);
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.22);
  --border-active: rgba(255, 255, 255, 0.45);
}

/* Base Body Setup */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Monospace Utility */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Hide scrollbar for clean pill navigation */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==============================================================================
   METALLIC SPECULAR & GLOSSY BACKGROUND (Refined Studio Lighting Reflection)
   Simulates ambient titanium sheen & smooth glass reflection across dark charcoal.
   ============================================================================== */
.glossy-streaks-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 95% 45% at 50% -8%, rgba(210, 225, 240, 0.08) 0%, rgba(148, 163, 184, 0.025) 45%, transparent 75%),
    linear-gradient(130deg,
      rgba(255, 255, 255, 0.02) 0%,
      transparent 24%,
      rgba(255, 255, 255, 0.025) 36%,
      transparent 52%,
      rgba(255, 255, 255, 0.016) 74%,
      transparent 100%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
  opacity: 1;
}

/* Content Container layer above background */
.site-content {
  position: relative;
  z-index: 1;
}

/* ==============================================================================
   HERO SECTION: NAME ON LEFT, SOFT ROUNDED-SQUARE PROFILE PHOTO ON RIGHT
   ============================================================================== */
.hero-split-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  text-align: left;
}

.hero-text-column {
  display: contents;
}

.hero-photo-column {
  display: contents;
}

#hero-status-pill {
  grid-column: 1 / -1;
  justify-self: start;
}

#hero-headline {
  grid-column: 1 / 2;
  grid-row: 2;
  margin-bottom: 0;
}

.hero-profile-photo {
  grid-column: 2 / 3;
  grid-row: 2;
  position: relative;
  display: inline-flex;
  width: 6.75rem;
  height: 6.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, #1b1b22, #0d0d11 75%);
  box-shadow:
    0 20px 45px -12px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 1px rgba(255, 255, 255, 0.22);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.hero-profile-photo:hover {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

.hero-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#hero-subheadline {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 0.75rem;
}

.hero-text-column > div:has(#hero-secondary-cta) {
  grid-column: 1 / -1;
  grid-row: 4;
}

#hero-micro-note {
  grid-column: 1 / -1;
  grid-row: 5;
}

.hero-identity-title {
  min-width: 0;
  font-size: clamp(1.75rem, 4.8vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

@media (min-width: 640px) {
  .hero-split-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
  }

  .hero-text-column {
    display: block;
    flex: 1 1 0%;
    min-width: 0;
  }

  .hero-photo-column {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
  }

  #hero-headline {
    margin-bottom: 1.25rem;
  }

  #hero-subheadline {
    margin-top: 0;
  }

  .hero-profile-photo {
    width: 12.5rem;
    height: 12.5rem;
    border-radius: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .hero-split-layout {
    gap: 4rem;
  }

  .hero-profile-photo {
    width: 15.5rem;
    height: 15.5rem;
    border-radius: 2rem;
  }
}

/* ==============================================================================
   FLOATING PILL NAVBAR CAPSULE (Liquid Glass Aesthetic)
   Translucent liquid dark glass with deep optical refraction & specular sheen.
   ============================================================================== */
.floating-capsule {
  background: rgba(14, 14, 18, 0.68);
  background-image: linear-gradient(180deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.03) 40%,
      rgba(0, 0, 0, 0.15) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 20px 50px -10px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.4);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-capsule.scrolled {
  background: rgba(10, 10, 14, 0.85);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.6);
}

/* Section Scroll Margin to ensure fixed floating navbar does not cover headings */
section[id] {
  scroll-margin-top: 110px;
}

/* Active Nav Pill Indicator (Liquid Frosted Droplet) */
.nav-pill-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-pill-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ==============================================================================
   ACCESSIBILITY & FOCUS STATES (R-32 & R-39)
   ============================================================================== */
a,
button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85) !important;
  outline-offset: 3px !important;
  border-radius: 9999px;
}

/* Minimum touch targets for mobile accessibility (R-03) */
button,
a.btn-tap-target,
.contact-action-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-action-btn {
  height: 44px;
  border-radius: 0.75rem;
}

.contact-action-btn:focus-visible {
  border-radius: 0.75rem !important;
}

/* ==============================================================================
   PROJECT CARDS WITH RESPONSIVE SPOTLIGHT HOVER
   ============================================================================== */
.card-project {
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.card-project::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.055), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.card-project:hover::before {
  opacity: 1;
}

.card-project:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-3px);
  box-shadow:
    0 20px 40px -15px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ==============================================================================
   3D & LRC INTERACTIVE STACKED CARD SHOWCASE (Straight Layered Window Deck)
   Straight horizontal window deck with top window bar & scroll/swipe transitions.
   ============================================================================== */
.stack-showcase-wrapper {
  position: relative;
  width: 100%;
  padding-top: 2.1rem;
  padding-right: 0;
  padding-bottom: 0;
  margin-bottom: 1.25rem;
  user-select: none;
  touch-action: pan-y;
}

.stack-deck-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.stack-window-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0.875rem;
  overflow: hidden;
  background: #0b0b0f;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 20px 42px -12px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform-origin: center top;
  transition:
    transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.42s ease,
    border-color 0.3s ease;
  cursor: grab;
  will-change: transform, opacity;
}

.stack-window-card:active {
  cursor: grabbing;
}

/* Window Title Bar */
.stack-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  background: linear-gradient(180deg, #17171f 0%, #111117 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

.stack-window-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-window-index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.stack-window-body {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #09090c;
}

.stack-window-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.stack-window-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 0.85rem 0.6rem;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 6, 9, 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  pointer-events: none;
}

/* Straight Stack Depth Positions (Zero Tilt / Zero Rotation) */
.stack-window-card[data-stack-pos="0"] {
  z-index: 30;
  opacity: 1;
  filter: brightness(1);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translate3d(0px, 0px, 0px) scale(1);
}

.stack-window-card[data-stack-pos="1"] {
  z-index: 20;
  opacity: 0.92;
  filter: brightness(0.72);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translate3d(0px, -16px, 0px) scale(0.955);
}

.stack-window-card[data-stack-pos="2"] {
  z-index: 10;
  opacity: 0.78;
  filter: brightness(0.5);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translate3d(0px, -31px, 0px) scale(0.91);
}

.stack-window-card[data-stack-pos="hidden"] {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0px, -42px, 0px) scale(0.87);
}

.stack-showcase-wrapper:hover .stack-window-card[data-stack-pos="0"] {
  border-color: rgba(255, 255, 255, 0.34);
  transform: translate3d(0px, -2px, 0px) scale(1);
}

.stack-showcase-wrapper:hover .stack-window-card[data-stack-pos="1"] {
  transform: translate3d(0px, -18px, 0px) scale(0.955);
}

.stack-showcase-wrapper:hover .stack-window-card[data-stack-pos="2"] {
  transform: translate3d(0px, -34px, 0px) scale(0.91);
}

@media (max-width: 639px) {
  .stack-showcase-wrapper {
    padding-top: 1.85rem;
    padding-right: 0;
  }

  .stack-window-card[data-stack-pos="1"] {
    transform: translate3d(0px, -14px, 0px) scale(0.955);
  }

  .stack-window-card[data-stack-pos="2"] {
    transform: translate3d(0px, -27px, 0px) scale(0.91);
  }
}

/* Segmented Category Filter Pills (Clean Single-Line Pills for Mobile & Desktop) */
.category-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Pill Badges (Modern Sans-Serif, Clean Craftsmanship) */
.tech-pill {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  transition: all 0.18s ease;
}

.tech-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.07);
}

/* Subtle Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #17171d;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 22px;
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 9999;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #24242a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #383842;
}

/* Selection style */
::selection {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Modal Dialog */
.modal-overlay {
  background-color: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-close-button {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.75rem;
  background: #17171d;
  color: #cbd5e1;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.modal-close-button:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: #24242b;
  color: #ffffff;
}

.modal-close-button:active {
  background: #303039;
}

.modal-close-button:focus-visible {
  border-radius: 0.75rem !important;
}

.modal-project-actions a,
.modal-project-actions button {
  min-height: 2.75rem;
}

.quick-contact-icon {
  display: none;
}

.quick-contact-option {
  min-height: 2.75rem;
}

@media (max-width: 767px) {
  section[id] {
    scroll-margin-top: 5.5rem;
  }
}

@media (max-width: 639px) {
  #floating-contact-container {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  #floating-contact-menu {
    width: min(12rem, calc(100vw - 2rem));
  }

  .quick-contact-trigger {
    width: 3rem;
    height: 3rem;
    min-height: 3rem;
    padding: 0;
    border-radius: 1rem;
  }

  .quick-contact-status,
  .quick-contact-label {
    display: none;
  }

  .quick-contact-icon {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
  }
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-dialog-animate {
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================================================
   RESPONSIVE SCROLL REVEAL ANIMATIONS (R-19 Motion 2)
   Smooth fluid entrances without jarring jumps.
   ============================================================================== */
.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger delay helpers */
.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

/* ==============================================================================
   REDUCED MOTION SUPPORT (R-19 & R-39)
   ============================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .card-project:hover {
    transform: none;
  }

  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
}
