/* site.css — layout for chrome, home, project page and index overlay. */

.pf-main { flex: 1 1 auto; }

/* ── Owner editing: media slots + editable text ─────────────────────── */
/* Once a slot actually has a <video> or <img>, drop the gray placeholder
   plate underneath. It leaks at the edges as a faint gray hairline from
   sub-pixel rounding / aspect-ratio rounding. .is-filled isn't reliably set
   on every slot kind, so we key off the actual contents with :has(). */
.mslot:has(> .mslot-media),
.mslot:has(> img),
.proj-fig-media:has(.mslot-media),
.proj-fig-media:has(img),
.idxov-tile-thumb:has(.mslot-media),
.idxov-tile-thumb:has(img) { background: transparent; }
.mslot { position: relative; width: 100%; overflow: hidden; background: var(--rule-soft); }
.mslot-media { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: transparent; display: block; }
.mslot image-slot { width: 100%; height: 100%; display: block; }
.mslot-tools { position: absolute; right: 8px; top: 8px; z-index: 4; display: flex; gap: 6px; opacity: 0; transition: opacity .15s ease; }
.mslot:hover .mslot-tools { opacity: 1; }
.mslot-tool {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.02em;
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule); color: var(--ink);
  padding: 4px 8px; cursor: pointer; transition: border-color .15s ease;
}
.mslot-tool:hover { border-color: var(--ink); }
.mslot-pop {
  position: absolute; right: 8px; top: 34px; z-index: 5;
  width: 250px; max-width: calc(100% - 16px);
  background: var(--bg); border: 1px solid var(--ink); padding: 11px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 14px 34px rgba(10,10,10,.18);
}
.mslot-pop-h { color: var(--ink-2); }
.mslot-pop-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); outline: none; }
.mslot-pop-input:focus { border-color: var(--ink); }
.mslot-pop-row { display: flex; gap: 7px; }
.mslot-pop-btn { flex: 1; font: inherit; font-size: 12px; font-weight: 500; padding: 7px 9px; cursor: pointer; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); transition: opacity .15s ease; }
.mslot-pop-btn:last-child { background: transparent; color: var(--ink); }
.mslot-pop-btn:hover { opacity: .82; }
.mslot-pop-note { color: var(--ink-3); font-size: 10px; }

/* Editable text affordance — owner only; quiet until hovered so the page
   reads clean, with a soft cue on hover and a clear box while editing. */
.is-editable { outline: 1px dashed transparent; outline-offset: 3px; border-radius: 2px; cursor: text; transition: outline-color .15s ease, background .15s ease; }
.is-editable:hover { outline-color: var(--ink-3); }
.is-editable:focus { outline: 1px solid var(--accent); background: color-mix(in oklab, var(--accent) 8%, transparent); }
/* A blanked-out field stays clickable so you can type into it again. */
.is-editable:empty { display: inline-block; min-width: 2.4em; min-height: 1em; outline-color: var(--ink-3); }

/* Edit-mode toggle + banner */
.pf-editbtn {
  position: fixed; top: 16px; right: 92px; z-index: 2147483000;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg); border: 1px solid var(--ink); border-radius: 999px;
  padding: 5px 13px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.pf-editbtn[data-on="true"] { background: var(--ink); color: var(--bg); }
.pf-editbtn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pf-editbanner {
  position: fixed; left: 50%; transform: translateX(-50%); top: 16px; z-index: 2147483000;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em;
  padding: 7px 16px; border-radius: 999px;
  box-shadow: 0 6px 22px rgba(10,10,10,.18);
}

/* Page container width */
.home, .proj { max-width: 1640px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }

/* View entrance — content always visible (no opacity animation: a
 * backgrounded/throttled tab can freeze a CSS animation at frame 0 and
 * strand opacity:0). A tiny transform-only nudge is safe. */
.pf-view { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .pf-view { animation: pf-rise 0.4s cubic-bezier(.2,.7,.3,1); }
}
@keyframes pf-rise {
  from { transform: translateY(10px); }
  to   { transform: translateY(0); }
}

/* ---- Fixed language toggle ---- */
.pf-langtoggle {
  position: fixed;
  top: 16px; right: 18px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.pf-langtoggle button { background: none; border: none; cursor: pointer; padding: 0; color: var(--ink-3); letter-spacing: inherit; }
.pf-langtoggle button[data-on="true"] { color: var(--ink); font-weight: 600; }

/* ============================ HOME ============================ */
.home { --home-gap: clamp(24px, 3.6vw, 44px); padding-top: 14px; padding-bottom: 56px; display: flex; flex-direction: column; gap: var(--home-gap); }

/* Top meta */
.home-top {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  font-size: 12px;
  gap: 16px;
}
.home-top-mark { font-weight: 600; display: inline-flex; align-items: center; }
.brand-logo-slot {
  display: block;
  height: 44px;
  width: 240px;
  margin-top: 10px;
  /* PNG is solid black on transparent — naturally adapts to dark text color. */
}
.brand-logo-slot::part(placeholder),
.home-top-mark .mslot-tools { font-size: 9px; }
/* image-slot's frame has a faint default fill (for empty/placeholder
   states) that shows through a transparent-PNG logo as light gray.
   Drop it here so the logo sits directly on the page background. */
.brand-logo-slot::part(frame) { background: transparent; }
.home-top-c { text-align: right; }
.home-top-pg { text-align: right; }
.home-top-rule {
  height: 1px;
  background: var(--ink);
  margin-top: calc(var(--home-gap) * -0.25);
}

/* Frame */
.home-frame-wrap { position: relative; }
.home-frame-label { position: absolute; top: -20px; left: 0; }
.home-frame {
  display: grid;
  grid-template-columns: repeat(2, minmax(44px, 70px)) 1fr 64px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  height: clamp(380px, 52vw, 620px);
  overflow: hidden;
}
.home-rails { display: contents; }
.home-rail {
  border: none;
  border-right: 1px solid var(--ink);
  background: transparent;
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
}
.home-rail:hover { background: var(--rule-soft); }
.home-rail-label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.home-rail-icon { transform: rotate(90deg); font-size: 13px; }

.home-title-area {
  display: flex; align-items: stretch; justify-content: stretch;
  padding: 0;
  min-width: 0;
}
.home-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 75%;
  font-size: var(--fs-mega);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-align: right;
  text-transform: none;
}
.font-display .home-h1 { font-weight: 400; letter-spacing: -0.02em; }
.home-h1-line { display: block; }

/* Hero media slideshow (user-fillable) */
.home-media { position: relative; width: 100%; height: 100%; background: var(--rule-soft); overflow: hidden; }
/* When a frame actually has a video/image/embed, kill the gray placeholder
   plate on the parent — it leaks at 3 edges as a faint gray border because
   the media's intrinsic aspect can leave the slot slightly under-covered at
   sub-pixel boundaries. */
