:root {
  --bg: #f9f8f6;
  --surface: rgba(255, 255, 255, 0.6);
  --text: #1a1a1a;
  --text-muted: #66625e;
  --accent: #a69076;
  --accent-glow: rgba(166, 144, 118, 0.15);
  --transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: rgba(30, 30, 30, 0.6);
  --text: #eae8e4;
  --text-muted: #a09d9a;
  --accent: #d4af37;
  --accent-glow: rgba(212, 175, 55, 0.1);
}

[data-theme="colorful"] {
  --bg: #1a1a2e;
  --surface: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --accent: #ff007f;
  --accent-glow: rgba(255, 0, 127, 0.3);
  background: linear-gradient(45deg, #1a1a2e, #16213e, #0f3460, #533483);
  background-size: 400% 400%;
  animation: mesh-gradient 15s ease infinite;
}

@keyframes mesh-gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
  min-height: 100vh;
}

/* --- GLOW & CURSOR --- */
#cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease;
}

#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
}

/* --- NAV --- */
nav {
  padding: 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  width: 90%;
  left: 5%;
  top: 2rem;
  z-index: 1000;
  background: var(--surface);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  transition: var(--transition);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo svg {
  height: 30px;
  stroke: var(--text);
  fill: none;
}
.logo a {
  color: inherit;
}
.nav-links {
  display: flex;
  gap: 3rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: var(--transition);
}
.nav-links a:hover {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.lang-switch {
  display: flex;
  gap: 0.5rem;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  padding-right: 1.5rem;
}
[data-theme="dark"] .lang-switch,
[data-theme="colorful"] .lang-switch {
  border-color: rgba(255, 255, 255, 0.1);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: 0.3s;
}
.lang-btn.active {
  color: var(--accent);
  font-weight: 600;
}

.theme-container {
  position: relative;
  display: flex;
  align-items: center;
}
.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  position: relative;
}
.theme-tooltip {
  position: absolute;
  top: 130%;
  right: 0;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.65rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.3s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
  pointer-events: none;
}
.theme-container:hover .theme-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.theme-toggle:hover {
  transform: scale(1.1);
  color: var(--accent);
}
.theme-toggle svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

@keyframes rainbow-stroke {
  0% {
    color: #ff0000;
  }
  20% {
    color: #ff00ff;
  }
  40% {
    color: #0000ff;
  }
  60% {
    color: #00ffff;
  }
  80% {
    color: #00ff00;
  }
  100% {
    color: #ff0000;
  }
}
[data-theme="colorful"] .theme-toggle svg {
  animation: rainbow-stroke 3s linear infinite;
}

/* --- HERO --- */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 10%;
  position: relative;
}
.hero-content {
  z-index: 10;
  max-width: 900px;
}
.hero-name {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}
.hero h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: 2rem;
}
.hero h2 em {
  font-style: italic;
  font-weight: 400;
}

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--text);
  animation: scroll-anim 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes scroll-anim {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(300%);
  }
}

/* --- SECTIONS --- */
section {
  padding: 10rem 10%;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
}
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 1.5rem;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.glass-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.8);
}
.img-container {
  width: 100%;
  aspect-ratio: 16/10;
  background: #eae8e4;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}
.img-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-position: center;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-card:hover .img-container img {
  transform: scale(1.05);
}

[data-theme="colorful"] .img-container {
  background: rgba(255, 255, 255, 0.1);
}

/* --- ABOUT SECTION & PHOTO BOX --- */
.about-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 6rem;
  align-items: center;
}
.about-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.photo-box {
  width: 320px;
  height: 400px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 40px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.photo-inner {
  position: absolute;
  inset: 15px;
  border-radius: 30px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.photo-badge {
  position: absolute;
  bottom: 30px;
  right: -20px;
  background: var(--accent);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}
.stat-item h4 {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  color: var(--accent);
}
.stat-item p {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* --- FOOTER --- */
footer {
  padding: 6rem 10% 4rem 10%;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}
.social-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: 0.3s;
}
.social-links a:hover {
  color: var(--accent);
}
.social-links svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.footer-legal-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}
.legal-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: none;
  border: none;
  font-family: inherit;
  transition: 0.3s;
  padding: 0.5rem;
}
.legal-link:hover {
  color: var(--accent);
}

/* --- REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- MODAL (Legal) --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.4s ease;
  padding: 2rem;
}
.modal.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg);
  color: var(--text);
  width: 100%;
  max-width: 800px;
  max-height: 80vh;
  border-radius: 40px;
  padding: 3rem;
  position: relative;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
}
.modal-body h2 {
  font-family: "Playfair Display";
  margin-bottom: 2rem;
  color: var(--accent);
}
.modal-body h3 {
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.modal-body p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }
  .about-content {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
  .about-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  nav {
    width: 95%;
    left: 2.5%;
    padding: 1rem 1.5rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  #cursor-glow,
  #cursor-dot {
    display: none;
  }
  body {
    cursor: auto;
  }
  .photo-box {
    width: 260px;
    height: 320px;
  }
  .social-links {
    gap: 1.5rem;
  }
  .modal-content {
    padding: 2rem 1.5rem;
  }
  .footer-legal-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
}
