/* =========================================================================
   Editorial Wall — design system
   Palette: neutral paper + ink, single burnt-terracotta accent (locked)
   Type: Bricolage Grotesque (display) / Hanken Grotesk (body)
   Radius rule: images = sharp (0); interactive controls = pill (999px)
   Motion: CSS transitions + scroll-reveal; reduced-motion safe
   ========================================================================= */

:root {
  --paper: #f4f4f1;
  --paper-2: #ecebe6;
  --ink: #16161a;
  --muted: #6c6c66;
  --line: #dcdcd5;
  --surface: #ffffff;
  --accent: #c2552e;
  --accent-soft: rgba(194, 85, 46, 0.12);
  --scrim: rgba(14, 14, 17, 0.96);

  --maxw: 1400px;
  --gap: clamp(14px, 2vw, 26px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

[data-theme="dark"] {
  --paper: #101012;
  --paper-2: #161619;
  --ink: #ededea;
  --muted: #9a9a93;
  --line: #27272c;
  --surface: #1a1a1e;
  --accent: #e0703f;
  --accent-soft: rgba(224, 112, 63, 0.16);
  --scrim: rgba(6, 6, 8, 0.97);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

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

/* paper grain ---------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* topbar --------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark-mark {
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.6s var(--ease);
}
.wordmark:hover .wordmark-mark { transform: rotate(180deg); }
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.wordmark-text em { font-style: normal; color: var(--muted); font-weight: 600; }

.topbar-actions { display: inline-flex; align-items: center; gap: 16px; }
.topbar-count {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.theme-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.3s var(--ease), transform 0.2s var(--ease), background 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle i { position: absolute; font-size: 19px; transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.theme-toggle [data-icon="sun"] { opacity: 0; transform: rotate(-40deg) scale(0.6); }
[data-theme="dark"] .theme-toggle [data-icon="moon"] { opacity: 0; transform: rotate(40deg) scale(0.6); }
[data-theme="dark"] .theme-toggle [data-icon="sun"] { opacity: 1; transform: rotate(0) scale(1); }

/* masthead ------------------------------------------------------------- */
.masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 11vh, 130px) clamp(18px, 4vw, 48px) clamp(34px, 6vh, 70px);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.masthead-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 20ch;
  overflow-wrap: break-word;
}
.masthead-lede {
  margin-top: 26px;
  max-width: 38ch;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--muted);
  line-height: 1.55;
}

/* filter bar ------------------------------------------------------------ */
.filter-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) clamp(28px, 4vh, 44px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* feature opener ------------------------------------------------------- */
.feature {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) clamp(40px, 7vh, 90px);
}
.feature-frame {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--paper-2);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}
.feature-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.1s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.96);
}
.feature-frame:hover img { transform: scale(1.06); filter: saturate(1.05); }

.video-badge {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--scrim) 55%, transparent);
  color: #fff;
  font-size: 34px;
  pointer-events: none;
}

/* feature carousel (banner rotation) ----------------------------------- */
.carousel { position: relative; }
.carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-2);
}
.slide {
  position: absolute;
  inset: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.9s var(--ease), transform 1.4s var(--ease);
  pointer-events: none;
}
.slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 1;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96);
}
.slide.is-active:hover img { filter: saturate(1.05); }

.carousel-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(20, 20, 24, 0.34);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.2s var(--ease);
}
.carousel-nav i { font-size: 20px; }
.carousel-nav:hover { background: rgba(20, 20, 24, 0.6); border-color: #fff; }
.carousel-nav:active { transform: translateY(-50%) scale(0.93); }
.carousel-prev { left: clamp(12px, 2.4vw, 28px); }
.carousel-next { right: clamp(12px, 2.4vw, 28px); }

.carousel-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), width 0.3s var(--ease);
}
.dot.is-active { background: #fff; width: 24px; }

/* collection grid (masonry via CSS columns) ---------------------------- */
.collection {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) clamp(60px, 10vh, 130px);
}
.grid {
  column-count: 4;
  column-gap: var(--gap);
}
@media (max-width: 1180px) { .grid { column-count: 3; } }
@media (max-width: 760px)  { .grid { column-count: 3; --gap: 6px; } }

