/* Works index + standalone work pages */

main { padding: 120px var(--gutter) 90px; max-width: 1180px; }

/* long pages scroll under the header, so give it a black backing */
.site-header { background: linear-gradient(var(--bg) 72%, rgba(0, 0, 0, 0)); padding-bottom: 26px; }

/* ── index: a file-tree of finished pieces ─────────── */

.tree { margin-top: 10px; }
.tree-root {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--fg); color: var(--bg);
  padding: 8px 14px; font-weight: 600; font-size: 14px; letter-spacing: 0.04em;
}
.tree-root svg { stroke: var(--bg); }

.tree ol { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px dashed var(--mute); margin-left: 16px; }
.tree li { position: relative; padding: 22px 0 0 26px; }
.tree li::before { content: ''; position: absolute; left: -1px; top: 38px; width: 26px; border-top: 1px solid var(--line); }
.tree li::after { content: ''; position: absolute; left: 22px; top: 35px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }

.work-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  border: 1.5px solid var(--line); outline: 1px solid var(--line); outline-offset: -5px;
  padding: 9px 16px; text-decoration: none; max-width: 640px;
  transition: background 0.2s, color 0.2s;
}
.work-row:hover { background: var(--fg); color: var(--bg); }
.work-row .no { font-size: 11px; color: var(--mute); }
.work-row:hover .no { color: var(--bg); }
.work-row .t { font-family: var(--sans); font-weight: 600; font-size: 17px; }
.work-row .t small { font-family: var(--mono); font-weight: 400; font-size: 11px; margin-left: 10px; color: var(--mute); }
.work-row:hover .t small { color: var(--bg); }
.work-row .d { font-size: 11px; }

.work-row.ghost { border-style: dashed; outline: none; color: var(--mute); pointer-events: none; }

.aside-note { margin-top: 60px; max-width: 360px; font-size: 10.5px; color: var(--mute); border-top: 1px dotted #555; padding-top: 10px; }

/* ── a single work ─────────────────────────────────── */

main.work { max-width: 1320px; }

.crumbs { font-size: 10.5px; color: var(--mute); margin-bottom: 34px; display: flex; gap: 18px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; border-bottom: 1px solid #555; }
.crumbs a:hover { color: var(--fg); border-color: var(--fg); }

.w-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 1.5px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.w-title h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(24px, 3vw, 36px); max-width: 26ch; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
.w-date { font-size: 11px; color: var(--mute); white-space: nowrap; }

.work button { display: block; width: 100%; cursor: zoom-in; background: #0a0a0a; }
.work button img { width: 100%; height: 100%; object-fit: cover; }

/* 1 · square shot on one side, two landscape shots stacked on the other */
/* column ratio makes the square side ≈ the height of the two stacked shots */
.hero { display: grid; grid-template-columns: 1.31fr 1fr; gap: 10px; }
.hero .h-main { height: 100%; }
.hero .h-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
.hero .h-stack button { aspect-ratio: 4533 / 2933; height: 100%; }

/* 2 · text — details in one row, then the text in two columns across the full width */
.about { margin: 34px 0 64px; }
.about-meta { font-size: 11px; line-height: 1.7; color: var(--mute); }
ul.about-meta { list-style: none; margin: 0 0 22px; padding: 8px 0; display: flex; flex-wrap: wrap; border-top: 1px solid #333; border-bottom: 1px solid #333; }
ul.about-meta li { padding: 0 16px; border-left: 1px solid #333; }
ul.about-meta li:first-child { padding-left: 0; border-left: 0; }
.about-text { font-size: 14px; line-height: 1.65; columns: 2; column-gap: 48px; }
.about-text p { margin: 0 0 1em; }
.about-text p:last-child { margin-bottom: 0; }

/* 3 · photographs */
.set { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set button { aspect-ratio: 4533 / 2933; }

/* 4 · inner pages */
.pages { margin-top: 80px; }
.pg-head, .trail h3 {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid #333;
  display: flex; justify-content: space-between; align-items: center;
}
.pg-head h3 { font: inherit; margin: 0; }
.pg-ctrl { display: flex; gap: 6px; }
.pg-ctrl button {
  width: auto; cursor: pointer; background: none;
  border: 1px solid #555; color: var(--mute); padding: 3px 9px; font-size: 10px; letter-spacing: 0.08em;
}
.pg-ctrl button:hover, .pg-ctrl button.on { color: var(--bg); background: var(--fg); border-color: var(--fg); }

.pg-stage { position: relative; aspect-ratio: 2560 / 1440; background: #000; overflow: hidden; outline: none; }
.pg-stage:focus-visible { box-shadow: 0 0 0 1px var(--fg); }
.pg-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pg-img.enter { transform: translateX(var(--from, 2%)); }
.pg-img.on { opacity: 1; transform: none; }
.pg-stage .pg-prev, .pg-stage .pg-next { position: absolute; top: 0; bottom: 0; width: 50%; background: transparent; }
.pg-stage .pg-prev { left: 0; cursor: w-resize; }
.pg-stage .pg-next { right: 0; cursor: e-resize; }

.pg-bar { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.pg-ticks { flex: 1; display: flex; align-items: flex-end; height: 16px; border-bottom: 1px solid #444; }
.pg-ticks button { flex: 1; height: 100%; cursor: pointer; background: none; position: relative; }
.pg-ticks button::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 1px; height: 5px; background: #666; transition: height 0.2s; }
.pg-ticks button:hover::after { height: 10px; background: var(--fg); }
.pg-ticks button.cur::after { height: 16px; width: 2px; background: var(--fg); }
.pg-count { font-size: 11px; min-width: 60px; text-align: right; }

.pg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 24px; }
.pg-grid[hidden] { display: none; }
.pg-grid button { position: relative; cursor: pointer; aspect-ratio: 2560 / 1440; }
.pg-grid span { position: absolute; left: 4px; top: 4px; background: #000; font-size: 9px; padding: 0 4px; }
.pg-grid button:hover img { opacity: 0.8; }

/* 5 · video — clip on the far left, label beside it */
.video { margin-top: 80px; }
.v-row { display: grid; grid-template-columns: min(360px, 100%) 1fr; gap: 24px; margin-top: 14px; align-items: end; }
.yt-link { color: var(--mute); text-decoration: none; border-bottom: 1px solid #555; }
.yt-link:hover { color: var(--fg); border-color: var(--fg); }
.v-frame { width: 100%; aspect-ratio: 9 / 16; background: #0a0a0a; }
.v-frame iframe, .v-frame video { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
@media (max-width: 800px) { .v-row { grid-template-columns: 1fr; gap: 12px; } .v-frame { max-width: 360px; } }

/* process trail */
.trail { margin-top: 80px; max-width: 360px; }
.trail ol { list-style: none; margin: 0; padding: 0; }
.trail li { position: relative; padding: 6px 0 6px 18px; font-size: 11px; border-left: 1px solid var(--line); }
.trail li::before { content: ''; position: absolute; left: -3.5px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.trail a { text-decoration: none; }
.trail a:hover { text-decoration: underline; }
.trail .dt { color: var(--mute); margin-right: 8px; }

@media (max-width: 800px) {
  main { padding-top: 100px; }
  .work-row { grid-template-columns: 1fr auto; }
  .work-row .no { display: none; }
  .hero { grid-template-columns: 1fr; }
  .about { margin-bottom: 40px; }
  .about-text { columns: 1; }
  .set { grid-template-columns: 1fr; }
  .pg-grid { grid-template-columns: repeat(2, 1fr); }
}
