/* ==========================================================================
   duing.shop Design System - Core Styles
   Based on AROCK / Provecho cinematic minimalist guidelines
   ========================================================================== */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --color-bg: #1a1a1a;
  --color-bg-dark: #141414;
  --color-text-primary: #ffffff;
  --color-text-secondary: #b1b1b1;
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-hover: rgba(255, 255, 255, 0.4);
  
  /* Additional tokens for theme support */
  --color-card-bg: rgba(255, 255, 255, 0.03);
  --color-card-border: rgba(255, 255, 255, 0.1);
  --color-dock-bg: rgba(26, 26, 26, 0.45);
  --color-dock-border: rgba(255, 255, 255, 0.08);
  --color-dock-item-bg: rgba(255, 255, 255, 0.03);
  --color-modal-bg: rgba(26, 26, 26, 0.65);
  --color-modal-border: rgba(255, 255, 255, 0.08);
  --color-btn-sweep-bg: #ffffff;
  --color-btn-text-color: #ffffff;
}

:root.light-theme {
  --color-bg: #f5f5f7;
  --color-bg-dark: #e8e8ed;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #86868b;
  --color-border: rgba(0, 0, 0, 0.12);
  --color-border-hover: rgba(0, 0, 0, 0.35);
  
  --color-card-bg: rgba(0, 0, 0, 0.03);
  --color-card-border: rgba(0, 0, 0, 0.08);
  --color-dock-bg: rgba(245, 245, 247, 0.65);
  --color-dock-border: rgba(0, 0, 0, 0.08);
  --color-dock-item-bg: rgba(0, 0, 0, 0.03);
  --color-modal-bg: rgba(255, 255, 255, 0.85);
  --color-modal-border: rgba(0, 0, 0, 0.08);
  --color-btn-sweep-bg: #1d1d1f;
  --color-btn-text-color: #1d1d1f;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font: inherit;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  
  /* Responsive base font sizing: 12px at 1920px viewport, minimum 10px */
  font-size: clamp(10px, 0.625vw, 14px);
  line-height: 1.25;
}

/* Selection */
::-moz-selection {
  background: #000000;
  color: #ffffff;
}
::selection {
  background: #000000;
  color: #ffffff;
}

/* Typography styles */
.font-display {
  font-family: "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;
  font-weight: 900;
}

.t-0 {
  font-size: 13.3333rem; /* ~160px at 1920px width */
  line-height: 11.6667rem; /* ~140px */
  letter-spacing: -0.04em;
  font-weight: 900;
}

.t-1 {
  font-size: 8.3333rem; /* ~100px */
  line-height: 7.5rem; /* ~90px */
  letter-spacing: -0.04em;
  font-weight: 900;
}

.t-2 {
  font-size: 1rem; /* ~12px */
  line-height: 1.3333rem; /* ~16px */
  font-weight: 700;
  letter-spacing: 0.05em;
}

.t-3 {
  font-size: 3.3333rem; /* ~40px */
  line-height: 3.3333rem;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.t-4 {
  font-size: 2.5rem; /* ~30px */
  line-height: 3.3333rem;
  letter-spacing: -0.01em;
}

.t-5 {
  font-size: 1.1667rem; /* ~14px */
  line-height: 1.76rem;
}

/* Utilities */
.uppercase { text-transform: uppercase; }
.text-muted { color: var(--color-text-secondary); }
.mt-1 { margin-top: 0.5208vw; }
.mt-2 { margin-top: 1.0417vw; }
.mt-3 { margin-top: 1.5625vw; }
.mt-4 { margin-top: 2.0833vw; }

/* Grid Layout & Containers */
.page-container {
  padding-left: 1.1458vw; /* 22px */
  padding-right: 1.1458vw; /* 22px */
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Header Navigation */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(22px, 1.8vw, 36px) 2.5vw clamp(15px, 1.2vw, 24px) 1.5vw;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  mix-blend-mode: difference;
}

.header-logo a {
  display: block;
  transition: opacity 0.3s var(--ease-out-expo);
  text-decoration: none;
}

.header-logo a:hover {
  opacity: 0.7;
}

.header-logo img {
  height: clamp(14px, 1vw, 20px);
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .header-logo img {
    height: 4vw;
  }
}

.main-nav {
  display: flex;
  gap: 2.0833vw; /* 40px */
}

/* 3D Text Rotation link effect */
.nav-item {
  position: relative;
  display: inline-block;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  perspective: 12.5vw;
  cursor: pointer;
}

.nav-text-layer {
  display: block;
  transition: transform 0.8s var(--ease-out-expo);
  will-change: transform;
}

.nav-text-layer.absolute-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate3d(0, 110%, 0) rotateX(-70deg);
  transform-origin: center top;
}

