/* ============================================================
   PERSONAL PHOTOGRAPHY PORTFOLIO — Mauricio Chigutti
   Warm, personal, image-first. Three directions via [data-dir].
   ============================================================ */

:root {
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --accent: #b0673c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ---------- Direction palettes ---------- */
.root { min-height: 100vh; background: var(--bg); color: var(--ink); transition: background .5s ease, color .5s ease; }

.root[data-dir="quiet"] {
  --bg: #e3e1db;
  --ink: #1c1a17;
  --muted: #847b71;
  --line: rgba(28,26,23,.18);
  --panel: color-mix(in srgb, var(--bg) 60%, #ffffff);
  --cell-bg: color-mix(in srgb, var(--bg) 84%, #463d33);
  --lb-bg: color-mix(in srgb, var(--bg) 96%, transparent);
}
.root[data-dir="editorial"] {
  --bg: #e3ddd0;
  --ink: #221c14;
  --muted: #897b65;
  --line: rgba(34,28,20,.18);
  --panel: color-mix(in srgb, var(--bg) 58%, #ffffff);
  --cell-bg: color-mix(in srgb, var(--bg) 84%, #463b2c);
  --lb-bg: color-mix(in srgb, var(--bg) 96%, transparent);
}
.root[data-dir="dark"] {
  --bg: #1c1815;
  --panel: #241f1b;
  --ink: #efe9e0;
  --muted: #9a8f82;
  --line: rgba(239,233,224,.16);
  --lb-bg: rgba(20,17,14,.96);
  --cell-bg: #2a2420;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 22px clamp(20px, 5vw, 64px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  color: var(--ink); font-weight: 700; letter-spacing: .07em;
  font-size: 14px; padding: 0; text-transform: uppercase;
}
.nav__links { display: flex; align-items: baseline; gap: clamp(12px, 2vw, 26px); flex-wrap: wrap; }
.nav__link {
  color: var(--muted); font-size: 12.5px; letter-spacing: .04em;
  padding: 0; transition: color .2s ease; position: relative;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--accent);
}
.nav__sep { width: 1px; height: 12px; background: var(--line); align-self: center; }

.nav--editorial .nav__brand { font-size: 15px; }
.nav--editorial .nav__link { text-transform: uppercase; font-size: 11px; letter-spacing: .14em; }
.nav--quiet .nav__link { text-transform: uppercase; font-size: 11px; letter-spacing: .14em; }
.nav--dark .nav__link { letter-spacing: .06em; }

/* ============================================================
   MAIN
   ============================================================ */
.main { width: 100%; }
.empty { padding: 30vh 0; text-align: center; color: var(--muted); }

/* ============================================================
   HOME — full-bleed hero
   ============================================================ */
.hero {
  position: relative; height: 100vh; min-height: 600px; width: 100%;
  overflow: hidden; display: flex; flex-direction: column;
  color: #f4f0e9;
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center 58%;
  transform: scale(1.04);
  animation: heroDrift 26s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to   { transform: scale(1.12) translate3d(-1.5%, -1.5%, 0); }
}
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to bottom, rgba(18,13,9,.46) 0%, rgba(18,13,9,0) 26%, rgba(18,13,9,0) 42%, rgba(16,11,7,.82) 100%),
    linear-gradient(105deg, rgba(16,11,7,.5) 0%, rgba(16,11,7,0) 55%);
}
.hero__grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, rgba(0,0,0,0) 52%, rgba(8,5,3,.45) 100%);
  mix-blend-mode: multiply;
}

.hero__top {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(22px, 3.4vw, 40px) clamp(22px, 5vw, 64px);
}
.hero__eyebrow {
  font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase;
  color: rgba(244,240,233,.72); font-weight: 500;
}
.hero__eyebrow--right { color: rgba(244,240,233,.5); }

.hero__content {
  position: relative; z-index: 2; margin-top: auto;
  padding: 0 clamp(22px, 5vw, 64px) clamp(30px, 5vh, 54px);
  width: 100%;
}
.hero__kicker {
  display: flex; align-items: center; gap: 14px; margin: 0 0 18px;
  font-size: clamp(12px, 1.4vw, 14px); letter-spacing: .22em; text-transform: uppercase;
  color: rgba(247,243,236,.82); font-weight: 500;
}
.hero__kicker::before {
  content: ""; width: clamp(28px, 4vw, 56px); height: 2px;
  background: var(--accent); flex: none;
}
.hero__name {
  margin: 0; font-weight: 700; text-transform: uppercase;
  font-size: clamp(46px, 12vw, 168px); line-height: .86; letter-spacing: -0.03em;
  color: #f7f3ec; max-width: 14ch;
  text-shadow: 0 2px 40px rgba(0,0,0,.35);
}

