/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:          #EFF2E1;   /* H72 S7  B95 — warm off-white */
  --bg-white:    #EFF2E1;   /* same palette throughout     */
  --text:        #575449;   /* H47 S16 B34 — warm charcoal */
  --muted:       #B8BFB6;   /* H106 S5 B75 — warm gray     */
  --accent:      #BF7360;   /* H12 S50 B75 — terracotta    */
  --dark:        #6B4339;   /* H12 S47 B42 — dark brick-red */
  --border:      #D4D9BF;   /* derived from palette        */

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --nav-h:       72px;
  --pad:         clamp(1.5rem, 5vw, 5rem);
  --section-gap: clamp(5rem, 10vw, 9rem);

  --ease:     cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img   { display: block; max-width: 100%; height: auto; }
a     { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: var(--dark);
  transition: box-shadow 0.3s var(--ease);
}
.nav.scrolled {
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.nav__logo {
  display: flex;
  align-items: center;
}
.nav__logo-icon {
  width: 44px;
  height: auto;
  display: block;
}
.nav__logo-text { display: none; }

.nav__links { display: flex; align-items: center; gap: 2.25rem; }
.nav__link {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(239,242,225,0.6);
  position: relative;
  transition: color 0.2s;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: #EFF2E1;
  transition: width 0.3s var(--ease);
}
.nav__link:hover { color: #EFF2E1; }
.nav__link:hover::after { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 45fr 55fr;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vw, 7rem) var(--pad);
  padding-right: clamp(2rem, 4vw, 3.5rem);
}

.hero__label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.5vw, 6.25rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  max-width: 30ch;
  margin-bottom: 2.75rem;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__dot { color: var(--accent); }

.hero__scroll-hint {
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--border);
}
.hero__scroll-line {
  width: 40px; height: 1px;
  background: var(--border);
}

.hero__visual {
  position: relative;
  overflow: hidden;
}
.hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ============================================================
   SHARED SECTION
   ============================================================ */
.section { padding: var(--section-gap) var(--pad); }

.section__header {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section__label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.75rem);
  font-weight: 300;
}

/* ============================================================
   WORK / PROJECT GRID
   ============================================================ */
.work-category { margin-bottom: clamp(3.5rem, 7vw, 6rem); }

.work-category__header {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.work-category__num {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--border);
  flex-shrink: 0;
  margin-top: -0.4rem;
  user-select: none;
}
.work-category__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2.25rem);
  font-weight: 300;
  margin-bottom: 0.4rem;
}
.work-category__desc {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.65;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ============================================================
   PROJECT CARD
   ============================================================ */
.project-card {
  cursor: pointer;
  outline: none;
}
.project-card:focus-visible .project-card__img-wrap {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-card__img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--border);
}
.project-card--full .project-card__img-wrap {
  aspect-ratio: 16 / 7;
}
.project-card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease);
}
.project-card:hover .project-card__img { transform: scale(1.04); }

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27,26,24,0.78) 0%, rgba(27,26,24,0.05) 55%);
  opacity: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.5rem;
  transition: opacity 0.4s var(--ease);
}
.project-card:hover .project-card__overlay { opacity: 1; }

.project-card__overlay-inner {
  transform: translateY(6px);
  transition: transform 0.4s var(--ease);
}
.project-card:hover .project-card__overlay-inner { transform: translateY(0); }

