/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #0e0e0e;
  --bg-2: #161616;
  --bg-3: #1f1f1f;
  --fg: #f0ede8;
  --fg-2: #a8a39c;
  --fg-3: #6b6660;
  --accent: #f0ede8;
  --border: rgba(255,255,255,0.08);
  --tag-bg: rgba(255,255,255,0.06);
  --tag-fg: #a8a39c;
  --nav-h: 64px;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f7f5f2;
  --bg-2: #efecea;
  --bg-3: #e5e2de;
  --fg: #1a1816;
  --fg-2: #5a5652;
  --fg-3: #9a9590;
  --accent: #1a1816;
  --border: rgba(0,0,0,0.08);
  --tag-bg: rgba(0,0,0,0.05);
  --tag-fg: #5a5652;
}

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

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s var(--ease);
}

.nav-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-right a {
  font-size: 0.875rem;
  color: var(--fg-2);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-right a:hover { color: var(--fg); }

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.theme-toggle:hover { background: var(--bg-3); }

.theme-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--fg-2);
  position: relative;
  transition: all 0.3s var(--ease);
}

[data-theme="dark"] .theme-icon {
  background: transparent;
  box-shadow: inset 5px -3px 0 0 var(--fg-2);
  border-color: var(--fg-2);
}

[data-theme="light"] .theme-icon {
  background: var(--fg-2);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--fg-3);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 80px) 40px 120px;
}

.hero-inner { max-width: 1120px; margin: 0 auto; width: 100%; }

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 40px;
  color: var(--fg);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  color: var(--fg-2);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 60px;
}

.about-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-top: 6px;
}

.about-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.about-body p {
  color: var(--fg-2);
  margin-bottom: 20px;
  font-size: 1rem;
  max-width: 640px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.skills span {
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  margin-bottom: 60px;
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.section-note {
  margin-top: 8px;
  color: var(--fg-3);
  font-size: 0.9rem;
}

/* ============================================================
   FEATURED WORK
   ============================================================ */
.work {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.featured-grid {
  display: flex;
  flex-direction: column;
  gap: 100px;
}

.work-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.work-item:nth-child(even) { direction: rtl; }
.work-item:nth-child(even) > * { direction: ltr; }

.work-images {
  position: relative;
}

.work-img-primary {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-3);
  cursor: pointer;
  transition: opacity 0.2s;
}

.work-img-primary:hover { opacity: 0.9; }

.work-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-3);
  border-radius: 4px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.work-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.work-thumb {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  background: var(--bg-3);
}

.work-thumb:hover, .work-thumb.active { opacity: 1; }

.work-info { padding-top: 8px; }

.work-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.work-year {
  font-size: 0.8rem;
  color: var(--fg-3);
}

.work-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.work-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  border: 1px solid var(--border);
}

.work-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--fg);
}

.work-description {
  color: var(--fg-2);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 480px;
}

.work-loading {
  color: var(--fg-3);
  font-size: 0.9rem;
  padding: 40px 0;
}

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive {
  padding: 80px 0 120px;
  border-top: 1px solid var(--border);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.archive-item {
  background: var(--bg-2);
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}

.archive-item:hover { border-color: var(--fg-3); }

.archive-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-3);
  cursor: pointer;
}

.archive-img-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.archive-info {
  padding: 16px 20px 20px;
}

.archive-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.archive-year {
  font-size: 0.75rem;
  color: var(--fg-3);
}

.archive-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 6px;
}

.archive-desc {
  font-size: 0.82rem;
  color: var(--fg-3);
  line-height: 1.5;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.contact-email {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  color: var(--fg-2);
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

.contact-email:hover { color: var(--fg); }

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

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

.footer span {
  font-size: 0.8rem;
  color: var(--fg-3);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  font-size: 2rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
  line-height: 1;
}

.lightbox-close:hover { color: #fff; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: rgba(255,255,255,0.5);
  padding: 16px;
  transition: color 0.2s;
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover, .lightbox-next:hover { color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .nav { padding: 0 24px; }
  .hero { padding: calc(var(--nav-h) + 60px) 24px 80px; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .work-item {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .work-item:nth-child(even) { direction: ltr; }

  .nav-right a { display: none; }
}