.home-media:has(.home-media-video),
.home-media:has(.home-media-embed),
.home-media:has(img) { background: transparent; }
.home-media-frame {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .8s ease;
}
.home-media-frame[data-active="1"] { opacity: 1; visibility: visible; }
.home-media-frame image-slot { width: 100%; height: 100%; display: block; }
.home-media-video, .home-media-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: transparent; display: block; }

/* Per-slide tools */
.home-media-tools { position: absolute; right: 14px; top: 14px; z-index: 4; display: flex; gap: 6px; opacity: 0; transition: opacity .15s ease; }
.home-media:hover .home-media-tools { opacity: 1; }
.home-media-tool {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule); color: var(--ink);
  padding: 5px 10px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.home-media-tool:hover { border-color: var(--ink); }

/* Add-video popover */
.home-media-pop {
  position: absolute; right: 14px; top: 44px; z-index: 5;
  width: 260px; max-width: calc(100% - 28px);
  background: var(--bg); border: 1px solid var(--ink);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 14px 34px rgba(10,10,10,.16);
}
.home-media-pop-h { color: var(--ink-2); }
.home-media-pop-input {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 13px;
  padding: 8px 10px; border: 1px solid var(--rule);
  background: var(--bg); color: var(--ink); outline: none;
}
.home-media-pop-input:focus { border-color: var(--ink); }
.home-media-pop-row { display: flex; gap: 8px; }
.home-media-pop-btn {
  flex: 1; font: inherit; font-size: 12px; font-weight: 500;
  padding: 8px 10px; cursor: pointer;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  transition: opacity .15s ease;
}
.home-media-pop-btn:last-child { background: transparent; color: var(--ink); }
.home-media-pop-btn:hover { opacity: 0.82; }
.home-media-pop-note { color: var(--ink-3); font-size: 10px; }

.home-media-cap {
  position: absolute; left: 16px; bottom: 14px; z-index: 3;
  padding: 5px 10px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
  letter-spacing: 0.01em;
  pointer-events: none;
}
.home-media-dots { position: absolute; right: 14px; bottom: 14px; z-index: 3; display: flex; gap: 7px; }
.home-media-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent;
  cursor: pointer; padding: 0;
  transition: background .2s ease;
}
.home-media-dot[data-on="1"] { background: var(--ink); }
.home-media-dot[data-shape="square"] { border-radius: 1px; }
.home-media-dot[data-shape="circle"] { border-radius: 50%; }
.home-media-hint {
  position: absolute; left: 16px; top: 14px; z-index: 3;
  padding: 5px 10px;
  white-space: nowrap;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  pointer-events: none;
}

.home-edge { border-left: 1px solid var(--ink); display: flex; flex-direction: column; }
.home-edge-mark { padding: 12px 6px; border-bottom: 1px solid var(--ink); text-align: center; font-weight: 600; font-size: 13px; }
.home-edge-meta { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0; }
.home-edge-arrow { font-size: 11px; }
.home-edge-text { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; color: var(--ink-2); }
.home-edge-corner { border: none; border-top: 1px solid var(--ink); background: transparent; padding: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); transition: color .18s; }
.home-edge-corner:hover { color: var(--ink); }

/* ── Section hero plate (shared; mirrors the home hero frame) ──────────── */
.sec-hero-wrap { position: relative; margin: clamp(30px, 4vw, 46px) 0 clamp(26px, 3.5vw, 42px); }
.sec-hero-toplabel { position: absolute; top: -20px; left: 0; color: var(--ink-2); white-space: nowrap; }
.sec-hero-frame {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  height: clamp(240px, 30vw, 380px);
  overflow: hidden;
}
.sec-hero-rail { border-right: 1px solid var(--ink); position: relative; }
.sec-hero-rail-label {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 500; letter-spacing: -0.005em;
}
.sec-hero-title-area {
  display: flex; align-items: center; justify-content: flex-end;
  padding: clamp(16px, 2.4vw, 36px);
  min-width: 0;
}
.sec-hero-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700; font-stretch: 75%;
  font-size: clamp(34px, 6vw, 92px);
  line-height: 0.92; letter-spacing: -0.03em;
  text-align: right;
}
.font-display .sec-hero-h1 { font-weight: 400; letter-spacing: -0.02em; }
.sec-hero-h1-line { display: block; white-space: nowrap; }
.sec-hero-edge { border-left: 1px solid var(--ink); display: flex; flex-direction: column; }
.sec-hero-edge-mark { padding: 12px 6px; border-bottom: 1px solid var(--ink); text-align: center; font-weight: 600; font-size: 13px; }
.sec-hero-edge-meta { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0; }
.sec-hero-edge-arrow { font-size: 11px; }
.sec-hero-edge-text { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; color: var(--ink-2); }
.sec-hero-edge-corner { border: none; border-top: 1px solid var(--ink); background: transparent; padding: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); transition: color .18s; }
.sec-hero-edge-corner:hover { color: var(--ink); }

/* ── Project plate (each project framed like the hero) ─────────────────── */
.pplate-list { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 80px); }
.pplate-item { display: flex; flex-direction: column; gap: 18px; }
.pplate {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
}
.pplate-rail { border-right: 1px solid var(--ink); position: relative; overflow: hidden; transition: background .18s ease; }
.pplate:hover .pplate-rail { background: var(--rule-soft); }
.pplate-rail-title {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap; max-width: 78vh;
  font-family: var(--font-display);
  font-weight: 700; font-stretch: 75%;
  font-size: clamp(18px, 1.7vw, 26px);
  letter-spacing: -0.02em;
  transition: color .18s ease;
}
.font-display .pplate-rail-title { font-weight: 400; }
.pplate:hover .pplate-rail-title { color: var(--accent); }
.pplate-media { position: relative; min-width: 0; display: flex; }
.pplate-img { width: 100%; display: block; }
.pplate-cta {
  position: absolute; right: 12px; bottom: 12px; z-index: 4;
  padding: 5px 10px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule); color: var(--ink);
  opacity: 0; transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.pplate:hover .pplate-cta, .pplate:focus-visible .pplate-cta { opacity: 1; transform: translateY(0); }
.pplate-edge { border-left: 1px solid var(--ink); display: flex; flex-direction: column; }
.pplate-edge-mark { padding: 12px 6px; border-bottom: 1px solid var(--ink); text-align: center; font-weight: 600; font-size: 13px; }
.pplate-edge-meta { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0; }
.pplate-edge-arrow { font-size: 11px; }
.pplate-edge-text { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; color: var(--ink-2); }
.pplate-edge-corner { border-top: 1px solid var(--ink); padding: 10px; text-align: center; font-size: 14px; color: var(--ink-2); transition: color .18s ease; }
.pplate:hover .pplate-edge-corner { color: var(--accent); }
/* Caption below the plate */
.pplate-cap { display: flex; flex-direction: column; gap: 8px; padding: 0 2px; max-width: 64ch; }
.pplate-cap-meta { font-size: 13px; }
.pplate-cap-note { margin: 0; font-size: clamp(14px, 1.4vw, 17px); line-height: 1.5; }

