:root {
  --bg: #070707;
  --bg-soft: #101010;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --text: #f5f1e8;
  --muted: #b9b0a1;
  --accent: #d4af37;
  --accent-soft: rgba(212, 175, 55, 0.16);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f5f1e8;
  --bg-soft: #fdf8ef;
  --card: rgba(10, 10, 10, 0.04);
  --card-strong: rgba(10, 10, 10, 0.08);
  --text: #121212;
  --muted: #4d4d4d;
  --accent: #8b6a1b;
  --accent-soft: rgba(139, 106, 27, 0.14);
  --border: rgba(10, 10, 10, 0.1);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top, rgba(212, 175, 55, 0.12), transparent 30%), var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 6rem 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(7, 7, 7, 0.72);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: rgba(245, 241, 232, 0.8);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.hero {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding-top: 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.7rem;
}

.hero-text, .card p, .about-card p, .site-footer p, .contact-links a {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.btn-secondary,
.btn-ghost {
  background: transparent;
  color: var(--text);
}

.portrait-card,
.card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.portrait-card {
  border-radius: 2rem;
  padding: 1rem;
  overflow: hidden;
}

.portrait-card img {
  height: 580px;
  width: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 1.4rem;
  transform: translateZ(0);
}

.card {
  border-radius: 1.4rem;
  padding: 1.4rem;
}

.about-grid,
.cards-grid,
.skills-grid {
  display: grid;
  gap: 1.2rem;
}

.about-grid {
  grid-template-columns: repeat(2, 1fr);
}

.cards-grid {
  grid-template-columns: repeat(2, 1fr);
}

.skills-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.skill-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-strong);
  text-align: center;
}

.project-card img {
  height: 220px;
  width: 100%;
  object-fit: cover;
  border-radius: 1rem;
  margin-bottom: 0.9rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.gallery-card {
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.gallery-card img {
  height: 240px;
  width: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 1rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  transform: translateZ(0);
}

.gallery-card:hover img {
  transform: scale(1.03);
}

.gallery-card figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.philosophy-card {
  max-width: 860px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.5rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.timeline {
  position: relative;
  padding-left: 1.4rem;
  margin-top: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

.timeline-dot {
  position: absolute;
  left: -0.2rem;
  top: 1rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-card {
  margin-left: 0.3rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-links a {
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-strong);
}

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.theme-toggle,
.back-to-top {
  position: fixed;
  right: 1.2rem;
  z-index: 30;
  border: none;
  cursor: pointer;
  color: var(--text);
  background: var(--card-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.theme-toggle {
  top: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.back-to-top {
  bottom: 1.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #fff);
  z-index: 40;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .about-grid,
  .cards-grid,
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .section {
    padding: 4rem 0;
  }

  .about-grid,
  .cards-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .portrait-card img {
    height: 420px;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