.nav-text-layer:first-child {
  transform-origin: center bottom;
}

.nav-item:hover .nav-text-layer:first-child,
.nav-item.active .nav-text-layer:first-child {
  transform: translate3d(0, -110%, 0) rotateX(70deg);
}

.nav-item:hover .nav-text-layer.absolute-layer,
.nav-item.active .nav-text-layer.absolute-layer {
  transform: translate3d(0, 0%, 0) rotateX(0deg);
}

/* Active Link State Indicator */
.nav-item.active .nav-text-layer {
  font-weight: 700;
}

/* Content Sections Grid Configuration */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.0417vw;
  width: 100%;
}

/* Standardized Content Sections */
.section-hero {
  padding-top: 12vw;
  padding-bottom: 5vw;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.0417vw;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5625vw;
}

.meta-col-2 {
  grid-column: span 2;
}

.meta-col-4 {
  grid-column: span 4;
}

.section-content {
  padding-top: 8vw;
  padding-bottom: 10vw;
}

/* Skeleton layouts */
.skeleton-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  aspect-ratio: 16/9;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s var(--ease-out-expo);
  cursor: pointer;
}

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

.skeleton-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out-expo);
}

/* Scroll Reveal Animation Styles */
.reveal-card {
  opacity: 0;
  transform: translate3d(0, -40px, 0); /* slide down from above */
  transition: opacity 1.2s var(--ease-out-expo), transform 1.2s var(--ease-out-expo);
  will-change: opacity, transform;
  
  /* Inner buffer acting as a card margin */
  padding: 1.5vw;
}

.reveal-card.revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.skeleton-text {
  height: 1vw;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.2vw;
  width: 100%;
}

.skeleton-text.short {
  width: 60%;
}

/* Interactive Components */
/* Sweep Color-flip Button */
.flip-btn {
  position: relative;
  display: inline-block;
  padding: 0.8vw 1.6vw;
  border: 1px solid var(--color-border);
  border-radius: 2vw;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.4s;
}

.flip-btn:hover {
  border-color: var(--color-border-hover);
}

.btn-sweep-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-btn-sweep-bg);
  transform: translate3d(-102%, 0, 0);
  transition: transform 0.8s var(--ease-out-expo);
  will-change: transform;
}

.btn-text {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--color-btn-text-color);
  mix-blend-mode: difference;
  font-weight: 700;
}

.flip-btn:hover .btn-sweep-bg {
  transform: translate3d(0, 0, 0);
}

/* Text line reveal */
.reveal-line {
  display: block;
  overflow: hidden;
}

.reveal-inner {
  display: block;
  transform: translate3d(0, 110%, 0);
  transition: transform 1.2s var(--ease-out-expo);
  will-change: transform;
}

.reveal-wrapper.active .reveal-inner {
  transform: translate3d(0, 0%, 0);
}

/* Works Filter Navigation */
.filter-nav {
  display: flex;
  gap: 1.5vw;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1vw;
  margin-bottom: 3vw;
}

.filter-item {
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 0.3s;
}

.filter-item:hover, .filter-item.active {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* Home Page Grid Layout */
.home-grid {
  margin-top: 10vw;
  padding-bottom: 8vw;
}

.home-bio-col {
  grid-column: 1 / span 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - 16vw);
  position: sticky;
  top: 12vw;
}

.home-bio-col > .reveal-wrapper:first-child {
  margin-top: -1.8vw; /* Shift text up for optical alignment with Featured Works */
}

.home-featured-col {
  grid-column: 7 / span 6;
  display: flex;
  flex-direction: column;
  gap: 4vw;
}