/* Bio */
.home-bio { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: clamp(28px, 5vw, 64px); border-top: 1px solid var(--ink); padding-top: 22px; }
.home-bio-col { display: flex; flex-direction: column; gap: 12px; }
.home-bio-h { color: var(--ink-2); }
.home-bio-text { margin: 0; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.5; max-width: 40ch; }
.home-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: clamp(15px, 1.4vw, 18px); }
.home-avail { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.home-avail-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.home-cta { font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; cursor: pointer; margin-top: 2px; }
.home-cta:hover { color: var(--accent); }

/* Section head */
.home-sec-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline; border-bottom: 1.5px solid var(--ink); padding-bottom: 10px; }
.home-sec-head > :nth-child(2) { text-align: right; white-space: nowrap; }
.home-sec-head > :last-child { text-align: right; }

/* List — archive table. Columns: № / TITLE / CLIENT / TYPE / YEAR.
 * Monospace header row over a stack of bordered rows; large display
 * titles in the title column, quiet ink-3 grey metadata in the rest.
 * No hover preview — plain editorial table. */
.home-archive { display: flex; flex-direction: column; }
.home-archive-head,
.home-archive-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr) 80px;
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
}
.home-archive-head {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--rule);
}
.home-archive-list { list-style: none; margin: 0; padding: 0; }
.home-archive-row {
  padding: clamp(14px, 1.6vw, 22px) 2px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink);
  outline: none;
  transition: background .25s ease;
}
.home-archive-row:hover { background: color-mix(in oklab, var(--ink) 3%, transparent); }
.home-archive-row:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.home-archive-num {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.home-archive-title {
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  min-width: 0;
  text-wrap: balance;
}
.font-display .home-archive-title { font-family: var(--font-text); }
.home-archive-client,
.home-archive-type {
  font-size: 15px;
  color: var(--ink-3);
  letter-spacing: 0;
  line-height: 1.3;
  min-width: 0;
}
.home-archive-year {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-align: left;
}

/* Legacy table-list styling (kept for any callers still using .home-list) */
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list-head, .home-list-row {
  display: grid;
  grid-template-columns: 52px 1fr 26% 16% 64px 28px;
  gap: clamp(12px, 2vw, 28px);
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.home-list-head { color: var(--ink-2); }
.home-list-row { cursor: pointer; transition: padding 0.18s ease, background 0.18s ease; }
.home-list-row:hover { padding-left: 14px; padding-right: 6px; background: var(--rule-soft); }
.home-list-num { font-size: 12px; color: var(--ink-2); }
.home-list-title { font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.05; }
.font-display .home-list-title { font-family: var(--font-text); }
.home-list-client { font-size: 14px; }
.home-list-type { font-size: 13px; }
.home-list-year { font-size: 12px; }
.home-list-arrow { font-size: 17px; opacity: 0; transition: opacity .18s ease, transform .18s ease; justify-self: end; }
.home-list-row:hover .home-list-arrow { opacity: 1; transform: translateX(3px); }
.home-list-row:hover .home-list-title { color: var(--accent); }

/* Gallery */
.home-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.home-card { text-align: left; background: none; border: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.home-card-head { display: flex; justify-content: space-between; }
.home-card-img { width: 100%; aspect-ratio: 1 / 1.18; border: 1px solid var(--ink); transition: filter .25s ease; }
.home-card:hover .home-card-img { filter: contrast(1.05) brightness(0.97); }
.home-card-title { font-size: clamp(18px, 1.8vw, 24px); font-weight: 500; letter-spacing: -0.01em; }
.home-card-sub { font-size: 13px; display: block; }

/* Tiles */
.home-tiles { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.home-tile { text-align: left; background: none; cursor: pointer; display: flex; align-items: baseline; gap: clamp(12px, 1.5vw, 22px); padding: clamp(20px, 2.4vw, 34px) clamp(16px, 1.8vw, 26px); border: none; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transition: background .18s ease; }
.home-tile:hover { background: var(--rule-soft); }
.home-tile-num { color: var(--ink-2); font-size: 12px; }
.home-tile-title { flex: 1; font-size: clamp(22px, 2.6vw, 36px); font-weight: 500; letter-spacing: -0.02em; }
.home-tile-type { font-size: 12px; align-self: center; }
.home-tile-arrow { font-size: 18px; }

/* Home footer */
.home-foot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; align-items: end; border-top: 1.5px solid var(--ink); padding-top: 18px; }
.home-foot > :nth-child(2) { align-items: center; text-align: center; }
.home-foot > :last-child { align-items: flex-end; text-align: right; }
.home-foot-col { display: flex; flex-direction: column; gap: 5px; }
.home-foot-h { font-size: clamp(16px, 1.6vw, 22px); font-weight: 500; letter-spacing: -0.01em; }
a.home-foot-h:hover { color: var(--accent); }
.home-foot-pg { text-align: right; }

/* ============================ PROJECT ============================ */
.proj { padding-top: 0; padding-bottom: 64px; display: flex; flex-direction: column; }

.proj-bar {
  position: sticky; top: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 0;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(28px, 5vw, 56px);
}
.proj-bar-back { background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 500; justify-self: start; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.proj-bar-back:hover { color: var(--accent); }
.proj-bar-mark { background: none; border: none; cursor: pointer; font-weight: 600; font-size: 14px; justify-self: center; white-space: nowrap; display: inline-flex; align-items: center; }
.proj-bar-logo-slot { display: block; height: 20px; width: 110px; }
.proj-bar-logo-slot::part(placeholder) { font-size: 8px; }
.proj-bar-logo-slot::part(frame) { background: transparent; }
.proj-bar-nav { justify-self: end; display: inline-flex; align-items: center; gap: 14px; }
.proj-bar-nav button { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.proj-bar-nav button:hover { color: var(--ink); }
.proj-bar-count { color: var(--ink); white-space: nowrap; }
.proj-bar-index { border: 1px solid var(--ink) !important; border-radius: 999px; padding: 4px 11px !important; font-size: 11px !important; color: var(--ink) !important; white-space: nowrap; }

/* Title block */
.proj-head { display: flex; flex-direction: column; gap: 22px; }
.proj-head-eyebrow { display: flex; gap: 16px; }
.proj-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 75%;
  font-size: var(--fs-xl);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.font-display .proj-title { font-weight: 400; }
.proj-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 16px 0; }
.proj-meta-cell { display: flex; flex-direction: column; gap: 6px; }

.proj-meta-v { font-size: clamp(14px, 1.4vw, 17px); font-weight: 500; }

/* Lead image (legacy — kept for compat with other pages) */
.proj-lead { width: 100%; aspect-ratio: 16 / 8; margin-top: clamp(24px, 4vw, 48px); border: 1px solid var(--ink); }

/* ── Project carousel viewer ─────────────────────────────────────────────
 * Слева — крупный активный кадр в тонкой чёрной рамке; aspect-ratio
 * берётся из натуральных размеров загруженного изображения, поэтому
 * вертикальная фотография остаётся вертикальной, горизонтальная —
 * горизонтальной (никакого кадрирования).
 * Справа — анимированная стек-карусель миниатюр: активная карточка по
 * центру, соседние выглядывают сверху/снизу и плавно уходят в фон, как
 * на странице Works. Управление: колесо/тачпад, ↑↓, тач-свайпы, клик по
 * соседней карточке центрирует её и обновляет крупный план слева. */
.proj-viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 320px);
  grid-template-rows: auto 1fr;
  column-gap: clamp(20px, 2.6vw, 40px);
  row-gap: clamp(14px, 1.6vw, 22px);
  margin-top: clamp(24px, 4vw, 48px);
  align-items: start;
}

/* Два параллельных head-блока верхней строки. Линии border-bottom
   оказываются на одном уровне — верх изображения слева
   выравнивается с линией под INDEX справа. */
.proj-viewer-head {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 0;
}
.proj-viewer-head-l { grid-column: 1; }
.proj-viewer-head-r { grid-column: 2; }
.proj-viewer-rule { flex: 1 1 auto; height: 1px; background: var(--rule); }

.proj-viewer-stage { grid-column: 1; grid-row: 2; min-width: 0; }
.proj-viewer-rail-wrap {
  grid-column: 2; grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.proj-viewer-main {
  position: relative;
  width: 100%;
  max-height: 78vh;
  border: 1px solid var(--ink);
  background: var(--bg);
  overflow: hidden;
  transition: aspect-ratio .42s cubic-bezier(.32, .8, .25, 1);
}
.proj-viewer-main .mslot {
  position: absolute !important;
  inset: 0;
  height: 100%;
  background: var(--bg);
  aspect-ratio: auto !important;
}
.proj-viewer-main .mslot image-slot { width: 100%; height: 100%; }

/* Мono-каунтер под главным кадром */
.proj-viewer-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proj-viewer-caption-rule { flex: 1 1 auto; height: 1px; background: var(--rule); display: none; }

/* Старая «шапка» рейла — скрываем, вместо неё общий head-ряд сверху. */
.proj-viewer-rail-wrap > .proj-viewer-rail-head { display: none; }

/* Правая колонка целиком */
.proj-viewer-rail-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.proj-viewer-rail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proj-viewer-rail-rule { flex: 1 1 auto; height: 1px; background: var(--rule); }

/* Стек-карусель — основная сцена справа.
 * Высота примерно равна крупному плану слева, чтобы peek соседних
 * карточек был всегда виден. Перехватываем wheel руками, поэтому
 * native scroll-цепочка отключена. */
.proj-rail {
  position: relative;
  width: 100%;
  height: clamp(440px, 64vh, 640px);
  outline: none;
  overscroll-behavior: contain;
  touch-action: none;
}
.proj-rail:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.proj-rail-stage {
  position: absolute;
  inset: 0;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  overflow: hidden;
}

/* Карточка миниатюры — портретная рамка 3/4, тонкая чёрная обводка как у
 * остальных кадров. Внутри — MediaSlot с fit=contain, поэтому смешанные
 * горизонтальные и вертикальные изображения уживаются. */
.proj-rail-card {
  position: absolute;
  left: 50%;
  width: 86%;
  max-height: 76%;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%);
  transition:
    top       540ms cubic-bezier(.32, .8, .25, 1),
    transform 540ms cubic-bezier(.32, .8, .25, 1),
    opacity   400ms ease,
    box-shadow 320ms ease;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: 0 10px 24px rgba(10, 10, 10, 0.06);
  cursor: pointer;
  overflow: hidden;
  will-change: transform, opacity, top;
  user-select: none;
}
.proj-rail-card[data-active="1"] {
  box-shadow: 0 18px 44px rgba(10, 10, 10, 0.18);
  cursor: default;
}
.theme-ink .proj-rail-card { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55); }
.theme-ink .proj-rail-card[data-active="1"] { box-shadow: 0 18px 44px rgba(0, 0, 0, 0.85); }

.proj-rail-card .mslot {
  position: absolute !important;
  inset: 0;
  height: 100%;
  background: var(--bg);
  aspect-ratio: auto !important;
}
.proj-rail-card .mslot image-slot { width: 100%; height: 100%; }

/* Изображение внутри image-slot растягивается на всю рамку. Рамка
   имеет тот же aspect-ratio, что и фото, поэтому cover ничего не
   обрезает и пустых полей по краям не остаётся. */
.proj-viewer-main .mslot img,
.proj-viewer-main .mslot .pf-img,
.proj-rail-card .mslot img,
.proj-rail-card .mslot .pf-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Маленькая моно-марка с номером кадра в углу */
.proj-rail-card-num {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 3;
  padding: 2px 7px;
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  pointer-events: none;
}
.proj-rail-card[data-active="1"] .proj-rail-card-num { color: var(--ink); border-color: var(--ink); }

/* Стрелки ↑ ↓ внутри рейла */
.proj-rail-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 60;
  transition: border-color .18s ease, transform .18s ease;
}
.proj-rail-nav:hover { border-color: var(--ink); }
.proj-rail-nav:active { transform: translateX(-50%) scale(0.94); }
.proj-rail-nav-up   { top: 6px; }
.proj-rail-nav-down { bottom: 6px; }

