/* ============================================================
   PORTFOLIO — shared styles
   Palette : dark gallery wall, luminous warm-lit work
   Type    : Space Grotesk (display) + Inter (body)
   ============================================================ */

:root {
  --bg:        #1a1817;   /* dark gallery wall            */
  --bg-raise:  #211e1c;   /* slightly lifted surface      */
  --ink:       #e8e3d9;   /* bone / canvas text           */
  --ink-dim:   #9a9288;   /* muted captions               */
  --ink-faint: #5f594f;   /* hairlines, disabled          */
  --amber:     #c8935f;   /* plywood accent               */
  --amber-lo:  #7c5a3a;   /* deep amber                   */
  --line:      #322e2a;   /* structural rule              */
  --maxw:      1440px;
  --gutter:    clamp(20px, 5vw, 72px);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

::selection { background: var(--amber); color: #17140f; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---- Display type ----------------------------------------- */
.display {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
}
.masthead .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.masthead .role {
  color: var(--ink-dim);
  font-size: 14px;
}
.masthead nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--ink-dim);
}
.masthead nav a:hover { color: var(--ink); }
.masthead nav a.active { color: var(--amber); }

/* ============================================================
   HERO  (index page)
   ============================================================ */
.hero {
  position: relative;
  min-height: min(86vh, 900px);
  display: grid;
  align-items: end;
  overflow: hidden;
}
.hero__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.6s ease, transform 6s ease-out;
}
.hero__layer.in { opacity: 1; transform: scale(1); }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(16,14,12,.94) 0%, rgba(16,14,12,.42) 46%, rgba(16,14,12,.62) 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  padding-bottom: clamp(36px, 7vw, 96px);
}
.hero__eyebrow {
  color: var(--amber);
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  letter-spacing: .04em;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(40px, 8.5vw, 118px);
  max-width: 14ch;
  margin-bottom: 26px;
}
.hero__lead {
  max-width: 52ch;
  color: var(--ink);
  font-size: clamp(17px, 2.1vw, 21px);
  line-height: 1.5;
}
.hero__scroll {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-dim);
  font-size: 14px;
}
.hero__scroll .tick { width: 46px; height: 1px; background: var(--amber); display: inline-block; }

/* ============================================================
   INDEX GRID  — contact-sheet, deliberately varied sizing
   ============================================================ */
.index-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: 30px;
}
.index-head h2 { font-size: clamp(22px, 3vw, 30px); }
.index-head .count { color: var(--ink-dim); font-size: 14px; font-family: "Space Grotesk", sans-serif; }

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding-bottom: 120px;
}

.tile {
  position: relative;
  grid-column: span 2;
  aspect-ratio: 4 / 5;
  background: var(--bg-raise);
  overflow: hidden;
  isolation: isolate;
}
/* Rhythm: make the lead piece and a few others larger, contact-sheet feel */
.tile--wide { grid-column: span 4; aspect-ratio: 16 / 10; }
.tile--tall { grid-column: span 2; aspect-ratio: 3 / 5; }

.tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.92);
  transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .6s ease;
}
.tile:hover img { transform: scale(1.05); filter: saturate(1.05); }

.tile__meta {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 16px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(to top, rgba(14,12,10,.86), rgba(14,12,10,0));
  translate: 0 6px;
  opacity: .0;
  transition: opacity .45s ease, translate .45s ease;
}
.tile:hover .tile__meta,
.tile:focus-within .tile__meta { opacity: 1; translate: 0 0; }
.tile__title { font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 18px; }
.tile__idx  { font-family: "Space Grotesk", sans-serif; color: var(--amber); font-size: 13px; }

/* Placeholder tiles */
.tile--soon {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(255,255,255,.012) 11px 22px),
    var(--bg-raise);
}
.tile--soon .ph {
  text-align: center;
  color: var(--ink-faint);
}
.tile--soon .ph .n {
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 6px;
}
.tile--soon .ph .t { font-size: 12px; letter-spacing: .06em; }
.tile--soon:hover { border-color: var(--amber-lo); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 46px 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-dim);
  font-size: 14px;
}
.foot .sig { font-family: "Space Grotesk", sans-serif; color: var(--ink); font-size: 15px; }
.foot a:hover { color: var(--amber); }

/* ============================================================
   PROJECT PAGE
   ============================================================ */