.home-feat-card {
  width: 100%;
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.home-feat-card .t-3 {
  font-size: 2.2rem;
  line-height: 1.15;
}

/* Home Paragraph animation */
.reveal-wrapper .t-5 {
  opacity: 0;
  transform: translate3d(0, 15px, 0);
  transition: opacity 1.2s var(--ease-out-expo), transform 1.2s var(--ease-out-expo);
  transition-delay: 0.2s;
}

.reveal-wrapper.active .t-5 {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Works Card Layouts */

/* Standard project card layout when centered (non-scattered / filtered views) */
.project-card-col {
  grid-column: 3 / span 8;
  margin-top: 0;
  margin-bottom: 4vw;
  width: 100%;
}

/* Scattered layout for 'All Projects' tab on desktop */
#projects-grid.scattered .project-card-col {
  margin-bottom: 3vw;
}

/* Project 1: NRC Redesign */
#projects-grid.scattered .project-card-col:nth-child(1) {
  grid-column: 2 / span 5; /* 5 columns wide, starting at column 2 */
  margin-top: 1vw;
}

/* Project 2: SANSIL */
#projects-grid.scattered .project-card-col:nth-child(2) {
  grid-column: 8 / span 4; /* 4 columns wide, starting at column 8 */
  margin-top: 6vw; /* staggered down visually */
}

/* Project 3: Aru Branding */
#projects-grid.scattered .project-card-col:nth-child(3) {
  grid-column: 3 / span 5; /* 5 columns wide, starting at column 3 to avoid overlap */
  margin-top: 1vw;
}

/* Project 4: CampMealMill */
#projects-grid.scattered .project-card-col:nth-child(4) {
  grid-column: 9 / span 4; /* 4 columns wide, starting at column 9 to avoid overlap */
  margin-top: 6vw;
}

/* Contact Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 2vw;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5vw;
}

.form-label {
  color: var(--color-text-secondary);
}

.form-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  padding: 0.5vw 0;
  width: 100%;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.15);
}

/* Debugging Grid System Overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 1.1458vw;
  right: 1.1458vw;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.08;
  display: none;
}

.grid-overlay.visible {
  display: block;
}

.grid-overlay-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.0417vw;
  width: 100%;
  height: 100%;
}

.grid-col-overlay {
  background: #ff0000;
  height: 100%;
}

/* Profile / Info Block Grid alignment styles */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.0417vw;
  width: 100%;
}

.about-left {
  grid-column: span 4;
}

.about-right {
  grid-column: span 8;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2vw;
  margin-top: 3vw;
}

.experience-item {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.0417vw;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1.5vw;
}

.experience-year {
  grid-column: span 2;
}

.experience-title {
  grid-column: span 4;
}

.experience-desc {
  grid-column: span 6;
  color: var(--color-text-secondary);
}

/* Archive Layout */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.0417vw;
  width: 100%;
}

.archive-sidebar {
  grid-column: span 3;
}

.archive-list {
  grid-column: span 9;
  display: flex;
  flex-direction: column;
  gap: 2.5vw;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5vw;
  cursor: pointer;
  transition: border-color 0.3s;
}

.archive-item:hover {
  border-color: var(--color-border-hover);
}

/* Project Credits Layout */
.project-credits-container {
  width: 100%;
  max-width: 1200px;
  margin-top: 6vw;
  padding: 4vw 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2vw;
  width: 100%;
}

.credits-col {
  display: flex;
  flex-direction: column;
}

