:root {
  --bg: #000000;
  --fg: #EDEDE8;
  --soft: #CFCFC9;
  --muted: #9A9A94;
  --line: #1F1F1F;
  --tile: #161616;
  --accent: #FF61E3;
  --serif: Newsreader, Georgia, serif;
  --display: var(--serif);
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: var(--fg); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout: name and links across the top, work full width below */
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 32px 40px 0; }
.content { min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 40px; }
.name { font-family: var(--display); font-size: 30px; line-height: 1.05; white-space: nowrap; }
.role { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.links { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; font-size: 14px; }
.links a { display: inline-block; padding: 6px 0; }
.links a[aria-current="page"] { color: var(--accent); }
@media (max-width: 699px) {
  .topbar { padding: 24px 20px 0; flex-direction: column; gap: 12px; }
  .links { justify-content: flex-start; }
  .content { padding: 24px 20px; }
}

/* Home grid */
.home-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.home-head h1, .home-head h2 { margin: 0; font-family: var(--display); font-size: 26px; line-height: 1.1; font-weight: 400; }
.home-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.filters { display: flex; gap: 4px; }
.filters button { background: none; border: 0; padding: 8px 10px; min-height: 36px; cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.filters button[aria-pressed="true"] { color: var(--accent); }
.filters button:hover { color: var(--fg); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; }
@media (max-width: 699px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
@media (min-width: 1800px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 12px; }
.tile[hidden] { display: none; }
.thumb { margin: 0; aspect-ratio: 4 / 5; background: var(--tile); overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--zoom, 1)); }
.cap { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; transition: opacity 0.2s ease; }
.cap .type { color: var(--muted); text-align: right; }
@media (hover: hover) {
  .tile .cap { opacity: 0; }
  .tile:hover .cap, .tile:focus-visible .cap { opacity: 1; }
}

/* Home views: Grid / Index, switched by the butterfly button */
.view[hidden] { display: none; }
.view { display: flex; flex-direction: column; gap: 40px; }
.view-toggle { display: none; position: sticky; bottom: 24px; align-self: flex-start; align-items: center; gap: 10px; z-index: 5; }
.js .view-toggle { display: flex; }
.view-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.82); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.view-btn img { width: 22px; height: 22px; transition: transform 0.2s ease; }
.view-btn:hover img { transform: scale(1.2); }
.view-pill { display: flex; gap: 20px; padding: 7px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.82); border: 1px solid #2A2A28; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.view-pill .on { color: var(--accent); }
.rows { margin: 0; padding: 0; list-style: none; max-width: 820px; }
.rows li[hidden] { display: none; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: baseline; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row .num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row-title { font-family: var(--display); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; font-weight: 300; }
.row-meta { grid-column: 2; font-size: 13px; color: var(--muted); }
.row:hover .row-title, .row:focus-visible .row-title { color: var(--accent); }
.row-preview { position: fixed; right: 40px; top: 50%; transform: translateY(-50%); width: min(30vw, 440px); aspect-ratio: 4 / 5; object-fit: cover; pointer-events: none; opacity: 0; transition: opacity 0.15s ease; z-index: 4; }
.row-preview.show { opacity: 1; }
@media (min-width: 1100px) and (hover: hover) { .view[data-view="index"] .rows { max-width: 52%; } }
@media (max-width: 1099px), (hover: none) {
  .row-preview { display: none; }
  .row { grid-template-columns: 32px minmax(0, 1fr); }
}

/* Pop-in on scroll (after Studio Dumbar): scale up from 80%, left tile first */
.js .pop .tile { opacity: 0; transform: scale(0.8); transition: transform 0.35s cubic-bezier(0, 0, 0, 1) 0.15s, opacity 0s linear 0.2s; }
.js .pop .tile:nth-child(2n) { transition-delay: 0.35s, 0.4s; }
@media (min-width: 1800px) {
  .js .pop .tile:nth-child(2n) { transition-delay: 0.15s, 0.2s; }
  .js .pop .tile:nth-child(3n+2) { transition-delay: 0.35s, 0.4s; }
  .js .pop .tile:nth-child(3n) { transition-delay: 0.55s, 0.6s; }
}
.js .pop .tile.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .pop .tile { opacity: 1; transform: none; transition: none; }
}

/* Project page */
.back { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.project-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.title { margin: 0; font-family: var(--display); font-size: clamp(40px, 6vw, 64px); line-height: 1.05; font-weight: 300; letter-spacing: -0.01em; }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.desc { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--soft); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; grid-auto-flow: dense; }
.gallery > * { grid-column: span 2; margin: 0; }
.gallery > .half { grid-column: span 1; }
@media (max-width: 699px) { .gallery > .half { grid-column: span 2; } }
.gallery img, .gallery video { width: 100%; height: auto; background: var(--tile); }
.shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; }

/* Lightbox */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0; background: rgba(0, 0, 0, 0.96); color: var(--fg); }
.lightbox[open] { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; grid-template-rows: 56px minmax(0, 1fr) 40px; align-items: center; justify-items: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lb-count { grid-column: 1 / 3; grid-row: 1; justify-self: start; font-family: var(--mono); font-size: 12px; color: var(--muted); padding-left: 8px; }
.lb-close { grid-column: 3; grid-row: 1; }
.lb-prev { grid-column: 1; grid-row: 2; }
.lb-next { grid-column: 3; grid-row: 2; }
.lb-img { grid-column: 2; grid-row: 2; max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--fg); }
.lb-btn:hover { color: var(--accent); }
.lb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* About */
.about { display: flex; flex-direction: column; gap: 40px; max-width: 640px; }
.about h1 { margin: 0; font-family: var(--display); font-size: clamp(40px, 6vw, 64px); line-height: 1.05; font-weight: 300; }
.bio { margin: 0; font-family: var(--serif); font-size: 23px; line-height: 1.5; color: var(--soft); }
.bio-text { display: flex; flex-direction: column; gap: 20px; }
.about h2 { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.clients { margin: 0; font-size: 16px; line-height: 1.7; }
.email { font-family: var(--serif); font-size: 27px; line-height: 1.3; color: var(--accent); }
.email:hover { text-decoration: underline; }