.proj-rail-hint {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  padding-top: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .proj-rail-card { transition: opacity 0.001ms !important; }
  .proj-viewer-main { transition: none; }
}

/* Overview (legacy — used by other pages if any) */
.proj-overview { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(32px, 6vw, 80px); margin-top: clamp(32px, 5vw, 56px); }
.proj-overview-l { display: flex; flex-direction: column; gap: 14px; }
.proj-para { margin: 0; font-size: clamp(17px, 1.9vw, 24px); line-height: 1.45; letter-spacing: -0.01em; max-width: 44ch; }
.proj-para:first-of-type { font-weight: 500; }
.proj-overview-r { display: flex; flex-direction: column; gap: 14px; }
.proj-deliver { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.proj-deliver li { display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.proj-deliver-n { color: var(--ink-3); }

/* ── Project stage ───────────────────────────────────────────────────
 * Left column — Overview + Deliverables stacked. Right column — a 3-cell
 * image mosaic (one wide cell on top spanning both columns, two equal
 * cells below). Each cell's aspect-ratio is driven by the natural
 * dimensions of its uploaded image, so the boxes wrap to the picture
 * instead of the picture being cropped to the box. */
.proj-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  margin-top: clamp(28px, 4vw, 56px);
}
.proj-stage-l {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.6vw, 48px);
  position: sticky;
  top: 88px;
}
.proj-stage-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.proj-stage-block .proj-para {
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.55;
  letter-spacing: 0;
  max-width: 46ch;
  font-weight: 400;
}
.proj-stage-block .proj-para:first-of-type { font-weight: 400; }
.proj-stage-r { min-width: 0; }