.credits-col .t-2 {
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.credits-col .font-display {
  font-weight: 500;
}

.credits-list {
  margin-top: 1.5vw;
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
}

.credits-list p {
  font-size: 0.95rem;
}

/* Responsive Scaling for Tablets and Mobiles */
@media (max-width: 1024px) {
  html, body {
    /* Responsive mobile/tablet base font sizing: minimum 14px */
    font-size: clamp(14px, 2.6667vw, 24px);
    line-height: 1.4;
  }
  
  .main-header {
    padding: 6vw 4.5vw 6vw 3.5vw;
  }
  
  .page-container {
    padding-left: 2.9333vw; /* 22px at 750px screen width */
    padding-right: 2.9333vw;
  }
  
  .nav-item {
    perspective: 50vw;
  }
  
  .main-nav {
    gap: 4vw;
  }
  
  /* Sitemaps stacks vertically in mobile */
  .grid-12, .hero-meta, .about-grid, .experience-item, .archive-grid {
    display: flex;
    flex-direction: column;
    gap: 6vw;
  }
  
  .about-left, .about-right, .archive-sidebar, .archive-list {
    width: 100%;
  }
  
  .section-hero {
    padding-top: 25vw;
  }
  
  .intro-block {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .flip-btn {
    padding: 3vw 6vw;
    border-radius: 8vw;
  }
  
  .grid-overlay {
    left: 2.9333vw;
    right: 2.9333vw;
  }
  
  .grid-overlay-container {
    display: flex;
    justify-content: space-between;
  }
  
  .grid-col-overlay {
    width: 2.9333vw;
  }

  /* Reset works page card positions and margins on mobile/tablet */
  .project-card-col,
  #projects-grid.scattered .project-card-col {
    grid-column: auto !important;
    margin-top: 0 !important;
    margin-bottom: 8vw !important;
    width: 100% !important;
    padding: 0 !important; /* clear padding on mobile to maximize image size */
  }

  /* Reset home page grid and sticky columns on mobile/tablet */
  .home-grid {
    margin-top: 25vw;
    display: flex;
    flex-direction: column;
    gap: 8vw;
  }
  
  .home-bio-col {
    grid-column: auto !important;
    height: auto !important;
    position: static !important;
    gap: 6vw;
  }
  
  .home-bio-col > .reveal-wrapper:first-child {
    margin-top: 0 !important; /* Reset shift on mobile */
  }
  
  .home-featured-col {
    grid-column: auto !important;
    gap: 8vw;
  }
  
  .home-feat-card .t-3 {
    font-size: 1.8rem;
  }

  /* Reset project credits grid on mobile/tablet */
  .credits-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 6vw !important;
  }
  
  .credits-list {
    margin-top: 3vw !important;
  }

  /* Overrides for mobile typography scales to prevent overflow */
  .t-0 {
    font-size: clamp(38px, 12vw, 80px);
    line-height: 1.05;
  }
  
  .t-1 {
    font-size: clamp(30px, 9vw, 60px);
    line-height: 1.1;
  }
  
  .t-3 {
    font-size: clamp(20px, 5.5vw, 36px);
    line-height: 1.2;
  }
  
  .t-4 {
    font-size: clamp(15px, 4.5vw, 24px);
    line-height: 1.3;
  }
  
  .t-5 {
    font-size: clamp(12px, 3.5vw, 16px);
    line-height: 1.4;
  }
  
  .t-2 {
    font-size: clamp(10px, 3vw, 12px);
    line-height: 1.2;
  }
  
  .header-logo img {
    height: clamp(16px, 4.5vw, 24px);
  }
}

/* ==========================================================================
   Floating Dock Navigation (Aceternity UI Style)
   ========================================================================== */
.floating-dock-wrapper {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

.dock-container {
  display: flex;
  align-items: flex-end;
  height: 64px;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 24px;
  background: var(--color-dock-bg);
  border: 1px solid var(--color-dock-border);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: padding 0.3s var(--ease-out-expo);
  will-change: padding;
}

.dock-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-dock-item-bg);
  border: 1px solid var(--color-dock-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: width 0.12s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.12s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.3s, 
              color 0.3s,
              border-color 0.3s;
  will-change: width, height;
}
.dock-item:hover {
  background: var(--color-border);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.dock-item.active {
  background: var(--color-card-bg);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

/* Active Indicator Dot under the item */
.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-text-primary);
  box-shadow: 0 0 4px var(--color-text-primary);
}

.dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.dock-icon svg {
  width: 22px;
  height: 22px;
  transition: width 0.12s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: width, height;
}

/* Tooltip style */
.dock-tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 15, 15, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out-expo), 
              transform 0.25s var(--ease-out-expo);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hide header nav since we are using floating dock */
.main-header .main-nav {
  display: none !important;
}

