/* =====================================================================
   Photo portfolio — dark editorial theme
   Fonts: Fraunces (display) · Archivo (body) · Space Mono (meta)
   ===================================================================== */

:root {
  --bg:        #0b0b0d;
  --bg-2:      #121216;
  --ink:       #ece7dd;   /* warm paper */
  --ink-dim:   #8f897d;
  --ink-faint: #5a564e;
  --line:      rgba(236, 231, 221, 0.12);
  --line-soft: rgba(236, 231, 221, 0.07);
  --accent:    #caa15a;   /* muted amber */
  --accent-hi: #e6c07a;

  --gap: clamp(10px, 1.4vw, 20px);
  --pad: clamp(20px, 5vw, 88px);

  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Archivo", -apple-system, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}

@media (pointer: coarse) { body { cursor: auto; } }

::selection { background: var(--accent); color: #0b0b0d; }

a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

em { font-style: italic; }

/* ---------- atmosphere: grain + radial glow ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 78% -10%, rgba(202, 161, 90, 0.10), transparent 60%),
    radial-gradient(900px 700px at 8% 108%, rgba(202, 161, 90, 0.05), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -2%); }
  60% { transform: translate(-2%, -4%); }
  80% { transform: translate(4%, 2%); }
}

/* ---------- custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width .25s var(--ease), height .25s var(--ease),
              background-color .25s var(--ease), border-color .25s var(--ease),
              opacity .3s;
  mix-blend-mode: difference;
}
.cursor.is-hot {
  width: 66px; height: 66px;
  background: var(--ink);
  border-color: transparent;
}
.cursor.is-hidden { opacity: 0; }
@media (pointer: coarse) { .cursor { display: none; } }

/* content sits above atmosphere */
.nav, main, .footer { position: relative; z-index: 2; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad);
  mix-blend-mode: difference;
  transition: transform .5s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__mark { display: flex; align-items: center; gap: 10px; }
.nav__glyph { color: var(--accent); font-size: 1.1rem; }
.nav__name {
  font-family: var(--f-mono);
  letter-spacing: 0.28em;
  font-size: 0.72rem;
}
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 3px;
}
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 5vh, 60px);
  padding-top: 12vh;
}

/* background photo (set from the first feed photo via JS) */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.hero__bg.is-ready {
  opacity: 1;
  animation: kenburns 24s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1.08); }
  to   { transform: scale(1.2) translate(-1.5%, -1.5%); }
}

/* legibility scrim over the photo */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(11,11,13,0.55) 0%,
      rgba(11,11,13,0.10) 32%,
      rgba(11,11,13,0.35) 62%,
      rgba(11,11,13,0.92) 100%),
    linear-gradient(90deg, rgba(11,11,13,0.45) 0%, transparent 45%);
}

/* keep hero content above the photo + scrim */
.hero__meta,
.hero__title,
.hero__foot { position: relative; z-index: 2; }

.hero__meta {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.hero__count { color: var(--accent); }

.hero__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(3.4rem, 15vw, 12rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 60px rgba(0, 0, 0, 0.45);
}
.hero__title em {
  font-weight: 400;
  color: var(--accent);
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line__inner {
  display: block;
  transform: translateY(102%);
}
.is-ready .hero__title .line__inner {
  animation: rise 1.05s var(--ease) forwards;
}
.hero__title .line:nth-child(1) .line__inner { animation-delay: .15s; }
.hero__title .line:nth-child(2) .line__inner { animation-delay: .27s; }
.hero__title .line:nth-child(3) .line__inner { animation-delay: .39s; }
@keyframes rise { to { transform: translateY(0); } }

.hero__foot {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}
.hero__lead {
  max-width: 42ch;
  color: var(--ink-dim);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
}
.hero__scroll {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.hero__arrow {
  color: var(--ink);
  animation: bob 2.2s var(--ease) infinite;
}
.hero__scroll:hover .hero__arrow { color: var(--accent); }
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.65; }
  50%      { transform: translateY(7px); opacity: 1; }
}

/* staggered fade for lines/leads on load */
.reveal-line { opacity: 0; transform: translateY(18px); }
.is-ready .reveal-line {
  animation: fade-up .9s var(--ease) forwards;
}
.is-ready .hero__meta.reveal-line { animation-delay: .1s; }
.is-ready .hero__lead.reveal-line { animation-delay: .55s; }
.is-ready .hero__scroll.reveal-line { animation-delay: .65s; }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ---------- work / feed ---------- */
.work { padding: clamp(80px, 12vh, 160px) var(--pad) clamp(60px, 10vh, 120px); }
.work__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: clamp(28px, 4vw, 56px);
  gap: 20px;
  flex-wrap: wrap;
}
.work__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.work__title .mono { color: var(--accent); font-size: 0.9rem; }