/* Image mosaic: row 1 spans both columns (cell 1 = full width), the
   remaining cells flow into 2-col pairs below. Each cell's aspect-ratio
   is set inline from the natural dimensions of its uploaded image. */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 0.9vw, 14px);
}
.proj-cell {
  position: relative;
  margin: 0;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  min-width: 0;
}
.proj-cell:first-child { grid-column: 1 / -1; }
.proj-cell.is-filled { cursor: zoom-in; }

/* The MediaSlot inside fills the cell completely — no extra borders or
   ratio of its own, just an image filling the framed plate. */
.proj-cell .mslot {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
}
.proj-cell .mslot image-slot { width: 100%; height: 100%; }
.proj-cell .mslot img,
.proj-cell .mslot .pf-img,
.proj-cell .mslot .mslot-media {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* ── Project lightbox ───────────────────────────────────────────────────
 * Full-viewport overlay with a blurred backdrop and a vertical "card
 * index" stack of media — same interaction model as the Works
 * StackCarousel: scroll, ↑↓, touch, click neighbour to centre, click
 * active or backdrop to close. */
.proj-lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: block;
  background: color-mix(in oklab, var(--bg, #f4f1ea) 55%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(110%);
  backdrop-filter: blur(22px) saturate(110%);
  overflow: hidden;
  outline: none;
  animation: proj-lb-fade .22s ease;
}
@keyframes proj-lb-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.proj-lb-stage {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
}
.proj-lb-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform .55s cubic-bezier(.22, 1, .36, 1), opacity .35s ease;
  will-change: transform, opacity;
  cursor: pointer;
  pointer-events: auto;
  background: transparent;
  display: block;
  line-height: 0;
}
.proj-lb-card img,
.proj-lb-card video,
.proj-lb-card iframe {
  display: block;
  max-width: min(78vw, 1200px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--bg);
  border: none;
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.18);
}
.proj-lb-card[data-active="1"] img,
.proj-lb-card[data-active="1"] video,
.proj-lb-card[data-active="1"] iframe {
  box-shadow: 0 36px 80px rgba(10, 10, 10, 0.28);
}
.theme-ink .proj-lb { background: color-mix(in oklab, var(--bg, #0e0e0e) 55%, transparent); }
.theme-ink .proj-lb-card img,
.theme-ink .proj-lb-card video,
.theme-ink .proj-lb-card iframe { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }

.proj-lb-close {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, color .18s ease;
  z-index: 2;
}
.proj-lb-close:hover { background: var(--ink); color: var(--bg); }

.proj-lb-count {
  position: absolute;
  top: 28px;
  left: 28px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  z-index: 2;
}
.proj-lb-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .proj-lb { animation: none; }
  .proj-lb-card { transition: opacity .001ms; }
}

/* Gallery */
.proj-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 28px); margin-top: clamp(32px, 5vw, 56px); }
.proj-shot { width: 100%; border: 1px solid var(--ink); }
.proj-shot-full { grid-column: 1 / -1; }

/* Optional outro block — a quiet, full-width caption about the brand,
 * after all photos. No heading, no divider; small grey copy so it reads
 * as an aside, not a new section. */
.proj-outro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: clamp(28px, 4vw, 44px);
  /* full width of the editorial column */
}
.proj-outro-para {
  margin: 0;
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.55;
  letter-spacing: 0;
  color: rgba(0, 0, 0, 0.55);
  text-wrap: pretty;
  max-width: none;
}

/* Next teaser */
.proj-next { text-align: left; background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: clamp(8px, 0.9vw, 14px); margin-top: clamp(10px, 1.2vw, 18px); padding-top: clamp(8px, 1vw, 14px); padding-bottom: clamp(8px, 1vw, 14px); }
.proj-next-top { display: flex; align-items: center; gap: 14px; }
.proj-next-rule { flex: 1 1 auto; height: 1px; background: var(--rule); margin: 0 2px; }
.proj-next-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.proj-next-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-stretch: 75%; font-size: var(--fs-lg); letter-spacing: -0.03em; line-height: 0.95; transition: color .2s ease; }
.font-display .proj-next-title { font-weight: 400; }
.proj-next:hover .proj-next-title { color: var(--accent); }
.proj-next-img { width: clamp(180px, 26vw, 360px); aspect-ratio: 16 / 9; border: none; flex: 0 0 auto; }
.proj-next-imgwrap { width: clamp(180px, 26vw, 360px); flex: 0 0 auto; }
.proj-next-imgwrap .mslot { border: none; }
.proj-next-meta { padding-top: 2px; }

