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

:root {
  --bg:     #F5F2EC;
  --ink:    #2A2620;
  --muted:  #7A7368;
  --rule:   #D6D0C4;
  --accent: #8C6D4F;
  --serif:  'Cormorant Garamond', Georgia, serif;
  --sans:   'Karla', system-ui, sans-serif;
  --max:    1200px;
  --col:    clamp(2rem, 5vw, 5rem);
  --ease:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}

.site-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.75rem var(--col) 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.nav-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.site-nav.scrolled { border-color: var(--rule); }

/* ── Scroll reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Page wrapper ── */

.page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--col);
}

/* ── Page header ── */

.page-header {
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--rule);
}

.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
}

/* ── Masonry gallery ── */

.masonry {
  columns: 4;
  column-gap: 1.25rem;
  padding-bottom: 5rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.masonry-item-img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(100%);
  transition: filter 0.5s var(--ease);
}

.masonry-item:hover .masonry-item-img {
  filter: grayscale(0%);
}

.masonry-caption {
  margin-top: 0.45rem;
  padding-bottom: 0.2rem;
}

.masonry-title {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.3;
}

.masonry-meta {
  font-size: 0.63rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 0.1rem;
}

@media (max-width: 900px)  { .masonry { columns: 3; } }
@media (max-width: 600px)  { .masonry { columns: 2; } }
@media (max-width: 380px)  { .masonry { columns: 1; } }

/* ── Standard grid ── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem 2.5rem;
  padding-bottom: 5rem;
}

.item a { text-decoration: none; color: inherit; display: block; }

.item-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--rule);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.item-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: grayscale(100%);
  transition: filter 0.5s var(--ease);
}

.item:hover .item-img img { filter: grayscale(0%); }

.item-img.empty {
  display: flex; align-items: center; justify-content: center;
}

.item-img.empty span {
  font-family: var(--serif); font-size: 2rem;
  color: var(--muted); opacity: 0.3;
}

.item-title {
  font-family: var(--serif); font-size: 1rem;
  font-weight: 400; line-height: 1.3; margin-bottom: 0.2rem;
}

.item-meta { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.03em; }

/* ── Texts list ── */

.texts-list { display: flex; flex-direction: column; padding-bottom: 5rem; }

.text-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.text-entry:first-child { border-top: 1px solid var(--rule); }
.text-entry:hover .text-title { color: var(--accent); }

.text-title {
  font-family: var(--serif); font-size: 1.05rem;
  font-weight: 400; transition: color 0.25s;
}

.text-year { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* ── CV ── */

.cv-block { margin-top: 3rem; padding-bottom: 5rem; }
.cv-section { margin-top: 2.5rem; }

.cv-section-label {
  font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule);
}

.cv-entry {
  display: grid; grid-template-columns: 7rem 1fr;
  gap: 0.4rem 1.5rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule); font-size: 0.85rem;
}

.cv-entry:last-child { border-bottom: none; }
.cv-year { color: var(--muted); padding-top: 0.1em; white-space: nowrap; }

.cv-title {
  font-family: var(--serif); font-size: 1rem;
  font-weight: 400; line-height: 1.3; margin-bottom: 0.15rem;
}

.cv-place { color: var(--muted); font-size: 0.78rem; }

.cv-desc {
  grid-column: 2; color: var(--muted);
  font-size: 0.78rem; line-height: 1.6; margin-top: 0.25rem;
}

.cv-download {
  display: inline-block; margin-top: 2rem;
  font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--rule);
  padding-bottom: 0.1em; transition: border-color 0.25s;
}

.cv-download:hover { border-color: var(--ink); }

/* ── About ── */

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; margin-bottom: 1rem;
}

.about-bio { font-size: 0.92rem; line-height: 1.85; }
.about-bio p + p { margin-top: 1em; }

.about-contact { font-size: 0.85rem; color: var(--muted); }
.about-contact p { margin-bottom: 0.35em; }

.contact-label {
  font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); margin-top: 1.25rem; margin-bottom: 0.25rem;
}

.about-contact a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--rule); transition: border-color 0.25s;
}

.about-contact a:hover { border-color: var(--ink); }

/* ── Lightbox ── */

.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(30, 26, 22, 0.95); z-index: 100;
  align-items: center; justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img-wrap {
  max-width: 92vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 92vw; max-height: 88vh;
  width: auto; height: auto; display: block;
}

.lightbox-caption {
  position: fixed; bottom: 1.75rem; left: 50%;
  transform: translateX(-50%); text-align: center;
  color: rgba(245,242,236,0.55); font-size: 0.7rem;
  letter-spacing: 0.06em; white-space: nowrap;
}

.lightbox-caption strong {
  font-family: var(--serif); font-weight: 400; font-size: 0.9rem;
  color: rgba(245,242,236,0.88); display: block; margin-bottom: 0.15rem;
}

.lb-close, .lb-prev, .lb-next {
  position: fixed; background: none; border: none;
  color: rgba(245,242,236,0.35); cursor: pointer;
  font-family: var(--sans); font-weight: 300;
  transition: color 0.25s; padding: 0.75rem;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: rgba(245,242,236,0.9); }

.lb-close { top: 1.5rem; right: 2rem; font-size: 1.4rem; line-height: 1; }
.lb-prev  { left: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-next  { right: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 2rem; }

/* ── Footer ── */

footer {
  border-top: 1px solid var(--rule);
  padding: 1.75rem var(--col);
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

footer p { font-size: 0.65rem; color: var(--muted); letter-spacing: 0.05em; }

/* ── Responsive ── */

@media (max-width: 720px) {
  .site-nav-inner { flex-direction: column; gap: 1rem; }
  .nav-links { gap: 1.2rem; flex-wrap: wrap; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .text-entry { grid-template-columns: 1fr; }
  .text-year { display: none; }
  .cv-entry { grid-template-columns: 1fr; gap: 0.15rem; }
  .cv-desc { grid-column: 1; }
  .lb-prev { left: 0.25rem; }
  .lb-next { right: 0.25rem; }
}
