/* ================================================
   DESIGN TOKENS
   ================================================ */
:root {
  /* Colors */
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-surface: #0d1425;
  --accent: #c9a55c;
  --accent-light: #dfc07a;
  --accent-dark: #a8853d;
  --text-primary: #f1f0ec;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --white: #ffffff;
  --border: rgba(201, 165, 92, 0.15);
  --border-strong: rgba(201, 165, 92, 0.35);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --section-pad: clamp(80px, 10vw, 140px);
  --container-max: 1280px;
  --container-pad: clamp(20px, 4vw, 48px);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 0.6s;
}

/* ================================================
   RESET & BASE
   ================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ================================================
   LOADER
   ================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
}

.loader-bar {
  width: 120px;
  height: 2px;
  background: var(--bg-card);
  margin: 0 auto 20px;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar::after {
  content: '';
  position: absolute;
  left: -40%;
  top: 0;
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 2px;
  animation: loaderSlide 1s ease-in-out infinite;
}

@keyframes loaderSlide {
  0% { left: -40%; }
  100% { left: 100%; }
}

.loader-text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ================================================
   NAVIGATION
   ================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--container-pad);
  transition: background 0.4s, padding 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(10, 15, 26, 0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  transition: transform 0.3s var(--ease-spring);
}

.nav-logo:hover {
  transform: scale(1.08);
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 15, 26, 0.96);
  backdrop-filter: blur(30px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s;
}

.mobile-link:hover {
  color: var(--accent);
}

/* ================================================
   HERO
   ================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  animation: heroZoom 20s ease-in-out alternate infinite;
}

@keyframes heroZoom {
  0% { transform: scale(1.05); }
  100% { transform: scale(1.12); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(10, 15, 26, 0.92) 0%, rgba(10, 15, 26, 0.6) 50%, rgba(10, 15, 26, 0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  padding: 8px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  margin-bottom: 28px;
  background: rgba(201, 165, 92, 0.06);
}

.hero-title {
  margin-bottom: 24px;
}

.hero-title-line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 90px);
  font-weight: 800;
  line-height: 1.05;
  color: var(--white);
}

.hero-title-line.accent {
  color: var(--accent);
}

.hero-divider {
  width: 80px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 24px;
  border-radius: 3px;
}

.hero-name {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.hero-location {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stat {
  position: relative;
  padding-left: 20px;
}

.hero-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 3px;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.hero-stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  color: var(--accent);
}

.hero-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero-scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: 30px;
  background: var(--accent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { top: -30px; }
  100% { top: 60px; }
}

/* ================================================
   SECTION HEADERS
   ================================================ */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 20px auto 0;
  border-radius: 3px;
}

.section-header.light .section-title {
  color: var(--white);
}

/* ================================================
   ABOUT
   ================================================ */
.about {
  padding: var(--section-pad) 0;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.about::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201, 165, 92, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
}

.about-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.about-image-frame {
  position: absolute;
  top: 16px;
  left: 16px;
  right: -16px;
  bottom: -16px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  z-index: 0;
  opacity: 0.4;
}

.about-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.about-divider {
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
  margin-bottom: 24px;
}

.about-text {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.about-text strong {
  color: var(--accent-light);
  font-weight: 600;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 32px;
}

.skill-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.3s var(--ease-out);
}

.skill-tag:hover {
  border-color: var(--accent);
  background: rgba(201, 165, 92, 0.08);
  transform: translateY(-2px);
}

/* ================================================
   PROJECTS
   ================================================ */
.projects {
  padding: var(--section-pad) 0;
  background: var(--bg-primary);
}

.project {
  margin-bottom: 100px;
  padding-bottom: 100px;
  border-bottom: 1px solid var(--border);
}

.project:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.project-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  opacity: 0.6;
  flex-shrink: 0;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.project-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Meta */
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.meta-item {
  flex: 1;
  min-width: 180px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.meta-item:last-child {
  border-right: none;
}

.meta-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.project-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 800px;
  margin-bottom: 32px;
}

/* Comparison Section */
.project-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.comparison-box {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 16 / 10;
}

.comparison-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
  cursor: pointer;
}

.comparison-box:hover img {
  transform: scale(1.05);
}

.comparison-label {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  background: rgba(10, 15, 26, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
  pointer-events: none;
}

.comparison-label.after {
  background: rgba(201, 165, 92, 0.85);
  color: var(--bg-primary);
  border-color: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .project-comparison {
    grid-template-columns: 1fr;
  }
}

/* Gallery Grid */
.gallery-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  margin-top: 12px;
}

.gallery-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.gallery-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.project-gallery {
  display: grid;
  gap: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.project-gallery.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.project-gallery.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
  cursor: pointer;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 15, 26, 0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ================================================
   CONTACT
   ================================================ */
.contact {
  position: relative;
  padding: var(--section-pad) 0;
  overflow: hidden;
}

.contact-bg {
  position: absolute;
  inset: 0;
}

.contact-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 15, 26, 0.93) 0%, rgba(10, 15, 26, 0.82) 100%);
}

.contact-content {
  position: relative;
  z-index: 2;
}

.contact-text {
  text-align: center;
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-card {
  text-align: center;
  padding: 36px 24px;
  background: rgba(26, 34, 54, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease-out);
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(201, 165, 92, 0.1);
}

.contact-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.contact-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.contact-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

a.contact-value:hover {
  color: var(--accent);
}

/* ================================================
   FOOTER
   ================================================ */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ================================================
   LIGHTBOX
   ================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  transform: scale(0.9);
  transition: transform 0.4s var(--ease-out);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 40px;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10;
}

.lightbox-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  cursor: pointer;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.3s;
  z-index: 10;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  background: rgba(201, 165, 92, 0.2);
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* ================================================
   ANIMATIONS
   ================================================ */
[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-animate="fade-right"] {
  transform: translateX(-40px);
}

[data-animate="fade-left"] {
  transform: translateX(40px);
}

[data-animate].visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    height: 400px;
  }

  .contact-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }

  .project-gallery.grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-item {
    min-width: 140px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .project-main-image {
    max-height: 350px;
  }

  .project-main-image img {
    max-height: 350px;
  }
}

@media (max-width: 480px) {
  .project-gallery.grid-3,
  .project-gallery.grid-2 {
    grid-template-columns: 1fr;
  }

  .project-num {
    font-size: 36px;
  }

  .about-image {
    height: 300px;
  }

  .project-meta {
    flex-direction: column;
  }

  .meta-item {
    border-right: none;
  }
}

/* ================================================
   SELECTION & SCROLLBAR
   ================================================ */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}