/* Project footer */
.proj-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: clamp(8px, 1vw, 16px); padding-top: 10px; border-top: 1px solid var(--ink); }
.proj-foot-all { background: none; border: none; cursor: pointer; font-size: 14px; font-weight: 500; }
.proj-foot-all:hover { color: var(--accent); }
.proj-foot-r { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.proj-foot-h { font-size: clamp(16px, 1.6vw, 22px); font-weight: 500; }
a.proj-foot-h:hover { color: var(--accent); }

/* ============================ WORKS (folders) ============================ */
.works { max-width: 1640px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 64px; display: flex; flex-direction: column; }

.works-head { display: flex; flex-direction: column; gap: 20px; }
.works-head-eyebrow { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.works-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700; font-stretch: 75%;
  font-size: var(--fs-xl);
  line-height: 0.9; letter-spacing: -0.03em;
}
.font-display .works-title { font-weight: 400; }
.works-title-line { display: block; }
.works-lede { margin: 0; font-size: clamp(16px, 1.7vw, 21px); line-height: 1.45; max-width: 52ch; }

/* Filter */
.works-filter { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--ink); padding-top: 18px; }
.works-filter-btn {
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.01em; color: var(--ink-2);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.works-filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.works-filter-btn.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.works-filter-btn.is-on .pf-em { color: color-mix(in oklab, var(--bg) 60%, var(--ink)); }

/* Folder grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(28px, 4vw, 52px) clamp(20px, 3vw, 40px);
  margin-top: clamp(28px, 4vw, 44px);
}
.works-item { text-align: left; background: none; border: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.works-folder {
  position: relative;
  width: 100%;
  aspect-ratio: 1.15 / 1;
  background: var(--folder, #e9d24a);
  border-radius: 4px 16px 16px 16px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px 14px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.works-folder::before {
  content: '';
  position: absolute; top: -11px; left: 0;
  width: 44%; height: 16px;
  background: var(--folder, #e9d24a);
  border-radius: 4px 12px 0 0;
}
.works-folder { --folder: color-mix(in oklab, var(--tone, #d8c8b6) 78%, #e9d24a); }
.theme-ink .works-folder { --folder: color-mix(in oklab, var(--tone, #d8c8b6) 50%, #d9b53a); }
.works-folder-id { color: rgba(10,10,10,.5); }
.works-folder-open { color: rgba(10,10,10,.62); opacity: 0; transform: translateX(-4px); transition: opacity .18s ease, transform .18s ease; }
.works-item:hover .works-folder { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(10,10,10,.12); }
.works-item:hover .works-folder-open { opacity: 1; transform: translateX(0); }
.works-item-meta { display: flex; flex-direction: column; gap: 2px; padding-left: 2px; }
.works-item-name { font-size: clamp(16px, 1.6vw, 21px); font-weight: 500; letter-spacing: -0.01em; }
.font-display .works-item-name { font-family: var(--font-text); }
.works-item-sub { font-size: 13px; }
.works-item:hover .works-item-name { color: var(--accent); }

/* ============================ PHOTO ============================ */
.photo { max-width: 1640px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 64px; display: flex; flex-direction: column; }

.photo-head { display: flex; flex-direction: column; gap: 22px; margin-bottom: clamp(20px, 3vw, 36px); }
.photo-head-eyebrow { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.photo-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 75%;
  font-size: var(--fs-xl);
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.font-display .photo-title { font-weight: 400; }
.photo-title-line { display: block; }
.photo-eyebrow-title {
  margin: 0;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.photo-intro { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(32px, 6vw, 80px); border-top: 1px solid var(--ink); padding-top: 20px; align-items: start; }
.photo-lede { margin: 0; font-size: clamp(17px, 1.9vw, 24px); line-height: 1.45; letter-spacing: -0.01em; max-width: 46ch; font-weight: 500; }
.photo-role { padding-top: 4px; line-height: 1.6; }

.photo-series-list { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 96px); margin-top: clamp(40px, 6vw, 72px); }
.photo-series { display: flex; flex-direction: column; gap: clamp(18px, 2.5vw, 32px); }
.photo-series-head {
  display: grid;
  grid-template-columns: 56px 1fr 1.1fr;
  gap: clamp(16px, 3vw, 48px);
  align-items: baseline;
  border-top: 1.5px solid var(--ink);
  padding-top: 18px;
}
.photo-series-id { color: var(--ink-2); }
.photo-series-titles { display: flex; flex-direction: column; gap: 8px; }
.photo-series-titlebtn {
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.photo-series-cta { color: var(--ink-2); opacity: 0; transform: translateX(-4px); transition: opacity .18s ease, transform .18s ease, color .18s ease; }
.photo-series-titlebtn:hover .photo-series-title { color: var(--accent); }
.photo-series-titlebtn:hover .photo-series-cta { opacity: 1; transform: translateX(0); }
.photo-series-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-stretch: 75%; font-size: var(--fs-lg); line-height: 0.95; letter-spacing: -0.03em; transition: color .18s ease; }
.font-display .photo-series-title { font-weight: 400; }
.photo-series-meta { line-height: 1.4; }
.photo-series-note { margin: 0; font-size: clamp(14px, 1.4vw, 17px); line-height: 1.5; max-width: 46ch; }

.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 1.6vw, 22px); }
.photo-grid-more {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; border: 1px dashed var(--rule); color: var(--ink-2);
  background: none; cursor: pointer; font: inherit;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.photo-grid-more:hover { border-color: var(--ink); color: var(--ink); background: var(--rule-soft); }
.photo-frame { width: 100%; border: 1px solid var(--ink); }
.photo-frame-full { grid-column: 1 / -1; }

/* Clickable cover → opens the project / series */
.photo-cover-link { position: relative; display: block; cursor: pointer; }
.photo-cover-link .mslot { transition: filter .18s ease; }
.photo-cover-link:hover .mslot { filter: contrast(1.03) brightness(0.98); }
.photo-cover-cta {
  position: absolute; right: 12px; bottom: 12px; z-index: 4;
  padding: 5px 10px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule); color: var(--ink);
  opacity: 0; transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.photo-cover-link:hover .photo-cover-cta,
.photo-cover-link:focus-visible .photo-cover-cta { opacity: 1; transform: translateY(0); }

/* Series detail */
/* Series detail */
.photo-cover-btn { background: none; border: none; padding: 0; cursor: pointer; width: 100%; position: relative; display: block; }
.photo-cover-btn .mslot { border: 1px solid var(--ink); }
.photo-cover-btn:hover .mslot { filter: contrast(1.03) brightness(0.98); }
.photo-cover-hint {
  position: absolute; right: 12px; bottom: 12px; z-index: 4;
  padding: 5px 10px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule); color: var(--ink); pointer-events: none;
}
.photoseries-note { display: flex; justify-content: space-between; align-items: baseline; gap: 32px; margin-top: clamp(28px, 4vw, 48px); flex-wrap: wrap; }
.photoseries-note .proj-para { margin: 0; max-width: 60ch; }
.photoseries-count { white-space: nowrap; }
.photoseries-gallery { margin-top: clamp(24px, 4vw, 44px); }

/* ============================ EDITORIAL PROJECT LAYOUT ============================
 * Centered title + lead, vertical stack of figures with rhythmic widths,
 * a small tail with extra paragraphs + deliverables. Replaces the old
 * 2-column meta + mosaic layout when .proj has class .proj--edit.
 */
/* Hide only the legacy mosaic block in editorial mode — keep .proj-head */
.proj--edit > .proj-stage { display: none; }

/* Editorial mode: meta sits right under the sticky header, no extra eyebrow gap */
.proj--edit > .proj-bar { margin-bottom: 0; border-bottom: none; }
.proj--edit > .proj-head { gap: 0; margin-top: 0; padding-top: 0; }
.proj--edit > .proj-head > .proj-meta { padding-top: 10px; padding-bottom: 14px; }

