:root {
  --bg-core: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --border: #334155;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-code: 'JetBrains Mono', monospace;
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
}

.layout-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.5rem;
}

.name {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 0.75rem 0;
  color: white;
  letter-spacing: -0.02em;
}

.role-badge {
  display: inline-block;
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-family: var(--font-code);
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(129, 140, 248, 0.2);
}

.bio {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.skills-section {
  margin-bottom: 1.5rem;
}

.section-label {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-list li {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
}

.settings-section {
  width: 100%;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 36px;
  height: 20px;
  background-color: var(--border);
  border-radius: 20px;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked+.slider {
  background-color: var(--accent);
}

input:checked+.slider::before {
  transform: translateX(16px);
}

.toggle-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.animations-disabled *,
.animations-disabled *::before,
.animations-disabled *::after {
  animation: none !important;
  transition: none !important;
}

.social-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.icon-group {
  display: flex;
  gap: 0.75rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.2s;
  text-decoration: none;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.icon-btn:hover {
  background: var(--bg-sidebar);
  color: white;
  border-color: var(--text-muted);
}

/* --- MAIN CONTENT (Slider Wrapper) --- */
.main-content {
  overflow: hidden;
  padding: 0;
  position: relative;
  background-color: var(--bg-core);
  height: 100vh;
}

.filter-bar {
  position: absolute;
  top: 0;
  left: 4rem;
  right: 4rem;
  z-index: 100;
  background: transparent;
  padding: 2rem 0;
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s;
}

.filter-btn:hover {
  color: white;
}

.filter-btn.active {
  color: var(--accent);
}

/* --- THE STAGGERED SLIDER (- _ -) --- */
.project-grid {
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  display: flex;
  flex-direction: column;
}

.project-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 0 6rem;
}

.card-slot {
  flex: 0 1 360px;
  /* flex: 0 1 432px; */
  display: flex;
  flex-direction: column;
}

/* Staggered Pattern: High, Low, High (- _ -) */
.project-slide .card-slot:nth-child(2) {
  margin-top: 120px;
}

.project-slide .card-slot:nth-child(1),
.project-slide .card-slot:nth-child(3) {
  margin-top: -80px;
}

.project-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.4s var(--ease-smooth),
    filter 0.6s ease,
    opacity 0.6s ease,
    border-color 0.3s;
  cursor: pointer;
  opacity: 0;
  will-change: transform;
}

/* --- FOG OF WAR (Selection Screen) --- */
.project-card.fog-locked {
  filter: grayscale(1) blur(2px) brightness(0.6);
  opacity: 0.5 !important;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
}

@keyframes revealPop {
  0% {
    transform: scale(0.95) translateY(10px);
  }

  65% {
    transform: scale(1.05) translateY(-4px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

.project-card.revealed {
  filter: grayscale(0) blur(0) brightness(1);
  opacity: 1 !important;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  animation: revealPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  z-index: 5;
}

@keyframes giftBoxOpen {
  0% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }

  15% {
    transform: scale(0.98) rotate(0.5deg);
  }

  30% {
    transform: scale(0.96) rotate(-0.5deg);
  }

  45% {
    transform: scale(0.94) rotate(0.5deg);
  }

  60% {
    transform: scale(0.92) rotate(-0.5deg);
  }

  75% {
    transform: scale(0.9) rotate(0deg);
    filter: brightness(1.2);
  }

  100% {
    transform: scale(1.3);
    filter: brightness(1.6);
  }
}

.project-card.opening {
  animation: giftBoxOpen 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  z-index: 100;
  border-color: white;
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.4);
  pointer-events: none;
  opacity: 1;
}

/* Media Area */
.media-frame {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
}

.video-container {
  width: 100%;
  height: 100%;
}

.media-frame video,
.media-frame iframe,
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

/* Details */
.card-details {
  padding: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: white;
  font-family: var(--font-display);
}

.tags-wrapper {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  font-size: 0.65rem;
  font-family: var(--font-code);
  color: var(--accent);
  background: rgba(129, 140, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Pagination Dots */
.pagination-dots {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  z-index: 100;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 15px var(--accent);
}

.dot:hover {
  border-color: white;
}

.mini-footer {
  position: absolute;
  bottom: 1.5rem;
  right: 4rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  pointer-events: none;
}

/* Modal System */
@keyframes modalBackdropFade {
  from {
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0px);
  }

  to {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
  }
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
  animation: modalBackdropFade 0.35s ease-out forwards;
}

@keyframes modalZoomFromCard {
  0% {
    opacity: 0;
    transform: translate(calc(var(--origin-x) - 50vw), calc(var(--origin-y) - 50vh)) scale(0.2);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.modal-content {
  background: var(--bg-sidebar);
  width: 100%;
  max-width: 1100px;
  border-radius: 16px;
  border: 1px solid var(--border);
  position: relative;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
  transform-origin: center;
}

.modal.active .modal-content {
  animation: modalZoomFromCard 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-body {
  padding: 3rem;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 850px) {
  .modal {
    padding: 1rem;
    align-items: flex-start;
    /* Better for scrolling long content */
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .modal-media h2 {
    font-size: 1.75rem !important;
  }

  .modal-info p {
    font-size: 0.95rem !important;
  }

  .modal-info div {
    padding: 1rem !important;
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    font-size: 1.25rem;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-core);
  border: 1px solid var(--border);
  color: white;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Subtle Link Button */
.btn-subtle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 0.85rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: var(--text-muted);
}

@media (max-width: 1000px) {
  .layout-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  body {
    overflow: auto;
    height: auto;
  }

  .sidebar {
    padding: 2rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .main-content {
    height: auto;
    overflow: visible;
    padding: 1.5rem 1rem;
  }

  .filter-bar {
    position: relative;
    left: 0;
    right: 0;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
  }

  .project-slide {
    flex-direction: column;
    height: auto;
    gap: 1rem;
    padding: 0;
  }

  .card-slot {
    margin: 0 !important;
    flex: 1 1 auto;
    width: 100%;
  }

  .pagination-dots {
    display: none;
  }

  .mini-footer {
    position: static;
    margin-top: 3rem;
    padding-bottom: 2rem;
    text-align: center;
  }
}