/* masonry grid: JS sets grid-row span per item from aspect ratio */
.feed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 8px;
  gap: var(--gap);
}
@media (min-width: 720px)  { .feed { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .feed { grid-template-columns: repeat(4, 1fr); } }

.tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  cursor: none;
  opacity: 0;
  transform: translateY(26px) scale(0.985);
}
.tile.is-in { animation: tile-in .9s var(--ease) forwards; }
@keyframes tile-in { to { opacity: 1; transform: none; } }

.tile__img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .7s var(--ease), transform 1.1s var(--ease);
  filter: saturate(1.02);
}
.tile__img.loaded { opacity: 1; }
.tile:hover .tile__img { transform: scale(1.05); }

.tile__blur {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.15);
  transition: opacity .8s var(--ease);
}
.tile.loaded .tile__blur { opacity: 0; }

.tile__no {
  position: absolute;
  left: 12px; bottom: 10px;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  mix-blend-mode: difference;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.tile:hover .tile__no { opacity: 1; transform: none; }

/* empty state */
.empty { padding: clamp(50px, 12vh, 130px) 0; text-align: center; }
.empty__big {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--ink-faint);
}
.empty__sub { margin-top: 14px; }

/* ---------- contact ---------- */
.contact {
  padding: clamp(90px, 16vh, 200px) var(--pad);
  border-top: 1px solid var(--line);
}
.contact__kicker { margin-bottom: 22px; }
.contact__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 9vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: clamp(40px, 7vw, 90px);
}
.contact__title em { color: var(--accent); }
.contact__links { display: flex; flex-direction: column; }
.contact__link {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 4vw, 60px);
  padding: clamp(18px, 2.4vw, 30px) 0;
  border-top: 1px solid var(--line);
  transition: padding-left .4s var(--ease), color .3s var(--ease);
}
.contact__link:last-child { border-bottom: 1px solid var(--line); }
.contact__link:hover { padding-left: clamp(10px, 2vw, 32px); color: var(--accent-hi); }
.contact__lbl { flex: 0 0 auto; width: 96px; }
.contact__val {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 400;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px var(--pad);
  border-top: 1px solid var(--line);
}
.footer__admin {
  font-size: 1.2rem;
  color: var(--ink-faint);
  padding: 0 10px;
  transition: color .3s;
}
.footer__admin:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 7, 8, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  max-width: 90vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.96);
  transition: transform .5s var(--ease);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); }
.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
}
.lightbox__cap { color: var(--ink-dim); }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--ink);
  cursor: none;
  font-family: var(--f-body);
  transition: color .3s, transform .3s var(--ease);
}
.lightbox__close { top: 26px; right: 32px; font-size: 1.4rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 3rem; padding: 20px; }
.lightbox__nav--prev { left: clamp(8px, 3vw, 40px); }
.lightbox__nav--next { right: clamp(8px, 3vw, 40px); }
.lightbox__close:hover,
.lightbox__nav:hover { color: var(--accent); }
.lightbox__nav--prev:hover { transform: translateY(-50%) translateX(-4px); }
.lightbox__nav--next:hover { transform: translateY(-50%) translateX(4px); }

@media (max-width: 640px) {
  .nav__links { gap: 18px; }
  .lightbox__nav { font-size: 2rem; padding: 10px; }
  .contact__lbl { width: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero__title .line__inner { transform: none; }
  .reveal-line, .tile { opacity: 1; transform: none; }
}
