/* Andrea Bolognino — portfolio
   Minimal, image-forward, editorial. */

:root {
  --bg: #f6f4f0;
  --ink: #161513;
  --muted: #6f6a63;
  --line: #e0dcd4;
  --accent: #161513;
  --maxw: 1180px;
  --serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(246, 244, 240, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  text-decoration: none;
}
.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.4rem);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.site-nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.site-nav a:hover { color: var(--ink); }

/* Works dropdown */
.has-sub { position: relative; }
.works-link .caret { font-size: 0.7em; display: inline-block; transition: transform .2s; }
.submenu {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  position: absolute;
  top: 100%;
  margin-top: 0.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 260px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 60;
}
.has-sub:hover .submenu,
.has-sub:focus-within .submenu,
.submenu.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.has-sub:hover .caret,
.has-sub:focus-within .caret,
.works-link[aria-expanded="true"] .caret { transform: rotate(180deg); }
.submenu li { margin: 0; }
.submenu a {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.submenu a:hover { background: rgba(0,0,0,.04); }
.submenu a .yr { color: #b3ada3; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 56vh;
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid var(--line);
}
.hero-title {
  font-size: clamp(2.6rem, 8vw, 6.2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.02;
}
.hero-sub {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 1.4rem 0 0;
}

/* ---------- Sections ---------- */
.section-label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 1.4rem;
}

.statement {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 5vw, 2rem);
}
.statement-body p {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.62;
  margin: 0 0 1.3rem;
}
.statement-body p:last-child { margin-bottom: 0; }

/* ---------- Project index ---------- */
.project-index {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 5vw, 3rem) 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  border-top: 1px solid var(--line);
  padding-top: 2.2rem;
}
.project-index a {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.project-index a:hover { color: var(--ink); border-color: var(--ink); }
.project-index a .yr { color: #b3ada3; margin-left: 0.35rem; }

/* ---------- Works / projects ---------- */
.works { max-width: var(--maxw); margin: 0 auto; padding: 2rem clamp(1.2rem, 5vw, 3rem) 4rem; }

.project { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.project:first-child { border-top: none; }

.project-head { max-width: 740px; margin-bottom: 2.4rem; }
.project-title {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 500;
  margin: 0 0 0.3rem;
  line-height: 1.1;
}
.project-title .year {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-weight: 400;
}
.project-subtitle { font-style: italic; color: var(--muted); margin: 0.1rem 0 0.6rem; }
.project-venue {
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0.2rem 0;
}
.project-curator { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin: 0.1rem 0; font-style: italic; }
.project-summary { margin-top: 1.3rem; }
.project-summary p { margin: 0 0 1rem; }
.project-summary p:last-child { margin-bottom: 0; }
.project-credits {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a39d93;
  margin-top: 1.4rem;
}

/* gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.8rem, 2vw, 1.6rem);
}
.gallery.cols-1 { grid-template-columns: 1fr; }
figure.work { margin: 0; cursor: zoom-in; }
figure.work .frame {
  background: #fff;
  border: 1px solid var(--line);
  padding: clamp(0.6rem, 1.5vw, 1.2rem);
  overflow: hidden;
}
figure.work img {
  width: 100%;
  height: auto;
  transition: transform .5s ease;
}
figure.work:hover img { transform: scale(1.02); }
figure.work figcaption {
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
figure.work figcaption .wt { color: var(--ink); font-style: italic; }

/* ---------- Contact ---------- */
.contact {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 5vw, 2rem);
  border-top: 1px solid var(--line);
}
.contact p { margin: 0 0 0.8rem; }
.contact a { text-underline-offset: 3px; }
.contact-pdf { font-family: var(--sans); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem clamp(1.2rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 19, 17, 0.94);
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.open { display: flex; }
.lb-figure { margin: 0; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lb-img { max-width: 92vw; max-height: 78vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-caption {
  color: #d8d4cc;
  font-family: var(--sans);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 1rem;
  max-width: 60ch;
}
.lb-caption .wt { color: #fff; font-style: italic; }
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2.4rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity .2s;
  padding: 0.5rem 1rem;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-close { top: 0.6rem; right: 1rem; font-size: 2.8rem; }
.lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); font-size: 3.5rem; }
.lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); font-size: 3.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  body { font-size: 17px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .site-nav.open { max-height: 90vh; overflow-y: auto; }
  .site-nav > a,
  .has-sub > .works-link { padding: 0.9rem clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--line); display: block; }
  .has-sub { position: static; }
  /* submenu becomes a static, indented inline list on mobile */
  .submenu,
  .submenu.open {
    position: static;
    transform: none;
    left: auto;
    margin-top: 0;
    opacity: 1;
    visibility: visible;
    min-width: 0;
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    background: rgba(0,0,0,.03);
  }
  .submenu { max-height: 0; }
  .submenu.open { max-height: 70vh; overflow-y: auto; }
  .submenu a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.15rem;
    white-space: normal;
    padding: 0.7rem clamp(2rem, 8vw, 4rem);
  }
  .submenu a .yr { font-size: 0.72rem; }
  /* Neutralize the desktop centering transform (translateX(-50%)) that
     .has-sub:hover/.focus-within/.submenu.open apply — on mobile the
     submenu is full-width, so that same transform pushed it half its
     own width off-screen to the left, cropping every title. */
  .has-sub:hover .submenu,
  .has-sub:focus-within .submenu,
  .submenu.open {
    transform: none;
  }
  .gallery { grid-template-columns: 1fr; }
}