.proj--edit .proj-title {
  font-size: clamp(48px, 6vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: clamp(12px, 2vw, 24px) 0 clamp(16px, 2.4vw, 28px);
}

/* Optional lead paragraph (placed under the head OR between figures as an interlude) */
.proj-head-lead {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(15px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--ink);
  text-wrap: pretty;
}
.proj-figs-interlude {
  display: block;
  padding: clamp(8px, 1.5vw, 24px) 0;
}
.proj-figs-interlude > .proj-ed-tail {
  margin: 0 auto;
  padding: 0;
  border-top: none;
}

/* Editorial header — centered */
.proj-ed-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(18px, 2.2vw, 28px);
  max-width: 980px;
  margin: clamp(20px, 4vw, 48px) auto clamp(40px, 5vw, 64px);
  padding: 0 clamp(20px, 4vw, 40px);
}
.proj-ed-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
}
.proj-ed-eyebrow .pf-em { color: var(--ink-3); }
.proj-ed-dot { color: var(--ink-3); font-size: 10px; line-height: 1; }
.proj-ed-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700; font-stretch: 75%;
  font-size: clamp(54px, 9vw, 156px);
  line-height: 0.9; letter-spacing: -0.035em;
  text-wrap: balance;
}
.font-display .proj-ed-title { font-weight: 400; letter-spacing: -0.025em; }
.proj-ed-lead {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.5; letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: pretty;
}
.proj-ed-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 40px);
  width: 100%;
  margin: clamp(6px, 1vw, 14px) 0 0;
  padding: clamp(14px, 1.5vw, 20px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.proj-ed-meta > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.proj-ed-meta dt { margin: 0; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.proj-ed-meta dd { margin: 0; font-family: var(--font-sans); font-size: clamp(13px, 1.1vw, 16px); font-weight: 500; color: var(--ink); }

/* Editorial stage — vertical column of figures */
.proj-ed-stage { padding: 0; }
.proj-figs {
  display: flex; flex-direction: column;
  gap: clamp(40px, 6vw, 96px);
  margin: clamp(20px, 3vw, 48px) auto clamp(40px, 5vw, 72px);
  max-width: 1600px;
}
.proj-figs-row {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(16px, 2.4vw, 40px);
  width: 100%;
}
.proj-figs-row--solo { justify-content: center; }
.proj-figs-row--pair > .proj-fig { flex: 1 1 0; }

.proj-fig {
  position: relative;
  margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.proj-fig[data-w="xl"] { width: 100%; max-width: 1500px; }
.proj-fig[data-w="l"]  { width: 72%;  max-width: 1100px; }
.proj-fig[data-w="m"]  { flex: 1 1 0; max-width: 680px; }
.proj-fig[data-w="sm"] { width: 42%;  max-width: 520px; }

.proj-fig-media {
  position: relative; width: 100%;
  background: var(--rule-soft);
  overflow: hidden;
}
.proj-fig.is-filled .proj-fig-media { cursor: zoom-in; }
/* Project ph7: thin black hairline around every frame. An overlay sits ABOVE
   the image (which would otherwise cover an inset border on the left/right),
   so the outline is visible on all four sides. */
.proj-figs--bordered .proj-fig-media { position: relative; }
.proj-figs--bordered .proj-fig-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--ink);
  pointer-events: none;
  z-index: 3;
}
/* Project 07 (ph7): the lead/hero frame (first row) stays borderless — every
   other frame in the project keeps the hairline outline above. */
.proj-figs--bordered .proj-figs-row:first-child .proj-fig-media::after {
  display: none;
}
/* Once a slot has actual media (image or video), the gray placeholder plate
   under it can leak as a thin edge from sub-pixel rounding or an aspect-ratio
   mismatch with the container — looks like a faint gray border around the
   clip. Drop the placeholder bg in the filled state so there's nothing to
   leak. The black <video> bg still covers any true gaps if cover ever fell
   short, so this is purely additive. */
.proj-fig.is-filled .proj-fig-media,
.proj-fig.is-filled .proj-fig-media .mslot { background: transparent; }
.proj-fig-media .mslot {
  position: absolute !important; inset: 0;
  width: 100% !important; height: 100% !important;
  aspect-ratio: auto !important;
  background: transparent;
}
.proj-fig-media .mslot image-slot { width: 100%; height: 100%; }
.proj-fig-media .mslot img,
.proj-fig-media .mslot .pf-img,
.proj-fig-media .mslot .mslot-media {
  width: 100% !important; height: 100% !important;
  object-fit: cover !important;
  background: transparent !important;
}
.proj-fig-cap {
  display: flex; justify-content: flex-start; align-items: baseline;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 2px;
}
/* Owner-writable short caption label (e.g. LOGO / COLOR) after the numbering.
   Hidden entirely when empty on the public view; in edit mode the shared
   .is-editable:empty rule gives it a small clickable box. A separator only
   appears once there's text, so the numbering stays clean when unlabeled. */
.proj-fig-cap-label { color: var(--ink-2); }
.proj-fig-cap-label:not(:empty)::before { content: "· "; color: var(--ink-3); margin-left: 6px; }
.proj-fig-cap-label.is-editable:empty { margin-left: 6px; }

/* Tail block: deeper overview + deliverables, framed as a 2-col footer */
/* OVERVIEW + DELIVERABLES inline interlude: wide spread — paragraphs left, list far right */
.proj-ed-tail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: clamp(40px, 8vw, 160px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(24px, 3vw, 40px) 0;
  border-top: none;
}
.proj-ed-tail-l { display: flex; flex-direction: column; gap: 18px; max-width: 56ch; }
.proj-ed-tail-h { letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.proj-ed-para {
  margin: 0;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.55; letter-spacing: -0.005em;
  text-wrap: pretty;
}
.proj-ed-tail-r .proj-deliver { margin-top: 2px; }

@media (max-width: 800px) {
  .proj-ed-title { font-size: clamp(40px, 12vw, 80px); }
  .proj-ed-meta { grid-template-columns: repeat(2, 1fr); }
  .proj-figs-row { flex-direction: column; align-items: center; gap: 32px; }
  .proj-fig[data-w="xl"],
  .proj-fig[data-w="l"],
  .proj-fig[data-w="m"],
  .proj-fig[data-w="sm"] { width: 100%; max-width: none; }
  .proj-ed-tail { grid-template-columns: 1fr; }
}

/* ============================ INDEX / BASE OVERLAY ============================
 * Two modes: dense thumbnail grid ("base") and typographic list.
 * Both share the same top chrome (search, filters, view-toggle, close).
 */
.idxov {
  position: fixed; inset: 0; z-index: 2147482000;
  background: var(--bg);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(-1.5%);
  transition: transform .32s cubic-bezier(.2,.7,.3,1), opacity .2s ease;
}
.idxov.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Top bar */
.idxov-bar {
  display: grid; grid-template-columns: minmax(220px, 1fr) 2fr minmax(220px, 1fr);
  gap: 24px; align-items: center;
  padding: 14px clamp(20px, 4vw, 48px); padding-right: 100px;
  border-bottom: 1.5px solid var(--ink);
}
.idxov-bar-l { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 12px; }
.idxov-bar-mark { display: inline-block; width: 8px; height: 8px; background: var(--accent); }
.idxov-search { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--ink); padding: 6px 4px; }
.idxov-input { flex: 1; background: none; border: none; outline: none; font: inherit; font-size: 15px; color: var(--ink); }
.idxov-input::placeholder { color: var(--ink-3); }
.idxov-bar-r { display: inline-flex; align-items: center; gap: 12px; justify-self: end; }
.idxov-viewtoggle { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; padding: 2px; }
.idxov-viewtoggle button {
  background: none; border: 0; cursor: pointer; padding: 4px 12px;
  font: inherit; font-size: 14px; line-height: 1; color: var(--ink-2);
  border-radius: 999px; transition: background .15s ease, color .15s ease;
}
.idxov-viewtoggle button[data-on="true"] { background: var(--ink); color: var(--bg); }
.idxov-close { background: none; border: 1px solid var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 12px; color: var(--ink); transition: background .15s ease, color .15s ease; }
.idxov-close span { margin-left: 4px; }
.idxov-close:hover { background: var(--ink); color: var(--bg); }

/* Filters sub-bar */
.idxov-filters {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
  padding: 10px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
  font-size: 11px; letter-spacing: 0.04em;
}
.idxov-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.idxov-chip {
  background: none; border: 1px solid var(--rule); cursor: pointer;
  padding: 4px 10px; border-radius: 999px;
  font: inherit; font-size: inherit; color: var(--ink-2);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.idxov-chip:hover { border-color: var(--ink); color: var(--ink); }
.idxov-chip[data-on="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.idxov-years { margin-left: auto; }

/* === GRID (base) mode === */
.idxov-grid {
  flex: 1; overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
  padding: 0;
  border-top: 1px solid transparent;
}
.idxov-tile {
  position: relative;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 14px 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background .18s ease;
}
.idxov-tile:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.idxov-tile-thumb {
  position: relative; aspect-ratio: 4/5;
  background: var(--tone, var(--rule-soft));
  overflow: hidden;
}
.idxov-tile-media { position: absolute; inset: 0; width: 100%; height: 100%; }
.idxov-tile-tag {
  position: absolute; left: 6px; top: 6px; z-index: 2;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 10px; letter-spacing: 0.06em; white-space: nowrap;
  padding: 2px 6px;
}
.idxov-tile-meta { display: flex; flex-direction: column; gap: 4px; }
.idxov-tile-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; line-height: 1.15; letter-spacing: -0.01em;
  color: var(--ink); transition: color .15s ease;
  text-wrap: balance;
}
.font-display .idxov-tile-title { font-weight: 400; letter-spacing: -0.02em; }
.idxov-tile:hover .idxov-tile-title { color: var(--accent); }
.idxov-tile-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; }

/* Make the entire row of tiles share the same outer left/top edge so the
 * dense grid reads as a clean matrix — outer edges live on .idxov-grid. */
.idxov-grid { border-left: 1px solid var(--rule); border-right: 0; }
.idxov-tile:nth-child(-n+1) { border-top: 1px solid var(--rule); }

/* === LIST mode === */
.idxov-list { flex: 1; overflow-y: auto; padding: clamp(8px, 2vw, 24px) clamp(20px, 4vw, 64px) 64px; }
.idxov-row {
  width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--rule); cursor: pointer;
  display: grid; grid-template-columns: 64px 1fr auto 32px; gap: 24px;
  align-items: baseline; padding: clamp(14px, 1.8vw, 24px) 0;
  transition: padding .18s ease;
}
.idxov-row:hover { padding-left: 16px; }
.idxov-row:hover .idxov-title { color: var(--accent); }
.idxov-num { color: var(--ink-3); align-self: center; }
.idxov-title {
  font-family: var(--font-display); font-weight: 700; font-stretch: 75%;
  font-size: clamp(28px, 4.2vw, 64px); letter-spacing: -0.03em; line-height: 0.95;
}
.font-display .idxov-title { font-weight: 400; }
.idxov-meta { align-self: center; white-space: nowrap; }
.idxov-arrow { align-self: center; font-size: 18px; opacity: 0; transition: opacity .18s; justify-self: end; }
.idxov-row:hover .idxov-arrow { opacity: 1; }

