/* ========================================
   MODERN MOTION GRAPHICS PORTFOLIO
   Enes Cifci - Interactive Optical Illusions
   ======================================== */

/* CSS Custom Properties */
:root {
  --bg: #0a0a0a;
  --fg: #e8e8e8;
  --muted: #999;
  --card: #111;
  --accent: #ff6b35;
  --accent2: #4ecdc4;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  font-family: var(--sans);
  line-height: 1.45;
}

/* Core Layout */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(80% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0.65) 100%);
}

.scroll {
  position: relative;
  z-index: 10;
}

.spacer {
  height: 1000000px;
}

/* Navigation */
.nav {
  position: fixed;
  inset: 16px auto auto 16px;
  z-index: 30;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav strong {
  color: var(--fg);
  font-weight: 600;
}

/* Hero Section */
.hero {
  position: fixed;
  top: 12vh;
  left: 8vw;
  z-index: 20;
  max-width: 52ch;
}

.hero h1 {
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: clamp(20px, 3.5vw, 32px);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 14px;
  color: var(--accent2);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.hero p {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hero .tags {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--accent);
  transition: all 0.2s ease;
}

.tag:hover {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--accent);
}

/* Mobile Projects Toggle Button */
.mobile-projects-toggle {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.15);
  border: 1px solid rgba(255, 107, 53, 0.4);
  color: var(--accent);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  margin-top: 25px;
  display: none; /* Hidden by default, shown only on mobile */
  box-shadow: 
    0 4px 12px rgba(255, 107, 53, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  width: auto;
  text-align: center;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}

.mobile-projects-toggle:hover {
  background: rgba(255, 107, 53, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 
    0 8px 20px rgba(255, 107, 53, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.mobile-projects-toggle.active {
  background: rgba(78, 205, 196, 0.1);
  border-color: rgba(78, 205, 196, 0.3);
  color: var(--accent2);
}

/* Mobile Back Button */
.mobile-back-button {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.1);
  border: 1px solid rgba(78, 205, 196, 0.3);
  color: var(--accent2);
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 16px 20px 8px;
  display: none; /* Hidden by default, shown only in mobile projects view */
}

.mobile-back-button:hover {
  background: rgba(78, 205, 196, 0.2);
  border-color: var(--accent2);
}

/* Show back button in mobile projects view */
.mobile-projects-view .mobile-back-button {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  border-radius: 16px;
  margin: 12px 16px 8px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: backButtonSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

@keyframes backButtonSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Closing animation for back button */
.mobile-projects-closing .mobile-back-button {
  animation: backButtonSlideOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

@keyframes backButtonSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Theme Color Buttons */
.theme-colors {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.color-btn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, var(--btn-color), var(--btn-secondary));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.color-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-color), var(--btn-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.color-btn:hover {
  transform: scale(1.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4), 
              0 0 0 2px rgba(255, 255, 255, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.color-btn:hover::before {
  opacity: 0.3;
}

.color-btn.active {
  transform: scale(1.3);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.5),
              0 0 0 2px rgba(255, 255, 255, 0.2),
              0 0 15px var(--btn-color),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.color-btn.active::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  display: block;
}

.hero .stats {
  margin-top: 16px;
  display: flex;
  gap: 20px;
  font-size: 11px;
}

.stat {
  color: var(--muted);
}

.stat strong {
  color: var(--fg);
  font-weight: 600;
}

/* Project Cards Container - Stacked Deck Layout */
.stack {
  position: fixed;
  right: 3vw;
  top: 50%;
  transform: translateY(-50%);
  width: min(480px, 50vw);
  height: 85vh;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 20px 0;
  pointer-events: auto;
}

.stack-inner {
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding: 0px 0;
}

/* Category Headers with Glassmorphism */
.category-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.category-header {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin: 0 0 5px 0;
  padding: 8px 15px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: absolute;
  right: 0;
  min-width: 160px;
  transition: all 0.4s ease;
  z-index: 20;
}

.category-header:hover {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Vertical cards row */
.verticals-row {
  position: relative;
  height: 300px;
  display: flex;
  justify-content: center;
}

/* Horizontal cards row */
.horizontals-row {
  position: relative;
  height: 240px;
  display: flex;
  justify-content: center;
}

/* Crypto cards row */
.crypto-row {
  position: relative;
  height: 200px;
  display: flex;
  justify-content: center;
}


/* Stacked Deck Cards - Minimal Design */
.card {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Vertical cards styling and stacking - increased spacing */
.card.vertical {
  width: 130px;
  height: 210px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.card.vertical:nth-of-type(1) { 
  z-index: 5; 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(-120px);
}
.card.vertical:nth-of-type(2) { 
  z-index: 4; 
  transform: translate(-50%, -50%) rotate(3deg) translateX(-60px);
}
/* 3rd position is horizontal card */
.card.vertical:nth-of-type(4) { 
  z-index: 2; 
  transform: translate(-50%, -50%) rotate(4deg) translateX(60px);
}
.card.vertical:nth-of-type(5) { 
  z-index: 1; 
  transform: translate(-50%, -50%) rotate(-3deg) translateX(120px);
}
.card.vertical:nth-of-type(6) { 
  z-index: 0; 
  transform: translate(-50%, -50%) rotate(2deg) translateX(180px);
}

/* Special positioning for horizontal cards in vertical row */
.verticals-row .card.horizontal {
  width: 280px;
  height: 140px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.verticals-row .card.horizontal:nth-of-type(3) { 
  z-index: 3; 
  transform: translate(-50%, -50%) rotate(-2deg) translateX(0px);
}

/* Horizontal cards styling and stacking - increased spacing */
.card.horizontal {
  width: 280px;
  height: 140px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.card.horizontal:nth-of-type(1) { 
  z-index: 4; 
  transform: translate(-50%, -50%) rotate(-3deg) translateX(-70px);
}
.card.horizontal:nth-of-type(2) { 
  z-index: 3; 
  transform: translate(-50%, -50%) rotate(4deg) translateX(-25px);
}
.card.horizontal:nth-of-type(3) { 
  z-index: 2; 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(25px);
}
.card.horizontal:nth-of-type(4) { 
  z-index: 1; 
  transform: translate(-50%, -50%) rotate(3deg) translateX(70px);
}
.card.horizontal:nth-of-type(5) { 
  z-index: 0; 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(90px);
}
.card.horizontal:nth-of-type(6) { 
  z-index: -1; 
  transform: translate(-50%, -50%) rotate(3deg) translateX(110px);
}

/* Crypto cards styling and stacking - same size as horizontal cards */
.card.crypto {
  width: 280px;
  height: 140px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Vertical crypto card - different dimensions and positioning */
.card.crypto.vertical {
  width: 130px;
  height: 210px;
}

/* Updated positioning for new order: vertical card first */
.card.crypto.vertical:nth-of-type(1) { 
  z-index: 4; 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(-100px);
}
.card.crypto:nth-of-type(2) { 
  z-index: 3; 
  transform: translate(-50%, -50%) rotate(-2deg) translateX(-40px);
}
.card.crypto:nth-of-type(3) { 
  z-index: 2; 
  transform: translate(-50%, -50%) rotate(3deg) translateX(10px);
}
.card.crypto:nth-of-type(4) { 
  z-index: 1; 
  transform: translate(-50%, -50%) rotate(-3deg) translateX(60px);
}
.card.crypto:nth-of-type(5) { 
  z-index: 0; 
  transform: translate(-50%, -50%) rotate(2deg) translateX(100px);
}


/* Hide all text elements - cards are thumbnail-only */
.card header,
.card-content,
.meta {
  display: none;
}

/* Hover effects - scale in place without repositioning */
.card:hover {
  z-index: 10 !important;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Scale in place for vertical cards - maintain exact position */
/* Scale in place for vertical cards - maintain exact position */
.card.vertical:nth-of-type(1):hover { 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(-120px) scale(1.08);
}
.card.vertical:nth-of-type(2):hover { 
  transform: translate(-50%, -50%) rotate(3deg) translateX(-60px) scale(1.08);
}
/* 3rd position is horizontal card */
.card.vertical:nth-of-type(4):hover { 
  transform: translate(-50%, -50%) rotate(4deg) translateX(60px) scale(1.08);
}
.card.vertical:nth-of-type(5):hover { 
  transform: translate(-50%, -50%) rotate(-3deg) translateX(120px) scale(1.08);
}
.card.vertical:nth-of-type(6):hover { 
  transform: translate(-50%, -50%) rotate(2deg) translateX(180px) scale(1.08);
}

/* Scale in place for horizontal cards in vertical row */
.verticals-row .card.horizontal:nth-of-type(3):hover { 
  transform: translate(-50%, -50%) rotate(-2deg) translateX(0px) scale(1.08);
}

/* Scale in place for horizontal cards - maintain exact position */
.card.horizontal:nth-of-type(1):hover { 
  transform: translate(-50%, -50%) rotate(-3deg) translateX(-70px) scale(1.08);
}
.card.horizontal:nth-of-type(2):hover { 
  transform: translate(-50%, -50%) rotate(4deg) translateX(-25px) scale(1.08);
}
.card.horizontal:nth-of-type(3):hover { 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(25px) scale(1.08);
}
.card.horizontal:nth-of-type(4):hover { 
  transform: translate(-50%, -50%) rotate(3deg) translateX(70px) scale(1.08);
}
.card.horizontal:nth-of-type(5):hover { 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(90px) scale(1.08);
}
.card.horizontal:nth-of-type(6):hover { 
  transform: translate(-50%, -50%) rotate(3deg) translateX(110px) scale(1.08);
}

/* Scale in place for crypto cards - maintain exact position */
.card.crypto.vertical:nth-of-type(1):hover { 
  transform: translate(-50%, -50%) rotate(-4deg) translateX(-100px) scale(1.08);
}
.card.crypto:nth-of-type(2):hover { 
  transform: translate(-50%, -50%) rotate(-2deg) translateX(-40px) scale(1.08);
}
.card.crypto:nth-of-type(3):hover { 
  transform: translate(-50%, -50%) rotate(3deg) translateX(10px) scale(1.08);
}
.card.crypto:nth-of-type(4):hover { 
  transform: translate(-50%, -50%) rotate(-3deg) translateX(60px) scale(1.08);
}
.card.crypto:nth-of-type(5):hover { 
  transform: translate(-50%, -50%) rotate(2deg) translateX(100px) scale(1.08);
}

/* Card header - responsive to card size */
.card header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  height: 60px;
  box-sizing: border-box;
  transition: all 0.4s ease;
  z-index: 3;
  border-radius: 20px 20px 0 0;
}

.card:hover header {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    rgba(255, 255, 255, 0.12) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 
    0 0 0 3px rgba(255, 107, 53, 0.25),
    0 2px 8px rgba(255, 107, 53, 0.3);
  animation: pulse 3s infinite ease-in-out;
  transition: all 0.4s ease;
}

.card:hover .dot {
  box-shadow: 
    0 0 0 4px rgba(255, 107, 53, 0.4), 
    0 0 15px rgba(255, 107, 53, 0.4),
    0 4px 12px rgba(255, 107, 53, 0.3);
  transform: scale(1.15);
}

@keyframes pulse {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.card h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.01em;
  font-weight: 600;
  line-height: 1.2;
  transition: all 0.4s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  flex: 1;
}

.card:hover h3 {
  color: var(--accent2);
  transform: translateX(2px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card .year {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.4s ease;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card:hover .year {
  color: var(--accent);
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateX(-2px) scale(1.05);
}

/* Content container - adjusted for grid layout */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  overflow: hidden;
  position: relative;
  margin-top: 60px;
}

/* Full-size thumbnail container - responsive to card aspect ratio */
.thumb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0px;
  background: 
    linear-gradient(135deg, 
      rgba(0, 0, 0, 0.4) 0%, 
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.6) 100%);
  border-radius: 20px;
  overflow: hidden;
  z-index: 1;
}

.thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, 
    transparent 0%, 
    transparent 60%,
    rgba(0, 0, 0, 0.3) 85%,
    rgba(0, 0, 0, 0.6) 100%);
  z-index: 2;
  pointer-events: none;
}

.thumb img,
.thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* Different object-fit for vertical vs horizontal cards */
.card:nth-child(odd) .thumb img,
.card:nth-child(odd) .thumb video {
  object-fit: cover; /* Ensure vertical videos fill properly */
}

.card:nth-child(even) .thumb img,
.card:nth-child(even) .thumb video {
  object-fit: cover; /* Ensure horizontal videos fill properly */
}

.thumb img {
  opacity: 1;
  transform: scale(1.05);
  filter: brightness(0.85) contrast(1.1) saturate(1.1);
}

.thumb video {
  opacity: 0;
  transform: scale(1.1);
  filter: brightness(0.9) contrast(1.15) saturate(1.2);
}

/* Video plays on card hover with enhanced effects */
.card:hover .thumb img {
  opacity: 0;
  transform: scale(1);
  filter: brightness(0.8) contrast(1.05);
}

.card:hover .thumb video {
  opacity: 1;
  transform: scale(1);
  filter: brightness(1) contrast(1.2) saturate(1.3);
}


/* Meta information - adjusted for grid layout */
.meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 10px;
  color: var(--muted);
  height: 70px;
  box-sizing: border-box;
  transition: all 0.4s ease;
  z-index: 3;
  border-radius: 0 0 20px 20px;
}

.card:hover .meta {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    rgba(255, 255, 255, 0.12) 100%);
  border-top-color: rgba(255, 255, 255, 0.18);
}

.meta span {
  transition: all 0.4s ease;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  flex: 1;
  line-height: 1.3;
  font-size: 9px;
}

.card:hover .meta span {
  color: var(--fg);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.meta a {
  color: var(--accent2);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.4s ease;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.meta a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Hide all text elements - cards are thumbnail-only */
.card header,
.card-content,
.meta {
  display: none;
}

/* Perspective Marquee */
.floor {
  position: fixed;
  inset: auto 0 0 0;
  height: 40vh;
  perspective: 800px;
  z-index: 15;
  pointer-events: none;
}

.marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10vh;
  transform: rotateX(60deg) translateZ(0);
  opacity: 0.25;
}

.marquee .row {
  white-space: nowrap;
  will-change: transform;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.1em;
  color: #fff;
}

#row2 {
  opacity: 0.8;
}

/* Enhanced Moiré Pattern */
.moire {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(45deg, rgba(255, 107, 53, 0.05) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(78, 205, 196, 0.03) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 30px 30px, 25px 25px, 15px 15px, 15px 15px;
  mix-blend-mode: overlay;
  opacity: 0.3;
  pointer-events: none;
  z-index: 6;
  animation: moireShift 20s linear infinite;
}

@keyframes moireShift {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

/* Effect Toggle Controls */
.controls {
  position: fixed;
  bottom: 40px;
  left: 20px;
  z-index: 35;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #333;
  border-radius: 20px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
}

.effect-btn {
  background: rgba(17, 17, 17, 0.9);
  border: 1px solid #333;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  white-space: nowrap;
}

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

.effect-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Auto-switch button styling */
.auto-switch-btn {
  background: rgba(17, 17, 17, 0.9);
  border: 1px solid #333;
  color: var(--muted);
  padding: 5px 5px;
  font-size: 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.auto-switch-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.auto-switch-btn.active {
  background: var(--accent2);
  color: #000;
  border-color: var(--accent2);
  animation: autoSwitchPulse 20s linear infinite;
}

/* Subtle animation to show auto-switch progress */
@keyframes autoSwitchPulse {
  0%, 95% { 
    box-shadow: inset 0 0 0 0 rgba(78, 205, 196, 0.3);
  }
  96%, 100% { 
    box-shadow: inset 0 0 0 2px rgba(78, 205, 196, 0.6);
  }
}

.effect-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-right: 4px;
  margin-bottom: 0;
}

/* Footer */
.foot {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 40;
  font-size: 10px;
  color: var(--muted);
}

.foot a {
  color: var(--accent2);
  text-decoration: none;
}

.foot a:hover {
  color: var(--fg);
}

/* Responsive Design */
@media (max-width: 840px) {
  /* Show mobile toggle button */
  .mobile-projects-toggle {
    display: none;
  }
  
  .hero {
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
    left: 0;
    right: 0;
    padding: 20px;
  }

  /* Show and center project stack on mobile */
  .stack {
    display: flex;
    left: 50%;
    right: auto;
    top: 85%;
    width: min(340px, 90vw);
    height: 68vh;
    transform: translate(-50%, -50%);
    gap: 28px;
  }
  
  /* Remove mobile overlay behavior */
  .mobile-projects-view .stack { }
  
  .mobile-projects-view .card { }
  
  .mobile-projects-view .card.vertical { }
  
  .mobile-projects-view .card.horizontal { }
  
  .mobile-projects-view .card:hover { }
  
  .mobile-projects-view .thumb { }
  
  .mobile-projects-view .nav,
  .mobile-projects-view .hero,
  .mobile-projects-view .floor,
  .mobile-projects-view .controls,
  .mobile-projects-view .foot { }
  
  /* Mobile projects view specific styling */
  .mobile-projects-view .stack { }

  @keyframes mobileProjectsSlideIn {}

  .mobile-projects-closing .stack { }

  @keyframes mobileProjectsSlideOut {}

  .mobile-projects-closing .card { }

  .mobile-projects-closing .card:nth-child(1) {}
  .mobile-projects-closing .card:nth-child(2) {}
  .mobile-projects-closing .card:nth-child(3) {}
  .mobile-projects-closing .card:nth-child(4) {}
  .mobile-projects-closing .card:nth-child(5) {}
  .mobile-projects-closing .card:nth-child(6) {}
  .mobile-projects-closing .card:nth-child(7) {}
  .mobile-projects-closing .card:nth-child(8) {}

  @keyframes cardSlideOut {}
  
  .mobile-projects-view .mobile-back-button { }
  
  .mobile-projects-view .mobile-back-button:hover { }
  
  /* Remove mobile-specific card overrides */
  .mobile-projects-view .card { }
  
  .mobile-projects-view .card:nth-child(1) {}
  .mobile-projects-view .card:nth-child(2) {}
  .mobile-projects-view .card:nth-child(3) {}
  .mobile-projects-view .card:nth-child(4) {}
  .mobile-projects-view .card:nth-child(5) {}
  .mobile-projects-view .card:nth-child(6) {}
  .mobile-projects-view .card:nth-child(7) {}
  .mobile-projects-view .card:nth-child(8) {}
  
  @keyframes cardSlideIn {}
  
  
  .mobile-projects-view .card:hover { }
  
  .mobile-projects-view .card header { }
  
  .mobile-projects-view .card header h3 { }
  
  .mobile-projects-view .card header .year { }
  
  .mobile-projects-view .card header .dot { }
  
  .mobile-projects-view .card-content { }
  
  .mobile-projects-view .thumb { }
  
  .mobile-projects-view .thumb::before { }
  
  .mobile-projects-view .thumb img,
  .mobile-projects-view .thumb video { }
  
  .mobile-projects-view .meta { }
  
  .mobile-projects-view .meta span { }
  
  .mobile-projects-view .meta a { }
  
  .mobile-projects-view .meta a:hover { }
  

  
  .hero {
    left: 6vw;
    right: 6vw;
    top: 8vh;
  }
  
  .controls {
    left: 8px;
    bottom: 40px;
    padding: 3px 9px;
  }
  
  .theme-colors {
    gap: 4px;
    padding-right: 8px;
  }
  
  .color-btn {
    width: 14px;
    height: 14px;
  }
  
  .color-btn.small {
    width: 12px;
    height: 12px;
  }
  
  /* Smaller card sizes for mobile while keeping stacked deck */
  /* Collapse rows by default; expand via .open on parent */
  .category-section .verticals-row,
  .category-section .horizontals-row,
  .category-section .crypto-row {
    position: relative;
    height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: height 0.35s ease, max-height 0.35s ease, opacity 0.25s ease;
  }
  .category-section.open .verticals-row { height: 200px; max-height: 200px; opacity: 1; pointer-events: auto; overflow: visible; }
  .category-section.open .horizontals-row { height: 150px; max-height: 150px; opacity: 1; pointer-events: auto; overflow: visible; }
  .category-section.open .crypto-row { height: 130px; max-height: 130px; opacity: 1; pointer-events: auto; overflow: visible; }

  .card.vertical { width: 92px; height: 148px; }
  .verticals-row .card.horizontal { width: 200px; height: 100px; }
  .card.horizontal { width: 200px; height: 100px; }
  .card.crypto { width: 200px; height: 100px; }
  .card.crypto.vertical { width: 92px; height: 148px; }

  /* Make headers clearly interactive on mobile */
  .category-header { cursor: pointer; }
  /* Flow headers normally so each is visible and tappable */
  .category-section { width: 100%; margin: 0px 0 0px; }
  .category-header {
    position: static;
    right: auto;
    min-width: auto;
    width: auto;
    display: block;
    margin: 6px 0 8px 0;
    z-index: 2;
  }
  .category-section.open .category-header {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
      0 10px 36px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
  
  .hero h1 {
    font-size: clamp(18px, 5vw, 28px);
  }
  
  .nav {
    font-size: 11px;
  }
}

/* Screensaver Mode */
.screensaver-mode {
  cursor: none !important; /* Hide mouse cursor completely */
}

/* Fade cursor as screensaver approaches */
.cursor-fading {
  cursor: none;
  transition: cursor 0.3s ease;
}

.screensaver-mode .nav,
.screensaver-mode .hero,
.screensaver-mode .floor,
.screensaver-mode .controls,
.screensaver-mode .foot {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px); /* Subtle slide down when hiding */
  transition: all 0.8s ease-out;
}

/* Project stack gets simple fade without transform animation */
.screensaver-mode .stack {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-out;
}

/* Keep the background canvas and vignette visible */
.screensaver-mode #bg,
.screensaver-mode .vignette,
.screensaver-mode .moire {
  opacity: 1;
}

/* Smooth transition for entering/exiting screensaver */
body {
  transition: all 0.3s ease;
}

/* UI elements restoration animation */
.nav,
.hero,
.floor,
.controls,
.foot {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

/* Project stack gets simple transition without transform */
.stack {
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered animation classes for restoration */
.ui-restore-1 { animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0s both; }
.ui-restore-2 { animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both; }
.ui-restore-3 { animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both; }
.ui-restore-4 { animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both; }
.ui-restore-5 { animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both; }
.ui-restore-6 { animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both; }

@keyframes slideInFade {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced vignette in screensaver mode for better focus */
.screensaver-mode .vignette {
  background: radial-gradient(70% 70% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0.8) 100%);
  transition: background 0.8s ease-out;
}

@media (max-width: 480px) {
  .hero {
    padding: 16px;
    width: 100%;
    left: 0;
    right: 0;
    top: 60px;
  }

  /* Further tighten stack and card sizes for small phones */
  .stack { width: min(310px, 92vw); height: 64vh; top: 85%; }
  .verticals-row { height: 185px; }
  .horizontals-row { height: 140px; }
  .crypto-row { height: 120px; }
  .card.vertical { width: 86px; height: 140px; }
  .verticals-row .card.horizontal { width: 188px; height: 94px; }
  .card.horizontal { width: 188px; height: 94px; }
  .card.crypto { width: 188px; height: 94px; }
  .card.crypto.vertical { width: 86px; height: 140px; }
  
  .mobile-projects-toggle { display: none; }
  
  .mobile-back-button { display: none; }
  
  .category-header {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .controls {
    left: 4px;
    bottom: 40px;
    padding: 5px 8px;
  }
  
  .theme-colors {
    gap: 3px;
    padding-right: 6px;
  }
  
  .color-btn {
    width: 12px;
    height: 12px;
  }
  
  .color-btn.small {
    width: 10px;
    height: 10px;
  }
  
  .effect-btn {
    padding: 4px 8px;
    font-size: 9px;
  }
  
  .thumb {
    height: auto;
  }
  
  .meta {
    padding: 8px 14px 10px;
    height: 50px;
  }
  
  .dot {
    width: 8px;
    height: 8px;
  }
  
  .hero .stats {
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .hero .tags {
    gap: 8px;
  }
  
  .tag {
    font-size: 9px;
    padding: 4px 8px;
  }
  

}

/* Loading experience: keep thumbnail visible until video is ready */
.card.is-hovering:not(.is-ready) .thumb img {
  opacity: 1;
  transform: scale(1.05);
  filter: brightness(0.85) contrast(1.1) saturate(1.1);
}

.card.is-hovering:not(.is-ready) .thumb video {
  opacity: 0;
  transform: scale(1.1);
}

.card.is-hovering.is-ready .thumb img {
  opacity: 0;
  transform: scale(1);
  filter: brightness(0.8) contrast(1.05);
}

.card.is-hovering.is-ready .thumb video {
  opacity: 1;
  transform: scale(1);
  filter: brightness(1) contrast(1.2) saturate(1.3);
}

/* Glassmorphism loading spinner overlay */
.thumb .loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card.is-hovering.is-loading .thumb .loader {
  opacity: 1;
}

.loader-glass {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
}

.loader-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 60%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(50% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(50% - 3px), #000 0);
  animation: loaderSpin 1s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* Video Modal Styles */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-modal.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  animation: backdropFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-modal.closing .modal-backdrop {
  animation: backdropFadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes backdropFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.modal-content {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
  animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-modal.closing .modal-content {
  animation: modalSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
}

.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1002;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.modal-close:hover {
  background: rgba(255, 107, 53, 0.3);
  border-color: var(--accent);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 30px rgba(255, 107, 53, 0.4);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.modal-video-container {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.modal-video-container video {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 20px;
}

/* Mobile adjustments for modal */
@media (max-width: 840px) {
  .modal-content {
    max-width: 95vw;
    max-height: 80vh;
  }
  
  .modal-close {
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
  }
  
  .modal-close svg {
    width: 18px;
    height: 18px;
  }
  
  .modal-video-container video {
    max-width: 95vw;
    max-height: 80vh;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 98vw;
    max-height: 70vh;
  }
  
  .modal-close {
    top: -8px;
    right: -8px;
    width: 36px;
    height: 36px;
  }
  
  .modal-close svg {
    width: 16px;
    height: 16px;
  }
  
  .modal-video-container video {
    max-width: 98vw;
    max-height: 70vh;
  }
}