/* Hero menu — hairline only, no boxes */
.hmenu--hero {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: clamp(18px, 3vw, 46px);
  margin-top: clamp(28px, 4.5vh, 52px);
  padding-top: clamp(18px, 2.4vh, 26px);
  border-top: 1px solid rgba(244,240,233,.28);
}
.hmenu__link {
  display: flex; align-items: baseline; gap: 9px; padding: 4px 0;
  color: rgba(247,243,236,.9); transition: color .22s ease, transform .22s ease;
}
.hmenu__num {
  font-size: 11px; letter-spacing: .1em; color: rgba(247,243,236,.5);
  font-variant-numeric: tabular-nums;
}
.hmenu__label {
  font-size: clamp(16px, 2vw, 23px); font-weight: 600; letter-spacing: .005em;
  position: relative; white-space: nowrap;
}
.hmenu__label::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -5px;
  height: 2px; background: var(--accent); transition: right .28s ease;
}
.hmenu__link:hover { color: #fff; transform: translateY(-1px); }
.hmenu__link:hover .hmenu__label::after { right: 0; }
.hmenu__link--about .hmenu__label { font-weight: 500; color: rgba(247,243,236,.66); }
.hmenu__link--about:hover .hmenu__label { color: #fff; }

/* Dark Room: deepen the scrim a touch so the gravel reads moodier */
.hero--dark .hero__scrim {
  background:
    linear-gradient(to bottom, rgba(12,9,6,.55) 0%, rgba(12,9,6,0) 30%, rgba(10,7,4,.9) 100%),
    linear-gradient(105deg, rgba(10,7,4,.55) 0%, rgba(10,7,4,0) 55%);
}
/* Editorial: name in italic serif for a more literary first impression */
.hero--editorial .hero__name {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  text-transform: none; letter-spacing: -0.01em; line-height: .92;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery { padding: clamp(36px, 6vw, 80px) clamp(20px, 5vw, 64px) 120px; }
.gallery__head {
  display: grid; gap: 8px; align-items: end;
  grid-template-columns: 1fr auto; margin-bottom: clamp(26px, 4vw, 48px);
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.gallery__title { grid-column: 1; margin: 0; font-weight: 700; text-transform: uppercase; font-size: clamp(28px, 5vw, 56px); letter-spacing: -0.015em; line-height: 1; }
.gallery__blurb { grid-column: 1; margin: 0; color: var(--muted); font-size: clamp(14px, 1.6vw, 17px); }
.gallery__count { grid-column: 2; grid-row: 1 / span 2; align-self: end; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

.grid { column-count: var(--cols, 3); column-gap: var(--gap, 10px); }
.cell {
  position: relative; margin: 0 0 var(--gap, 10px); overflow: hidden;
  background: var(--cell-bg); cursor: pointer;
  display: block; width: 100%;
  break-inside: avoid; -webkit-column-break-inside: avoid;
}
.cell img {
  width: 100%; height: auto; display: block;
  opacity: 0; transform: scale(1.02);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1), filter .4s ease;
}
.cell.is-loaded img { opacity: 1; transform: scale(1); }
.cell:hover img { transform: scale(1.05); }
.cell__plus {
  position: absolute; top: 12px; right: 14px; color: #fff; font-size: 20px;
  font-weight: 300; opacity: 0; transition: opacity .3s ease; mix-blend-mode: difference;
}
.cell:hover .cell__plus, .cell:focus-visible .cell__plus { opacity: .9; }
.cell__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 14px 12px; color: #fff; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  opacity: 0; transform: translateY(6px); transition: all .3s ease;
}
.cell:hover .cell__cap, .cell:focus-visible .cell__cap { opacity: 1; transform: translateY(0); }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Editorial gallery title stays in the index voice (uppercase Helvetica) */

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lb {
  position: fixed; inset: 0; z-index: 90;
  background: var(--lb-bg); backdrop-filter: blur(6px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  animation: lbIn .35s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb__close {
  position: absolute; top: 22px; right: clamp(20px, 5vw, 48px); z-index: 2;
  color: var(--ink); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 4px;
}
.lb__close:hover { color: var(--accent); }
.lb__nav {
  display: grid; place-items: center; width: clamp(56px, 9vw, 120px); height: 100%;
  color: var(--ink); font-size: 26px; transition: color .2s ease; z-index: 2;
}
.lb__nav span { transition: transform .3s ease; }
.lb__nav:hover { color: var(--accent); }
.lb__nav--prev:hover span { transform: translateX(-5px); }
.lb__nav--next:hover span { transform: translateX(5px); }
.lb__stage {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: clamp(40px, 6vh, 70px) 0; max-height: 100vh;
}
.lb__img {
  max-width: min(86vw, 1100px); max-height: 80vh; object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.28); animation: imgIn .45s ease;
}
.root[data-dir="dark"] .lb__img { box-shadow: 0 0 90px rgba(0,0,0,.6); }
@keyframes imgIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
.lb__cap {
  display: flex; gap: 20px; align-items: center; color: var(--muted);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.lb__num { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  display: grid; grid-template-columns: minmax(280px, 0.85fr) 1fr;
  gap: clamp(32px, 6vw, 88px); align-items: center;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(24px, 5vw, 64px) 100px;
  min-height: calc(100vh - 70px);
}
.about__media { position: relative; }
.about__media img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--cell-bg);
}
.about__kicker { margin: 0 0 22px; color: var(--muted); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.about__text p { margin: 0 0 16px; font-size: clamp(18px, 2.4vw, 27px); line-height: 1.45; letter-spacing: -0.01em; max-width: 26ch; }
.about__text p:last-child { color: var(--muted); }
.about__motto {
  margin: clamp(28px, 5vw, 48px) 0; padding-left: 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif); font-style: italic;
  font-size: clamp(22px, 3.4vw, 38px); line-height: 1.2; color: var(--ink); max-width: 18ch;
}
.about__meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.about__cta { color: var(--ink); font-size: 14px; letter-spacing: .04em; padding: 14px 0; text-decoration: none; text-transform: uppercase; font-weight: 600; transition: color .2s ease; }
.about__cta:hover { color: var(--accent); }
.about__contact { color: var(--muted); font-size: 13px; letter-spacing: .04em; text-decoration: none; transition: color .2s ease; }
.about__contact:hover { color: var(--ink); }

.about--dark .about__media img { box-shadow: 0 0 70px rgba(0,0,0,.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .grid { column-count: 2 !important; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about__media { max-width: 360px; }
  .nav { gap: 12px; }
  .home__foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cell img { transition: opacity .3s ease; transform: none !important; }
  * { animation-duration: .01ms !important; }
}
