*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text-primary: #000000;
  --text-muted: #737373;
  --border: #e8e8e8;
  --accent: #888888;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--text-primary);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover {
  opacity: 0.6;
}

/* ── Sidebar (Desktop) ─────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-inner {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 24px;
}
.sidebar-name:hover {
  opacity: 1;
}

.sidebar-nav {
  margin-bottom: 24px;
}

.nav-group-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.nav-link {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  padding: 6px 0;
  padding-left: 12px;
}
.nav-link:hover {
  opacity: 1;
  color: var(--accent);
}
.nav-link.active {
  color: var(--accent);
}

.sidebar-social {
  margin-top: auto;
  padding-top: 32px;
}
.sidebar-social a {
  color: var(--text-primary);
}
.sidebar-social a:hover {
  opacity: 0.5;
}

/* ── Mobile Toggle ─────────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* ── Content Area ──────────────────────────────────────── */
.content {
  margin-left: 280px;
  min-height: 100vh;
}

.page {
  display: none;
}
.page.active {
  display: block;
}

/* ── Home (Hero) ───────────────────────────────────────── */
.hero-image {
  width: 100%;
  height: 100vh;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.4);
}

/* ── Work (Gallery) ────────────────────────────────────── */
.section-title {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 40px 40px 32px 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 40px 40px 0;
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}
.gallery-item:hover img {
  opacity: 0.85;
}

.gallery-item-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f5f5f5;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item-placeholder svg {
  width: 30%;
  height: auto;
  max-width: 80px;
  opacity: 0.3;
}

/* ── Text Pages (About, Contact) ───────────────────────── */
.text-page {
  max-width: 620px;
  padding: 40px 40px 40px 0;
}

.text-page .section-title {
  text-align: left;
  padding: 0 0 32px 0;
}

.text-content p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.text-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Lightbox ──────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  left: 24px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
}
.lightbox-close:hover {
  opacity: 0.5;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 20px;
}
.lightbox-prev {
  left: 24px;
}
.lightbox-next {
  right: 24px;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--text-primary);
}

.lightbox-content {
  max-width: 60vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.lightbox-meta {
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.lightbox-meta .meta-title {
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: block;
  }

  .content {
    margin-left: 0;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px 20px 0;
  }

  .section-title {
    padding: 24px 20px 24px 0;
  }

  .text-page {
    padding: 24px 20px;
  }

  .lightbox-content {
    max-width: 90vw;
  }

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

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
    padding: 0 16px 16px 0;
  }
}
