:root {
  --primary: #d4af37;
  --primary-dark: #b8860b;
  --accent: #e74c3c;
  --accent-light: #f39c12;
  
  --bg-light: #0a0e27;
  --bg-light-2: #111a3a;
  --bg-light-3: #1a2555;
  
  --text-light: #f5f5f5;
  --text-muted: #b0b0b0;
  
  --panel-light: #151d3a;
  --border-light: #2d3d5f;
  
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body[data-theme='light'] {
  --bg-light: #0d1330;
  --bg-light-2: #121c45;
  --bg-light-3: #1b2961;

  --text-light: #eef2ff;
  --text-muted: #adb9dd;

  --panel-light: #15204d;
  --border-light: #304283;

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-light);
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-light-2) 100%);
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bebas Neue', 'Playfair Display', serif;
  letter-spacing: 0.05em;
  font-weight: 700;
}

p {
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Animated Background */
.card-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.floating-card {
  position: absolute;
  width: 150px;
  height: 200px;
  left: var(--x);
  top: var(--y);
  opacity: 0.06;
  animation: float 26s ease-in-out infinite;
  animation-delay: var(--delay);
}

.card-front {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  opacity: 0.55;
  filter: saturate(0.85) brightness(0.75);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(5deg); }
  66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.grain-overlay {
  display: none;
}

.page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header/Navigation */
.topbar {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0 0 12px 12px;
  background: var(--panel-light);
  box-shadow: var(--shadow-sm);
  width: 100vw;
  margin: 0 0 20px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(20px, calc((100vw - 1200px) / 2 + 20px));
  padding-right: max(20px, calc((100vw - 1200px) / 2 + 20px));
}

body[data-theme='light'] .topbar {
  background: var(--panel-light);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 28px;
  margin: 0;
  color: var(--primary);
  letter-spacing: 0.15em;
  line-height: 1;
}

.brand-subtitle {
  font-size: 12px;
  margin: 2px 0 0 0;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-left: auto;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--primary);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
  stroke: currentColor;
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: var(--text-light);
  transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 60px 0;
  animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  margin: 0 0 20px 0;
  color: var(--text-light);
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 30px 0;
  line-height: 1.8;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-light) 100%);
  color: #000;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.button-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.button-secondary {
  border-color: var(--border-light);
  color: var(--text-light);
  background: transparent;
}

.button-secondary:hover {
  border-color: var(--primary);
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.card-display {
  perspective: 1200px;
}

.card-stack {
  position: relative;
  width: 200px;
  height: 280px;
}

.card-slot {
  position: absolute;
  inset: 0;
  transform:
    translateX(calc(var(--index) * 12px))
    translateY(calc(var(--index) * 12px))
    rotateZ(calc(var(--index) * 8deg));
  transition: transform 0.25s ease;
  z-index: calc(20 + var(--index));
}

.card-slot:hover {
  transform:
    translateX(calc(var(--index) * 12px))
    translateY(calc(var(--index) * 12px - 18px))
    rotateZ(calc(var(--index) * 8deg));
}

.card-image {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: none;
  transition: transform 0.2s ease;
  object-fit: contain;
  backface-visibility: hidden;
  will-change: transform;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
  animation: heroCardFloatY 3.2s ease-in-out infinite;
  animation-delay: calc(var(--index) * 0.35s);
}

@keyframes heroCardFloatY {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 40px 0;
  margin: 40px 0;
}

.stat-item {
  padding: 30px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(21, 29, 58, 0.5);
  text-align: center;
  animation: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 40px;
  animation: none;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 12px 0;
  color: var(--primary);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
}

/* Features Section */
.features-section {
  padding: 60px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 30px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(21, 29, 58, 0.5);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  background: rgba(21, 29, 58, 0.8);
}

.feature-icon {
  display: none;
}

.feature-card h4 {
  font-size: 1.3rem;
  margin: 0 0 12px 0;
  color: var(--primary);
}

.feature-card p {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Gallery Section */
.showcase-section {
  padding: 60px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.about-hero-wrap {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  align-items: center;
}

.about-profile-image {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.gallery-placeholder {
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, var(--panel-light) 0%, var(--bg-light-2) 100%);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: bold;
  color: var(--primary);
}

.gallery-item:hover .gallery-placeholder {
  transform: scale(1.05);
  background: linear-gradient(135deg, var(--bg-light-3) 0%, var(--panel-light) 100%);
}

.gallery-item h4 {
  font-size: 1.2rem;
  margin: 0;
  padding: 20px 20px 8px;
  color: var(--primary);
}

.gallery-item p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0 20px 20px;
}

/* Tech Section */
.tech-section {
  padding: 60px 0;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.tech-item {
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(21, 29, 58, 0.5);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  min-height: 128px;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  line-height: 1;
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.tech-tag:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--primary);
}

.screenshot-placeholder {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(21, 29, 58, 0.95) 0%, rgba(10, 14, 39, 0.95) 100%);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Footer */
.footer {
  margin-top: 80px;
  padding: 40px 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
}

.footer p {
  margin: 0 0 16px 0;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Animation helper */
.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Advanced Animations */
@keyframes glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(212, 175, 55, 0), 0 10px 30px rgba(0, 0, 0, 0.3);
  }
  50% { 
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4), 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes cardFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* Premium card hover effects */
.feature-card:hover {
  box-shadow: 0 20px 50px rgba(212, 175, 55, 0.2);
}

.button-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

.button-primary:hover::before {
  left: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-hero-wrap {
    grid-template-columns: 1fr;
  }

  .about-profile-image {
    width: 140px;
    height: 140px;
  }

  .hero-visual {
    padding: 20px;
  }

  .site-nav {
    display: none;
  }

  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    gap: 12px;
    padding: 16px;
    background: rgba(21, 29, 58, 0.95);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-top: 8px;
    z-index: 1000;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
    order: 0;
  }

  .topbar {
    flex-wrap: wrap;
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar-actions {
    margin-left: 8px;
  }

  .features-grid,
  .gallery-grid,
  .tech-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2rem;
  }

  .stats-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .card-stack {
    width: 150px;
    height: 210px;
  }

  .card-image {
    width: 100% !important;
    height: 100% !important;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .stats-section {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 16px;
    gap: 12px;
  }

  .brand-title {
    font-size: 20px;
  }

  .site-nav {
    gap: 6px 10px;
    font-size: 0.85rem;
  }
}