.project-card__overlay-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.project-card__overlay-type {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}
.project-card__arrow {
  width: 22px; height: 22px;
  stroke: rgba(255,255,255,0.7);
  flex-shrink: 0;
  align-self: flex-end;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.project-card:hover .project-card__arrow { opacity: 1; transform: translateX(0); }

.project-card__meta { padding: 0.9rem 0 0.1rem; }
.project-card__num {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.project-card__name {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.project-card__sub {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about { background: var(--bg-white); }

.about__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}

.about__portrait-wrap {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}
.about__portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.about__portrait-caption {
  margin-top: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.about__quote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 2.1rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.35;
  margin-bottom: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.about__bio {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 3rem;
}

.about__creds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.about__cred-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.about__cred-value {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: var(--dark);
  text-align: center;
}
.contact__eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(239,242,225,0.4);
  margin-bottom: 2rem;
}
.contact__quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.75rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(239,242,225,0.5);
  margin-bottom: 3.5rem;
  max-width: 30ch;
  margin-left: auto;
  margin-right: auto;
}
.contact__links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.contact__link {
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  color: rgba(239,242,225,0.8);
  border-bottom: 1px solid rgba(239,242,225,0.2);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.contact__link:hover {
  color: #EFF2E1;
  border-color: rgba(239,242,225,0.6);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--dark);
  border-top: 1px solid rgba(239,242,225,0.08);
  padding: 1.5rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer__copy, .footer__credit {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(239,242,225,0.3);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(87, 84, 73, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 201;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1.5rem);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  outline: none;
}
.modal.active { opacity: 1; pointer-events: all; transform: translateY(0); }

.modal__container {
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  padding: 4vh var(--pad);
}

.modal__panel {
  background: var(--bg-white);
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 3fr;
  position: relative;
}

.modal__close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  z-index: 10;
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 0;
  transition: background 0.2s;
}
.modal__close:hover { background: var(--border); }
.modal__close svg {
  width: 15px; height: 15px;
  stroke: var(--text); stroke-width: 1.75; fill: none;
}

.modal__info {
  padding: 3rem 2.5rem 3rem 3rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 4vh;
  max-height: calc(100vh - 8vh);
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal__num {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}
.modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.8vw, 2.75rem);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: 0.6rem;
}
.modal__location {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.modal__status {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}
.modal__divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 1.5rem;
}
.modal__desc {
  font-size: 0.9375rem;
  line-height: 1.78;
  color: var(--text);
  margin-bottom: 2rem;
}
.modal__desc p + p { margin-top: 1rem; }

.modal__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.modal__spec-label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.modal__spec-value {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

/* Gallery */
.modal__gallery { padding: 2.5rem 2.5rem 2.5rem 2rem; }

.modal__main-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 0.75rem;
}
.modal__main-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity 0.2s;
}

.modal__gallery-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.modal__nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  transition: background 0.2s;
}
.modal__nav-btn:hover { background: var(--bg); }
.modal__nav-btn svg {
  width: 14px; height: 14px;
  stroke: var(--text); stroke-width: 1.5; fill: none;
}
.modal__gallery-count {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  min-width: 3rem;
  text-align: center;
}

.modal__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
}
.modal__thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  opacity: 0.45;
  border: 2px solid transparent;
  padding: 0;
  transition: opacity 0.2s, border-color 0.2s;
}
.modal__thumb.active {
  opacity: 1;
  border-color: var(--accent);
}
.modal__thumb:hover { opacity: 0.85; }
.modal__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }
  .hero__visual { display: none; }
  .hero__content {
    justify-content: center;
    min-height: 100dvh;
    padding: calc(var(--nav-h) + 4rem) var(--pad) 4rem;
    background-image: url('../images/COVER_SKETCH.jpg');
    background-size: cover;
    background-position: center;
  }
  .hero__content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(244, 243, 241, 0.88);
    z-index: 0;
  }
  .hero__label, .hero__name, .hero__tagline, .hero__meta, .hero__scroll-hint {
    position: relative; z-index: 1;
  }

  .modal__panel { grid-template-columns: 1fr; }
  .modal__info {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait-wrap { position: static; max-width: 380px; }
}

@media (max-width: 768px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-card--full .project-card__img-wrap { aspect-ratio: 4/3; }
  .about__creds { grid-template-columns: 1fr 1fr; }
  .modal__specs { grid-template-columns: 1fr; }
  .modal__container { padding: 2vh 1rem; }
  .modal__info { padding: 2rem 1.25rem; }
  .modal__gallery { padding: 1.5rem 1.25rem; }
  .contact__links { flex-direction: column; align-items: center; gap: 1.25rem; }
  footer { justify-content: center; }
}

@media (max-width: 480px) {
  :root { --pad: 1.25rem; }
  .nav__links { gap: 1.25rem; }
  .hero__name { font-size: clamp(2.5rem, 11vw, 3.5rem); }
  .work-category__num { font-size: 3rem; }
  .about__creds { grid-template-columns: 1fr; }
}
