:root {
  --paper: #fafaf8;
  --ink: #16150f;
  --fog: #6b6a62;
  --line: rgba(22, 21, 15, 0.12);
  --lombardy: #4b5d46;
  --paros: #2e6e99;
  --venice: #a97434;
  --istanbul: #8c3232;
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --display: 'Archivo Expanded', 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2vw;
  padding: 26px 2.5vw;
  color: #fff;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.site-header.is-solid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.1) blur(6px);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.header-col { display: flex; }
.header-role, .header-location { padding-top: 2px; font-size: 1.105rem; font-weight: 600; }
.header-brand { flex-direction: column; gap: 2px; }
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.235rem;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease;
}
.brand-nav { display: flex; gap: 0.9rem; font-size: 0.884rem; }
.brand-nav a { font-weight: 600; opacity: 0.55; transition: opacity 0.2s ease; }
.header-contact { gap: 1rem; font-size: 1.105rem; font-weight: 600; padding-top: 2px; }
.header-contact a { transition: opacity 0.2s ease; }
.header-contact a { padding-bottom: 2px; border-bottom: 1px solid transparent; }
.header-contact a:hover { border-bottom-color: currentColor; }
.brand:hover, .header-contact a:hover { opacity: 0.5; }
.brand-nav a:hover { opacity: 1; }

/* ---------- preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.preloader-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
  color: var(--ink);
}
.preloader.is-hidden {
  opacity: 0;
  transform: translateY(60px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .preloader { transition: none; }
}

/* ================= HOME (filmstrip) ================= */
body.home { height: 100vh; overflow: hidden; }
.filmstrip {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  touch-action: pan-x;
}
.filmstrip::-webkit-scrollbar { display: none; }
.track { display: flex; align-items: flex-start; height: 20vh; gap: 5vw; padding: 0 2.5vw; }
.panel {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  display: block;
}
.panel img { display: block; height: 100%; width: auto; max-width: none; }
.panel-ph { width: 26vw; height: 100%; display: block; }
body.home .site-header { color: var(--ink); }
.panel-index {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.panel-index-name { opacity: 0; transition: opacity 0.2s ease; }
.panel:hover .panel-index-name, .panel:focus-visible .panel-index-name { opacity: 1; }
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background-color 0.2s ease;
  pointer-events: none;
}
.panel:hover::after, .panel:focus-visible::after { background: rgba(255, 255, 255, 0.18); }
.panel-empty { cursor: default; }
.panel-empty:hover::after { background: rgba(255, 255, 255, 0); }

.panel-end {
  flex: 0 0 auto;
  height: 100%;
  width: 12vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: opacity 0.2s ease;
}
.panel-end:hover { opacity: 0.55; }
.panel-end-arrow { font-size: 2.2rem; line-height: 1; }
.panel-end-text { margin-top: 0.7rem; font-size: 0.8rem; }

/* ---------- placeholder image blocks ---------- */
.ph {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 15px),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, #fff) 0%, color-mix(in srgb, var(--accent) 7%, #fff) 100%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.ph-label {
  font-size: 0.68rem;
  color: color-mix(in srgb, var(--accent) 60%, #16150f);
  background: rgba(255, 255, 255, 0.75);
  padding: 3px 7px;
}
.panel .ph-label { display: none; }
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= INTERIOR PAGES ================= */
body.page { margin: 0; }
.hero {
  position: relative;
  height: 92vh;
  overflow: hidden;
}
.hero .ph { position: absolute; }
.hero-copy {
  position: absolute;
  left: 2.5vw;
  bottom: 10vh;
  z-index: 2;
  color: #fff;
  max-width: 640px;
}
.hero-copy .kicker { font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); margin: 0 0 0.8rem; }
.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.96;
}
.hero-copy p {
  margin: 1.4rem 0 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 45%);
  z-index: 1;
}

.gallery {
  padding: 8vw 2.5vw;
  column-count: 3;
  column-gap: 2vw;
}
.gallery figure { margin: 0 0 2vw; break-inside: avoid; }
.gallery img { width: 100%; height: auto; }