.tile {
  display: block;
  width: 100%;
  margin: 0 0 var(--gap);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  break-inside: avoid;
  position: relative;
  text-align: left;
  border-radius: 0;
}
.tile.is-hidden { display: none; }
.tile-imgwrap {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 0;
  aspect-ratio: 4 / 3;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.9s var(--ease), filter 0.5s var(--ease);
  filter: saturate(0.95);
}
.tile:hover img { transform: scale(1.045); filter: saturate(1.04); }
.tile:active .tile-imgwrap { transform: translateY(1px); }

.tile-video {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--scrim) 50%, transparent);
  color: #fff;
  font-size: 26px;
  pointer-events: none;
}

.tile-meta {
  display: none;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.tile:hover .tile-meta,
.tile:focus-visible .tile-meta { display: flex; opacity: 1; transform: translateY(0); }
.tile-index { font-variant-numeric: tabular-nums; color: var(--accent); }
.tile-date { font-variant-numeric: tabular-nums; }

.tile::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}
.tile:hover::after, .tile:focus-visible::after { width: 100%; }

.empty-filter {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 60px 0;
}

/* scroll reveal -------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 48px) 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-row { display: flex; flex-direction: column; gap: 3px; }
.footer-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.footer-note { font-size: 12.5px; color: var(--muted); }
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.footer-link:hover { border-color: var(--accent); color: var(--accent); }

/* lightbox ------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.36s var(--ease), visibility 0.36s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; visibility: visible; }

.lb-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb-figure {
  position: relative;
  z-index: 2;
  max-width: min(94vw, 1400px);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.lightbox.is-open .lb-figure { animation: lbFigIn 0.55s var(--ease) both; }

.lb-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38vh;
}
.lb-photo,
.lb-video {
  grid-area: 1 / 1;
  max-width: min(94vw, 1400px);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  will-change: transform, opacity;
}
.lb-photo { position: relative; }
.lb-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.lb-ghost[hidden] { display: none; }
.lb-video { position: relative; }
.lb-video.is-leaving,
.lb-photo.is-leaving {
  position: absolute;
  grid-area: auto;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lb-photo.is-in-next  { animation: lbInNext 0.46s var(--ease) both; }
.lb-photo.is-in-prev  { animation: lbInPrev 0.46s var(--ease) both; }
.lb-photo.is-enter    { animation: lbEnter 0.5s var(--ease) both; }
.lb-ghost.is-out-next { animation: lbOutNext 0.44s var(--ease) both; }
.lb-ghost.is-out-prev { animation: lbOutPrev 0.44s var(--ease) both; }
.lb-video.is-in-next  { animation: lbInNext 0.46s var(--ease) both; }
.lb-video.is-in-prev  { animation: lbInPrev 0.46s var(--ease) both; }
.lb-video.is-out-next { animation: lbOutNext 0.44s var(--ease) both; }
.lb-video.is-out-prev { animation: lbOutPrev 0.44s var(--ease) both; }

.lb-cap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex-wrap: wrap;
  justify-content: center;
}
.lb-cap.cap-in { animation: lbCapIn 0.5s var(--ease) both; }
.lb-title { color: #fff; }
.lb-divider { width: 22px; height: 1px; background: rgba(255, 255, 255, 0.32); }
.lb-count { color: #fff; }

/* swipe / drag-to-flip (touch + mouse) */
.lb-stage { touch-action: pan-y; cursor: grab; }
.lb-stage.is-dragging {
  cursor: grabbing;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lb-stage.is-dragging .lb-photo,
.lb-stage.is-dragging .lb-video,
.lb-stage.is-dragging .lb-ghost {
  transition: none !important;
  will-change: transform, opacity;
  -webkit-user-drag: none;
}

.lb-btn {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.2s var(--ease);
}
.lb-btn i { font-size: 22px; }
.lb-btn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.5); }
.lb-btn:active { transform: scale(0.93); }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: clamp(14px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(14px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.lb-prev:active, .lb-next:active { transform: translateY(-50%) scale(0.93); }

@keyframes lbFigIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lbEnter {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: none; }
}
@keyframes lbInNext {
  from { opacity: 0; transform: translate3d(4%, 0, 0) scale(1.015); }
  to   { opacity: 1; transform: none; }
}
@keyframes lbInPrev {
  from { opacity: 0; transform: translate3d(-4%, 0, 0) scale(1.015); }
  to   { opacity: 1; transform: none; }
}
@keyframes lbOutNext {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translate3d(-4%, 0, 0) scale(0.99); }
}
@keyframes lbOutPrev {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translate3d(4%, 0, 0) scale(0.99); }
}
@keyframes lbCapIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .feature-frame img, .tile img, .slide img { transform: none; }
}
