:root {
  --ink: #161616;
  --muted: #5f5a52;
  --line: rgba(22, 22, 22, 0.18);
  --frame: #fbfaf7;
  --bg: #d6dfd0;
}
:root[data-theme="yellow"] { --bg: #efe3b8; --frame: #fbf8ee; }
:root[data-theme="pink"]   { --bg: #ecd5d0; --frame: #fbf6f4; }
:root[data-theme="green"]  { --bg: #d6dfd0; --frame: #f7f9f5; }
:root[data-theme="gold"]   { --bg: #d4b768; --frame: #fbf7ec; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  transition: background 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.wordmark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}
.site-header nav { display: flex; gap: 1.75rem; }
.site-header .theme-picker { margin-left: auto; margin-right: 2.5rem; }
.site-header nav a {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-header nav a:hover { border-bottom-color: var(--ink); }

.hero {
  padding: clamp(5rem, 14vh, 9rem) clamp(1.25rem, 4vw, 3rem) clamp(3rem, 8vh, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(4.5rem, 15vw, 12rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem -0.04em;
}
.hero-sub {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 1.5rem;
}
.hero-meta {
  display: flex;
  gap: 2rem;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

main { padding: 0 clamp(1.25rem, 4vw, 3rem); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2.5rem 0 2rem;
}
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0;
}

.filters { display: flex; gap: 1.5rem; }
.filter {
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  cursor: pointer;
}
.filter:hover { color: var(--ink); }
.filter.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  padding-bottom: 5rem;
}

.work {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.work .frame {
  background: var(--frame);
  padding: clamp(0.9rem, 2.5vw, 1.6rem);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.work:hover .frame, .work:focus-visible .frame {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 20px 44px rgba(0,0,0,0.12);
}
.work:focus-visible { outline: none; }
.work img {
  display: block;
  width: 100%;
  height: auto;
  background: #eee;
}
.work figcaption { margin-top: 0.9rem; }
.work .title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
}
.work .details {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.1rem;
}

.empty { color: var(--muted); padding-bottom: 5rem; }

.about {
  border-top: 1px solid var(--line);
  padding: 3rem 0 5rem;
  max-width: 60ch;
}
.about h2 { margin-bottom: 1rem; }
.about p {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.site-footer p { margin: 0; }

.theme-picker { display: flex; align-items: center; gap: 0.6rem; }
.theme-picker span { letter-spacing: 0.12em; text-transform: uppercase; margin-right: 0.2rem; }
.theme-picker button {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
}
.theme-picker button[data-theme-pick="yellow"] { background: #efe3b8; }
.theme-picker button[data-theme-pick="pink"]   { background: #ecd5d0; }
.theme-picker button[data-theme-pick="green"]  { background: #d6dfd0; }
.theme-picker button[data-theme-pick="gold"]   { background: #d4b768; }
.theme-picker button.is-active { outline: 2px solid var(--ink); outline-offset: 2px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(14, 13, 12, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  margin: 0;
  max-width: min(1100px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #f4f1ea;
  text-align: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #fff;
}
.lightbox figcaption { margin-top: 1.1rem; }
#lb-title {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.6rem;
}
#lb-details { display: block; font-size: 0.78rem; letter-spacing: 0.1em; opacity: 0.7; margin-top: 0.15rem; }
#lb-note { margin: 0.6rem 0 0; max-width: 60ch; opacity: 0.85; font-size: 0.9rem; }

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #f4f1ea;
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  padding: 0.6rem 1rem;
  opacity: 0.75;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 0.75rem; right: 1rem; font-size: 2.2rem; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }

@media (max-width: 600px) {
  .site-header { padding: 0.9rem 1.25rem; }
  .site-header nav { gap: 1rem; }
  .site-header .theme-picker { margin-right: 1.25rem; }
  .theme-picker span { display: none; }
  .hero-meta { gap: 1.2rem; }
  .lb-nav { top: auto; bottom: 1rem; transform: none; }
}

.work[hidden] { display: none; }