.next-project {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6vw 2.5vw 8vw;
  border-top: 1px solid var(--line);
}
.next-project .label { font-size: 0.85rem; color: var(--fog); }
.next-project .name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 2.5vw;
  border-top: 1px solid var(--line);
  color: var(--fog);
  font-size: 0.85rem;
}
.site-footer .links { display: flex; gap: 1.6rem; }
.site-footer a:hover { color: var(--ink); }

/* ---------- about ---------- */
.about-main { padding: 22vh 2.5vw 10vh; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 6vw; }
.about-portrait { position: relative; aspect-ratio: 4 / 5; }
.about-copy .kicker { font-size: 0.9rem; color: var(--fog); margin: 0 0 1rem; }
.about-copy h1 {
  margin: 0 0 1.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.02;
  max-width: 14ch;
}
.about-copy p { max-width: 46ch; margin: 0 0 1.2rem; color: #2c2b24; }
.about-copy .places { margin-top: 2.2rem; display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--fog); }

/* ---------- 404 ---------- */
.not-found-main {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 2.5vw;
}
.not-found-main .kicker { font-size: 0.9rem; color: var(--fog); margin: 0 0 1rem; }
.not-found-main h1 {
  margin: 0 0 1.4rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.02;
  max-width: 16ch;
}
.not-found-main p { max-width: 46ch; margin: 0 0 2.2rem; color: #2c2b24; }
.not-found-main .home-link {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.1em;
  transition: opacity 0.2s ease;
}
.not-found-main .home-link:hover { opacity: 0.6; }

@media (max-width: 860px) {
  .site-header { padding: 20px 3vw; }
  .brand { font-size: 1.1rem; }
  .brand-nav { gap: 0.7rem; font-size: 0.78rem; }
  .header-role, .header-location { display: none; }
  .header-contact { gap: 1.1rem; font-size: 0.94rem; }
  body.home { height: auto; overflow: visible; }
  .filmstrip { position: static; overflow: visible; touch-action: auto; }
  .track {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    gap: 6vh;
    padding: 14vh 4vw 8vh;
  }
  .panel { width: 100%; height: auto; }
  .panel img { width: 100%; height: auto; max-width: 100%; }
  .panel-ph { width: 100%; height: 60vh; }
  .panel-index { position: static; display: block; margin-top: 10px; }
  .panel-index-name { opacity: 1; }
  .panel-end { width: 100%; height: 40vh; }
  .about-main { grid-template-columns: 1fr; padding: 18vh 3vw 8vh; gap: 8vh; }
  .gallery { column-count: 2; padding: 14vw 3vw; column-gap: 4vw; }
  .gallery figure { margin-bottom: 4vw; }
  .next-project { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 10vw 3vw 14vw; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}

/* ---------- lightbox (parallel /works/ pages only) ---------- */
.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 8, 0.92);
}
.lightbox.is-open { display: flex; }
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
/* ---------- works index (parallel /works listing page) ---------- */
.works-page .site-header { color: var(--ink); }
.works-index { padding: 16vh 0 4vh; }
.works-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 38.4vh;
  padding: 3vh 2.5vw;
  color: var(--ink);
}
.works-row-label { width: 100%; text-align: center; margin-bottom: 1.4rem; }
.works-row-index, .works-row-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}
.works-row-index { margin-right: 0.6rem; }
.works-row-images {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3rem;
  overflow-x: auto;
}
.works-row-images img { height: 100%; width: auto; display: block; opacity: 0.28; transition: opacity 0.35s ease; }
.works-stack { height: 100%; display: flex; flex-direction: column; gap: 0.8rem; flex-shrink: 0; }
.works-stack img { height: calc(50% - 0.4rem); }
.works-row:hover .works-row-images img { opacity: 1; }
@media (max-width: 860px) {
  .works-index { padding: 14vh 0 4vh; }
  .works-row { height: 30vh; padding: 1.5vh 4vw; }
  .works-row-images { gap: 0.4rem; }
  .works-row-images img { height: 5vh; }
  .works-stack { height: 12vh; }
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