/* Responsive adjustments for mobile floating dock */
@media (max-width: 768px) {
  .floating-dock-wrapper {
    bottom: 16px;
    width: auto;
    max-width: 90vw;
  }
  
  .dock-container {
    height: 56px;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
  }
  
  .dock-item {
    width: 38px;
    height: 38px;
  }
  
  .dock-icon svg {
    width: 18px;
    height: 18px;
  }
  
  /* Disable hover magnification on touch devices to avoid glitchy scrolling/hover state */
  .dock-item:hover .dock-tooltip {
    opacity: 0;
  }
}

/* ==========================================================================
   Premium Archive Log Modal Overlay
   ========================================================================== */
.archive-meta {
  display: flex;
  align-items: center;
  gap: 1.5vw;
}

.archive-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2vw;
  height: 2.2vw;
  min-width: 24px;
  min-height: 24px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-secondary);
  transition: transform 0.5s var(--ease-out-expo), border-color 0.3s, background-color 0.3s, color 0.3s;
}

.archive-item:hover .archive-toggle-icon {
  border-color: var(--color-border-hover);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  transform: translateX(3px); /* subtle hint of forward movement */
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out-expo);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Card Window */
.modal-window {
  background: var(--color-modal-bg);
  border: 1px solid var(--color-modal-border);
  border-radius: 24px;
  width: 90vw;
  max-width: 1100px;
  max-height: 85vh;
  padding: 3vw 4vw;
  overflow-y: auto;
  position: relative;
  transform: translate3d(0, 40px, 0) scale(0.95);
  transition: transform 0.6s var(--ease-out-expo), opacity 0.6s var(--ease-out-expo);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
  opacity: 0;
}

.modal-overlay.active .modal-window {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

/* Scrollbar Customization for Modal */
.modal-window::-webkit-scrollbar {
  width: 6px;
}

.modal-window::-webkit-scrollbar-track {
  background: transparent;
}

.modal-window::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.modal-window::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Modal Close Button */
.modal-close-btn {
  position: absolute;
  top: 2vw;
  right: 2vw;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
  z-index: 10;
  outline: none;
}

.modal-close-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #1a1a1a;
  transform: scale(1.08) rotate(90deg);
}

.modal-header-meta {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  margin-top: 0.5vw;
}

.modal-divider {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 1.5vw;
}

/* Cinematic Grid Layout */
.modal-grid {
  display: grid;
  grid-template-columns: 3fr 7fr;
  gap: 4vw;
  margin-top: 2vw;
  text-align: left;
}

.modal-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 2.5vw;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding-right: 3vw;
}

.modal-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
}

.modal-side-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
}

.modal-side-list li {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.modal-side-list li span.text-white {
  color: var(--color-text-primary);
}

.modal-main-col {
  display: flex;
  flex-direction: column;
  gap: 3vw;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.8vw;
}

.modal-section p {
  color: var(--color-text-secondary);
  font-size: 1.1667rem;
  line-height: 1.8;
}

.modal-section p strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.modal-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1vw;
}

.modal-bullet-list li {
  position: relative;
  padding-left: 1.5vw;
  color: var(--color-text-secondary);
  font-size: 1.1667rem;
  line-height: 1.8;
}

.modal-bullet-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.3);
}

.modal-bullet-list li strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* Utilities for Modal */
.text-white {
  color: var(--color-text-primary) !important;
}

@media (max-width: 1024px) {
  .archive-meta {
    gap: 3vw;
  }
  .archive-toggle-icon {
    width: 6vw;
    height: 6vw;
  }
  .modal-window {
    width: 95vw;
    padding: 6vw;
    max-height: 90vh;
    border-radius: 20px;
  }
  .modal-close-btn {
    top: 4vw;
    right: 4vw;
    width: 38px;
    height: 38px;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 6vw;
  }
  .modal-sidebar-col {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-right: 0;
    padding-bottom: 5vw;
    gap: 4vw;
  }
  .modal-main-col {
    gap: 6vw;
  }
  .modal-bullet-list li {
    padding-left: 4vw;
  }
  .detail-col {
    gap: 2vw;
  }
}