.idxov-empty { grid-column: 1 / -1; padding: 60px 0; text-align: center; }

/* Hide MediaSlot owner-tools (drop / edit) inside the index — the user manages
 * media on the project pages; in the base view thumbnails should read as a
 * clean grid. */
.idxov-tile .mslot-tools, .idxov-tile .mslot-tool { display: none !important; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .home-top { justify-content: center; }
  .sec-hero-frame { grid-template-columns: 48px 1fr 52px; height: clamp(200px, 46vw, 300px); }
  .pplate { grid-template-columns: 44px 1fr 48px; }
  .pplate-rail-title { font-size: 16px; }
  .home-frame { grid-template-columns: repeat(2, 48px) 1fr 56px; height: 420px; }
  .home-rail:nth-child(4), .home-rail:nth-child(5) { display: none; }
  .home-bio { grid-template-columns: 1fr; }
  .home-list-head, .home-list-row { grid-template-columns: 36px 1fr 60px 24px; }
  .home-list-client, .home-list-type { display: none; }
  .home-gallery { grid-template-columns: repeat(2, 1fr); }
  .home-tiles { grid-template-columns: 1fr; }
  .home-foot { grid-template-columns: 1fr 1fr; }
  .proj-meta { grid-template-columns: repeat(2, 1fr); }
  .proj-overview { grid-template-columns: 1fr; }
  .proj-gallery { grid-template-columns: 1fr; }
  .proj-stage { grid-template-columns: 1fr; gap: 28px; }
  .proj-stage-l { position: static; }
  .proj-viewer {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  /* На узком экране стек переезжает под крупный план и становится ниже,
   * но всё ещё анимированной картотекой — те же scroll/touch/клик. */
  .proj-rail { height: clamp(360px, 48vh, 480px); }
  .proj-rail-card { width: clamp(160px, 42vw, 220px); }
  .proj-next-row { flex-direction: column; align-items: flex-start; }
  .photo-intro { grid-template-columns: 1fr; gap: 20px; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-series-head { grid-template-columns: 1fr; gap: 12px; }
  .photo-grid { grid-template-columns: 1fr; }
  .idxov-bar { grid-template-columns: 1fr; gap: 12px; padding-right: 100px; }
  .idxov-filters { gap: 12px; }
  .idxov-years { margin-left: 0; }
  .idxov-row { grid-template-columns: 40px 1fr 28px; }
  .idxov-meta { display: none; }
  .idxov-grid { grid-template-columns: repeat(2, 1fr); }
}
