:root {
  --bg: #FAF9F7;
  --ink: #1F1F1D;
  --ink-soft: #6E6A64;
  --hairline: #E5E2DD;
  --accent: #B5542D;
  --accent-dark: #96431F;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.nav.scrolled,
.nav--solid {
  background: rgba(250, 249, 247, .94);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--hairline);
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.nav__logo {
  font-weight: 700;
  letter-spacing: .18em;
  font-size: .95rem;
  color: #fff;
  transition: color .35s ease;
}
.nav.scrolled .nav__logo,
.nav--solid .nav__logo { color: var(--ink); }
.nav__links { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); list-style: none; }
.nav__links a {
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
  transition: color .35s ease;
}
.nav__links a:hover { color: #fff; }
.nav.scrolled .nav__links a,
.nav--solid .nav__links a { color: var(--ink-soft); }
.nav.scrolled .nav__links a:hover,
.nav--solid .nav__links a:hover { color: var(--accent); }
.nav__links a[aria-current="page"] { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .18) 40%, rgba(0, 0, 0, 0) 65%),
              linear-gradient(to bottom, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, 0) 22%);
}
.hero__content {
  position: relative;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3rem, 8vh, 5.5rem);
  max-width: 44rem;
  color: #fff;
}
.hero__tagline {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.hero__sub {
  margin-top: .9rem;
  font-size: clamp(.95rem, 1.4vw, 1.05rem);
  color: rgba(255, 255, 255, .82);
  letter-spacing: .04em;
}
.hero__ctas { margin-top: 1.75rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: .8rem 1.7rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { border: 1px solid rgba(255, 255, 255, .55); color: #fff; }
.btn--ghost:hover { border-color: #fff; color: #fff; }

.hero__scroll-hint {
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(3rem, 8vh, 5.5rem);
  color: rgba(255, 255, 255, .7);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
@media (max-width: 640px) { .hero__scroll-hint { display: none; } }

/* ---------- Sections ---------- */
.section {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6.5rem) clamp(1.25rem, 4vw, 3rem);
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 4vh, 2.75rem);
}
.section__title {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -.01em;
}
.section__link { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }

/* ---------- Page header (internal pages) ---------- */
.page-head {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(7rem, 16vh, 9.5rem) clamp(1.25rem, 4vw, 3rem) 0;
}
.page-head__title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -.01em;
}
.page-head__sub {
  margin-top: .6rem;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: clamp(.95rem, 1.3vw, 1.05rem);
}

/* ---------- Filter bar ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: clamp(1.75rem, 4vh, 2.75rem);
}
.filters[hidden] { display: none; }
.filters__btn {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: .5rem 1.05rem;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.filters__btn:hover { color: var(--accent); border-color: var(--accent); }
.filters__btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- Cards grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}
@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

.card { display: block; color: inherit; }
.card:hover { color: inherit; }
.card__media {
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  background: var(--hairline);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}
.card:hover .card__media img { transform: scale(1.045); }
.card__meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: .8rem; }
.card__title { font-weight: 600; font-size: .98rem; }
.card__tag { font-size: .78rem; color: var(--ink-soft); letter-spacing: .05em; text-transform: uppercase; }
.card__year { font-size: .78rem; color: var(--ink-soft); }
a.card:hover .card__title { color: var(--accent); }

.cards__empty { color: var(--ink-soft); font-size: .95rem; }

/* ---------- Positioning strip ---------- */
.strip {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: #fff;
}
.strip .section { padding-top: clamp(2.75rem, 7vh, 4.5rem); padding-bottom: clamp(2.75rem, 7vh, 4.5rem); }
.strip__text {
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 500;
  line-height: 1.45;
  max-width: 46rem;
  text-wrap: balance;
}
.strip__text em { font-style: normal; color: var(--accent); }
.strip__more { margin-top: 1.25rem; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; display: inline-block; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hairline); }
.footer .section {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: clamp(2.5rem, 6vh, 4rem);
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
}
.footer__lead { font-size: 1.15rem; font-weight: 600; }
.footer__email { display: inline-block; margin-top: .4rem; font-size: .95rem; }
.footer__note { margin-top: .5rem; font-size: .82rem; color: var(--ink-soft); }
.footer__social { display: flex; gap: 1.5rem; list-style: none; }
.footer__social a { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.footer__social a:hover { color: var(--accent); }
.footer__copy { width: 100%; font-size: .78rem; color: var(--ink-soft); border-top: 1px solid var(--hairline); padding-top: 1.25rem; }

/* ---------- Project detail ---------- */
.detail { max-width: 76rem; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3.5rem, 9vh, 6.5rem); }
.detail__hero { border-radius: 2px; overflow: hidden; background: var(--hairline); }
.detail__hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
@media (max-width: 640px) { .detail__hero img { aspect-ratio: 4 / 3; } }
.detail__title { margin-top: clamp(1.5rem, 4vh, 2.5rem); font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 600; letter-spacing: -.01em; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 3vw, 2.75rem);
  margin-top: 1.1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  list-style: none;
}
.facts__label { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.facts__value { font-size: .95rem; font-weight: 500; }

.detail__brief { margin-top: clamp(1.5rem, 4vh, 2.25rem); max-width: 46rem; font-size: clamp(1rem, 1.5vw, 1.1rem); line-height: 1.7; }

.detail__section-title {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.75rem); }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } }
.gallery__item {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery__item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s cubic-bezier(.2, .6, .2, 1); }
.gallery__item:hover img { transform: scale(1.03); }
.gallery__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gallery--drawings .gallery__item img { aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: none;
  padding: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: rgba(15, 14, 13, .96);
  color: #fff;
}
.lightbox::backdrop { background: rgba(15, 14, 13, .96); }
.lightbox__figure { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; padding: clamp(3.5rem, 8vh, 5rem) clamp(3.5rem, 8vw, 6rem); }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; min-height: 0; }
.lightbox__caption { font-size: .88rem; color: rgba(255, 255, 255, .75); text-align: center; }
.lightbox__counter { color: rgba(255, 255, 255, .45); }
.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background .25s ease;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .2); }
.lightbox__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox__btn--close { top: 1rem; right: 1rem; }
.lightbox__btn--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- Prev/next project nav ---------- */
.projnav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}
.projnav__link { max-width: 45%; }
.projnav__link--next { margin-left: auto; text-align: right; }
.projnav__dir { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.projnav__title { font-weight: 600; font-size: .98rem; }
.projnav__back { display: block; margin-top: 1.5rem; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 780px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid p + p { margin-top: 1rem; }
.about-grid p { max-width: 46rem; font-size: clamp(.98rem, 1.4vw, 1.05rem); line-height: 1.7; }
.about__photo { border-radius: 2px; overflow: hidden; background: var(--hairline); }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}
@media (max-width: 640px) { .skills { grid-template-columns: 1fr; } }
.skill-group {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.skill-group__title { font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.skill-group ul { list-style: none; margin-top: .9rem; }
.skill-group li { padding: .45rem 0; border-top: 1px solid var(--hairline); font-size: .95rem; }
.skill-group li:first-child { border-top: none; }

.callout {
  border-left: 3px solid var(--accent);
  background: #fff;
  border-radius: 2px;
  padding: 1.25rem 1.5rem;
  max-width: 46rem;
  font-size: .95rem;
}
.callout strong { color: var(--accent); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }

.form__field { margin-bottom: 1.25rem; }
.form__label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .4rem; }
.form__input {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: .75rem .9rem;
  transition: border-color .25s ease;
}
.form__input:focus { outline: none; border-color: var(--accent); }
.form__input:user-invalid { border-color: #B03A2E; }
textarea.form__input { min-height: 9rem; resize: vertical; }
.form__hint { margin-top: 1rem; font-size: .82rem; color: var(--ink-soft); }
.btn--submit { border: none; cursor: pointer; font-family: inherit; }

.contact-aside h2 { font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.contact-aside p { margin-top: .6rem; font-size: .95rem; }
.contact-aside .block + .block { margin-top: 1.75rem; }
.contact-aside ul { list-style: none; margin-top: .6rem; }
.contact-aside li { padding: .35rem 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover .card__media img { transform: none; }
  .gallery__item:hover img { transform: none; }
}