.p-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: clamp(40px, 6vw, 72px);
}
.p-back {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-dim); font-size: 14px; width: max-content;
}
.p-back:hover { color: var(--amber); }
.p-back .ar { font-family: "Space Grotesk", sans-serif; }

.p-headrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-block: 30px 10px;
  border-bottom: 1px solid var(--line);
}
.p-idx {
  font-family: "Space Grotesk", sans-serif;
  color: var(--amber);
  font-size: 15px;
  padding-top: 12px;
}
.p-title { font-size: clamp(30px, 6vw, 68px); }
.p-year  { color: var(--ink-dim); font-size: 15px; margin-top: 12px; }

/* Stage: big image viewer + filmstrip */
.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding-top: 24px;
}
.stage__main {
  position: relative;
  background: #100e0c;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
}
.stage__main img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .4s ease;
}
.stage__main img.show { opacity: 1; }

.stage__nav {
  position: absolute; top: 0; bottom: 0;
  width: 24%;
  z-index: 3;
  border: 0; background: transparent; cursor: pointer;
  color: transparent;
}
.stage__nav:disabled { cursor: default; }
.stage__nav .chev {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(14,12,10,.5);
  color: var(--ink);
  display: grid; place-items: center;
  font-family: "Space Grotesk", sans-serif; font-size: 20px;
  opacity: 0; transition: opacity .3s ease, background .3s ease;
  backdrop-filter: blur(3px);
}
.stage__main:hover .stage__nav .chev { opacity: .85; }
.stage__nav:hover .chev { background: var(--amber); color: #17140f; opacity: 1; }
.stage__nav--prev { left: 0; } .stage__nav--prev .chev { left: 16px; }
.stage__nav--next { right: 0; } .stage__nav--next .chev { right: 16px; }

.stage__counter {
  position: absolute; z-index: 3; right: 14px; bottom: 12px;
  font-family: "Space Grotesk", sans-serif; font-size: 13px;
  color: var(--ink); background: rgba(14,12,10,.55);
  padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(3px);
}

.film {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 104px;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.film button {
  position: relative;
  border: 1px solid transparent;
  padding: 0; cursor: pointer;
  aspect-ratio: 4/3; background: var(--bg-raise);
  overflow: hidden;
}
.film img { width: 100%; height: 100%; object-fit: cover; opacity: .5; transition: opacity .3s ease; }
.film button:hover img { opacity: .85; }
.film button[aria-current="true"] { border-color: var(--amber); }
.film button[aria-current="true"] img { opacity: 1; }

/* Video section */
.p-video {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding-top: 4px;
}
.p-video .vid { margin: 0; }
.p-video video {
  width: 100%;
  display: block;
  background: #100e0c;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.p-video figcaption {
  color: var(--ink-dim);
  font-size: 13px;
  padding: 10px 2px 0;
}

/* Caption block */
.p-caption {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding-block: clamp(40px, 6vw, 72px);
  max-width: 62ch;
}
.p-caption .lead {
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.5;
  color: var(--ink);
}

/* Prev / next projects */
.p-move {
  display: flex; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--line);
  padding-block: 34px 90px;
}
.p-move a { display: flex; flex-direction: column; gap: 6px; max-width: 45%; }
.p-move .lbl { color: var(--ink-dim); font-size: 13px; }
.p-move .nm { font-family: "Space Grotesk", sans-serif; font-size: 20px; }
.p-move a:hover .nm { color: var(--amber); }
.p-move .next { text-align: right; margin-left: auto; align-items: flex-end; }
.p-move a.disabled { opacity: .3; pointer-events: none; }

/* Empty-state for undocumented project pages */
.p-empty {
  padding-block: clamp(60px, 12vw, 160px);
  text-align: center;
  color: var(--ink-dim);
}
.p-empty .big { font-family: "Space Grotesk", sans-serif; font-size: clamp(28px,5vw,52px); color: var(--ink); margin-bottom: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .tile, .tile--wide, .tile--tall { grid-column: span 1; aspect-ratio: 4/5; }
  .tile--wide { grid-column: span 2; aspect-ratio: 16/10; }
  .tile__meta { opacity: 1; translate: 0 0; } /* always show on touch */
  .masthead { flex-wrap: wrap; gap: 10px; }
  .masthead nav { width: 100%; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .tile, .tile--wide, .tile--tall { grid-column: span 1; aspect-ratio: 4/5; }
  .p-headrow { flex-direction: column; gap: 10px; }
  .film { grid-auto-columns: 84px; }
}
