/* --- Variables (neutral, minimal) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg: #E0DBD7;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #7e7777;
  /* Home crosshair + hero frame only; set from js/app.js when a project is selected. */
  --home-line-accent: #7e7777;
  --gap: 1rem;
  --gap-large: 2.5rem;
  --radius: 2px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Filled or overridden by js/content-loader.js from Sanity Typography (see siteTypography). */
  --font-prose: var(--font);
  --font-strong: var(--font);
  --font-light: var(--font);
  /* Optional per-page overrides from Sanity (see content-loader.js). */
  --font-home-hero: var(--font-strong);
  --font-home-nav: var(--font-strong);
  --font-home-bio: var(--font-prose);
  --font-home-cv: var(--font-prose);
  --font-project-title: var(--font-strong);
  --font-project-prose: var(--font-prose);
  --font-project-tab: var(--font-strong);
  --font-project-meta: var(--font-light);
  --font-immersive-nav: var(--font-strong);
  --inset: 20pt;
  --abstraction-margin: 48pt;
}

/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
}

p {
  font-family: var(--font-prose), var(--font);
  font-size: 16px;
}

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

/* --- Views: one visible at a time --- */
.view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.view[hidden] {
  display: none !important;
}

/* Hide shell chrome until typography + Sanity content are applied (content-loader.js / app.js). */
.view--project.is-content-pending .project-split,
.view--project.is-content-pending .project-zoom-wrap {
  visibility: hidden;
}

.view--immersive.is-content-pending .immersive-nav,
.view--immersive.is-content-pending .immersive-flyer__viewport {
  visibility: hidden;
}

/* ========== HOME ========== */
.view--home {
  align-items: center;
  justify-content: center;
  padding: var(--gap);
}

.home-sdv-mark {
  display: none;
}

/* INFO mirrors the MATERIALS filter, anchored top-right instead of top-left.
   Anchored to the right edge only (no `left`) so its right edge always lands at
   `right: var(--gap)` and stays aligned with the bottom SDV mark, regardless of
   whether the panel scrollbar is present. */
.home-info-filter {
  position: absolute;
  top: var(--gap);
  right: var(--gap);
  left: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0.12rem;
  max-width: calc(50% - var(--gap) * 2);
  box-sizing: border-box;
  pointer-events: auto;
}

.home-info-toggle {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--fg);
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  line-height: 1.2;
}

.home-info-toggle:hover,
.home-info-toggle[aria-expanded="true"] {
  opacity: 1;
}

.home-info-toggle:focus-visible {
  outline: 2px solid rgba(0, 0, 0, .4);
  outline-offset: 2px;
}

.home-info-status {
  display: none;
  font-family: var(--font-prose), var(--font);
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.25;
  max-width: 100%;
}

.home-info-row {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.view--home.is-info-open .home-info-status {
  display: block;
}

.view--home.is-info-open .home-info-row {
  display: flex;
}

.home-info-filter-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  padding: 2px 8px;
  cursor: pointer;
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.home-info-filter-btn:hover {
  background: rgba(0, 0, 0, .04);
}

.home-info-filter-btn.is-on {
  background: rgba(0, 0, 0, .9);
  color: #f5f5f5;
}

.home-info-filter-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, .4);
  outline-offset: 2px;
}

@media (max-width: 599px) {
  #home-material-filter {
    display: none !important;
  }
}

.home-material-filter {
  position: absolute;
  top: var(--gap);
  left: var(--gap);
  right: 50%;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  pointer-events: auto;
  max-width: calc(50% - var(--gap) * 2);
  box-sizing: border-box;
  flex-direction: column;
}

.home-material-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-height: 0;
}

.home-material-title {
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  line-height: 1.2;
}

.home-material-status {
  font-family: var(--font-prose), var(--font);
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: 100%;
  line-height: 1.25;
}

.home-material-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.home-material-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  padding: 4px;
  cursor: pointer;
  line-height: 0;
}

.home-material-btn:hover {
  background: rgba(0, 0, 0, .04);
}

.home-material-btn.is-on {
  background: rgba(0, 0, 0, .9);
  color: #f5f5f5;
}

.home-material-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, .4);
  outline-offset: 2px;
}

.home-material-icon {
  width: 18px;
  height: 18px;
}

.home-line {
  position: absolute;
  background: var(--home-line-accent);
}

.home-line--vertical {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.home-line--horizontal {
  display: none;
}

@media (max-width: 599px) {
  .home-line--vertical {
    display: none;
  }

  .home-line--horizontal {
    display: block;
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }
}

.home-name-stacey,
.home-name-devoe {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  font-family: var(--font-home-hero), var(--font);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.2vw, 2.25rem);
  color: var(--fg);
  white-space: nowrap;
  line-height: 1;
  padding: 0;
  margin: 0;
}

html.sdv-preview .home-name-stacey,
html.sdv-preview .home-name-devoe {
  pointer-events: auto;
}

.home-name-stacey {
  letter-spacing: 0.06em;
  margin-right: -0.06em;
}

.home-name-devoe {
  letter-spacing: 0.06em;
}

/* Hero name: mobile = stacked on crosshair; desktop = one row, Stacey | de Voe. */
@media (min-width: 600px) {
  .home-name-stacey,
  .home-name-devoe {
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
  }

  .home-name-stacey {
    right: calc(50% + 0.65rem);
    left: auto;
    text-align: right;
  }

  .home-name-devoe {
    left: calc(50% + 0.65rem);
    right: auto;
    text-align: left;
  }
}

@media (max-width: 599px) {
  .home-name-stacey,
  .home-name-devoe {
    left: 50%;
    right: auto;
    text-align: center;
    margin-right: 0;
  }

  .home-name-stacey {
    bottom: calc(50% + 0.35rem);
    transform: translate(-50%, 0);
  }

  .home-name-devoe {
    top: calc(50% + 0.35rem);
    transform: translate(-50%, 0);
  }
}

.view--home.is-info-open .home-name-stacey,
.view--home.is-info-open .home-name-devoe,
.view--home.is-info-shelved .home-name-stacey,
.view--home.is-info-shelved .home-name-devoe {
  display: none;
}

/* SDV mark appears after info panel finishes sliding in (desktop). */
@media (min-width: 600px) {
  .view--home.is-info-shelved.is-info-sdv-visible .home-sdv-mark {
    display: block;
    position: absolute;
    right: var(--gap);
    bottom: var(--gap);
    pointer-events: none;
    font-family: var(--font-strong), var(--font);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(0.55rem, 1.5vw, 0.85rem);
  }
}

/* Mobile: same SDV mark delayed reveal; top-left when info panel is closed. */
@media (max-width: 599px) {
  .view--home.is-info-shelved.is-info-sdv-visible .home-sdv-mark {
    display: block;
    position: absolute;
    top: var(--gap);
    left: var(--gap);
    z-index: 5;
    pointer-events: none;
    font-family: var(--font-strong), var(--font);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
  }

  .view--home.is-info-open .home-sdv-mark {
    display: none;
  }
}

.home-info-panel {
  position: absolute;
  z-index: 4;
  background: var(--bg);
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s ease, visibility 0.35s ease;
  display: flex;
  flex-direction: column;
}

.home-info-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--gap-large) + 0.75rem);
  padding-top: calc(var(--gap-large) + 0.5rem);
  font-family: var(--font-prose), var(--font);
  /* Reserve the scrollbar track so panel text doesn't shift when it toggles,
     and keep the bar thin enough to stay clear of the INFO/SDV marks. */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.home-info-scroll::-webkit-scrollbar {
  width: 8px;
}

.home-info-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.home-info-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.home-info-section + .home-info-section {
  margin-top: 1.5rem;
}

.home-info-section__title {
  font-family: var(--font-strong), var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}

#home-info-bio,
#home-info-bio p,
#home-info-bio li,
#home-info-bio blockquote {
  font-family: var(--font-home-bio), var(--font-prose), var(--font);
}

#home-info-cv,
#home-info-cv p,
#home-info-cv li,
#home-info-cv blockquote {
  font-family: var(--font-home-cv), var(--font-prose), var(--font);
}

.home-info-scroll p {
  margin: 0 0 0.75rem;
}

@media (min-width: 600px) {
  .home-info-panel {
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    transform: translateX(100%);
    border-left: 1px solid var(--line);
  }

  .view--home.is-info-open .home-info-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .home-info-scroll {
    padding-top: calc(var(--gap-large) + 3.5rem);
  }
}

@media (max-width: 599px) {
  .home-info-panel {
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    max-height: 50%;
    transform: translateY(-100%);
    border-bottom: none;
  }

  .view--home.is-info-open .home-info-panel {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .home-info-scroll {
    padding-top: calc(var(--gap) + 4.5rem);
  }
}

.home-main {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

@media (max-width: 420px) {
  .view--home {
    --gap: 0.65rem;
  }
}

/* Titles: full width of one side of the line */
.home-projects {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--gap);
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

@media (min-width: 600px) {
  .home-projects {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    padding: 0;
    padding-right: calc(var(--gap) + 0.25rem);
    box-sizing: border-box;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 599px) {
  .home-projects {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    padding: 0;
    padding-top: 0;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
  }
}

/* Big impact titles: all caps, no line wrap */
.home-project {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.15rem 0.25rem;
  border: none;
  background: none;
  font-family: var(--font-home-nav), var(--font-strong), var(--font);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--fg);
  cursor: pointer;
  text-align: inherit;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s ease-out, color 0.2s ease-out;
  font-size: clamp(1rem, 2.8vw, 1.5rem);
  box-sizing: border-box;
}

.home-project-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-project-material-icons {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 0.2rem;
  opacity: 0.9;
  pointer-events: none;
  line-height: 0;
  max-width: 42%;
  overflow: hidden;
  justify-content: flex-end;
}

.home-project-material-icons .home-material-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .home-project-material-icons {
    display: inline-flex;
  }
}

.home-project.is-active .home-project-material-icons {
  opacity: 1;
}

@media (min-width: 600px) {
  .home-project {
    /* Slightly smaller so longest title stays left of vertical line before mobile */
    font-size: clamp(1rem, 2vw, 1.45rem);
  }
}

@media (max-width: 599px) {
  .home-project {
    font-size: clamp(0.95rem, 4.6vw, 1.35rem);

    max-width: 100%;
  }
}

.home-project:hover,
.home-project:focus-visible {
  background: rgba(0, 0, 0, .9);
  color: #f5f5f5;
}

.home-project.is-active {
  background: rgba(0, 0, 0, .9);
  color: #f5f5f5;
}

/* ========== INFO (split: bio, links, cv) ========== */
.view--info {
  flex-direction: column;
}

.info-back {
  flex-shrink: 0;
  padding: var(--gap);
  color: var(--fg);
  text-decoration: none;
}

.info-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

@media (max-width: 599px) {
  .info-split {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}

.info-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.info-pane--right {
  border-right: none;
  border-left: 1px solid var(--line);
}

@media (max-width: 599px) {
  .info-pane {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--line);
  }

  .info-pane--right {
    border-left: none;
  }
}

.info-pane h2 {
  flex-shrink: 0;
  margin: 0 0 0 0.75rem;
  padding: 0 1rem 1rem 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-strong), var(--font);
}

.info-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--gap-large) var(--gap-large) var(--gap-large);
}

/* Hide scrollbars on main views (home, overview, immersive, info) */
.view,
.info-scroll,
.project-scroll,
.immersive-main {
  -ms-overflow-style: none;
  /* IE/Edge */
  scrollbar-width: none;
  /* Firefox */
}

.view::-webkit-scrollbar,
.info-scroll::-webkit-scrollbar,
.project-scroll::-webkit-scrollbar,
.immersive-main::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.info-scroll p {
  margin: 0 0 0.75rem;
}

/* ========== PROJECT OVERVIEW ========== */
.view--project {
  flex-direction: column;
}

.project-back {
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-strong), var(--font);
  line-height: 1.2;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
  padding-top: 0;
  font-family: var(--font-project-title), var(--font-strong), var(--font);
}

@media (min-width: 600px) {
  .view--project {
    --project-col-inset: var(--gap-large);
    --project-top-inset: var(--gap-large);
  }

  .project-pane--text .project-scroll,
  .project-pane--text .project-header,
  .project-pane--images .project-scroll {
    padding-left: var(--project-col-inset);
    padding-right: var(--project-col-inset);
  }

  /* Shared top inset keeps title row and tab row on the same horizontal line. */
  .project-pane--text .project-header {
    padding-top: var(--project-top-inset);
  }

  .project-pane--images .project-scroll.project-images {
    padding-top: var(--project-top-inset);
  }

  .project-timeline-wrap {
    top: 0;
  }

  .project-timeline {
    padding-top: 0;
  }
}

.project-header .project-back {
  font-size: 1.25rem;
  line-height: 1;
}

.project-header h2 {
  margin: 0;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-project-title), var(--font-strong), var(--font);
  position: static;
  background: transparent;
  line-height: 1.2;
}

#project-overview-text,
#project-overview-text p,
#project-overview-text li,
#project-overview-text blockquote {
  font-family: var(--font-project-prose), var(--font-prose), var(--font);
}

.project-split {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-overview-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

@media (max-width: 599px) {
  .project-split {
    position: relative;
    grid-template-columns: 1fr;
    /* Mobile focus modes (25% / 50% / 75%) */
    grid-template-rows: var(--split) calc(100% - var(--split));
    transition: grid-template-rows 260ms ease;
  }

  /* Draw the split line from one single source of truth. */
  .project-split::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: var(--split, 50%);
    height: 1px;
    background: var(--line);
    transform: translateY(-0.5px);
    pointer-events: none;
    z-index: 3;
  }
}

.project-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--line);
}

.project-pane--images {
  border-right: none;
  border-left: 1px solid var(--line);
}

@media (max-width: 599px) {
  .project-pane {
    border-right: none;
    border-left: none;
    /* The split line is rendered by .project-split::after for pixel-perfect alignment. */
    border-bottom: none;
  }

  .project-pane--images {
    border-left: none;
  }

  /* Text pane: inset wide enough that body copy clears split-line chevrons (left/right). */
  .project-pane--text .project-header,
  .project-pane--text .project-scroll {
    padding-left: calc(var(--gap) + 2.75rem);
    padding-right: calc(var(--gap) + 2.75rem);
  }

  .project-pane--images .project-scroll,
  .project-pane--images .project-scroll.project-images {
    padding-left: calc(var(--gap) + 2.75rem);
    padding-right: calc(var(--gap) + 2.75rem);
  }
}

.project-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--gap-large) var(--gap-large) 0 var(--gap-large);
  padding-top: 0;
}

.project-scroll h2 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 0.25rem;
  padding-bottom: 0.5rem;
  font-size: 1.25rem;
  background: var(--bg);
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
}

.project-scroll h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
}

.project-scroll p {
  margin: 0 0 0.75rem;
}

.project-material-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.25rem 0 0.75rem;
  opacity: 0.9;
}

.project-material-icons .home-material-icon {
  width: 18px;
  height: 18px;
}

.project-images {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Default project galleries (single list); vertically scrollable. */
.project-scroll.project-images {
  overflow-y: auto;
  overflow-x: hidden;
}

/* TAB galleries: the outer column doesn't scroll; each panel owns vertical scroll. */
.project-scroll.project-images.has-falls {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.project-images img {
  width: 100%;
  display: block;
}

.project-zoom-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--split, 50%);
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}

.project-zoom-wrap .project-zoom-btn,
.project-zoom-wrap .project-zoom-shift {
  pointer-events: auto;
}

@media (max-width: 599px) {

  /* Mobile: always show split controls on the dividing line. */
  .project-zoom-wrap {
    display: flex;
  }

  .view--project:not(.is-publication-tab) .project-zoom-btn {
    display: none;
  }
}

@media (min-width: 600px) {
  .view--project.is-publication-tab .project-zoom-wrap {
    display: flex;
  }
}

.project-zoom-btn {
  padding: 1rem 1rem 0.75rem 1rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.project-zoom-btn .icon-magnifier {
  width: 24px;
  height: 24px;
}

@media (max-width: 599px) {

  /* On mobile, zoom controls are anchored to .project-split (not the viewport). */

  .view--project {
    --gap-large: 1.15rem;
  }

  .project-pane--text .project-header {
    padding-top: var(--gap-large);
  }

  .project-pane--text .project-scroll {
    padding-bottom: 1.35rem;
  }

  .project-header h2 {
    font-size: 1.05rem;
  }

  .project-header .project-back {
    font-size: 1.05rem;
  }

  .project-scroll p,
  .project-scroll li,
  #project-overview-text p,
  #project-overview-text li {
    font-size: 0.875rem;
    line-height: 1.55;
  }

  .project-scroll h2,
  #project-overview-text h2 {
    font-size: 0.98rem;
  }

  .project-scroll h3,
  #project-overview-text h3 {
    font-size: 0.9rem;
    margin-top: 1.1rem;
  }

  .project-fall-meta {
    font-size: 0.72rem;
  }

  .project-timeline__item {
    font-size: 0.72rem;
  }

  .project-pane--images .project-scroll,
  .project-pane--images .project-scroll.project-images {
    /* Clearance for split-line chevrons above the tab strip */
    padding-top: 2rem;
  }
}

@media (max-width: 599px) {

  /* Split mode variables live on the shared project view so the overlay can follow. */
  .view--project {
    --split: 50%;
  }

  .project-timeline-wrap {
    top: 0;
  }

  .view--project[data-split="balanced"] {
    --split: 50%;
  }

  .view--project[data-split="text"] {
    --split: 25%;
  }

  .view--project[data-split="images"] {
    --split: 75%;
  }

  .project-zoom-controls {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
  }

  /* Mobile: make the magnifier a consistent square so its visual center is stable. */
  .project-zoom-btn {
    width: 3rem;
    height: 3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .project-zoom-shift {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
  }

  /* Place chevrons near the split line edges for thumb reach. */
  .project-zoom-shift--up,
  .project-zoom-shift--down {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .project-zoom-shift--up {
    left: var(--gap);
  }

  .project-zoom-shift--down {
    right: var(--gap);
  }

  .project-zoom-shift:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .project-zoom-shift-icon {
    width: 18px;
    height: 18px;
  }
}

/* Desktop: keep only the magnifier, hide chevrons. */
@media (min-width: 600px) {
  .project-zoom-controls {
    display: contents;
  }

  .project-zoom-shift {
    display: none;
  }
}

/* ========== IMMERSIVE ========== */
/* Layout: .immersive-page (section), .immersive-main (full bleed), .immersive-inner (content) */
.view--immersive.immersive-page {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.immersive-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 0.75rem 1rem 0.75rem 1rem;
  background: transparent;
  font-family: var(--font-immersive-nav), var(--font-strong), var(--font);
}

.immersive-nav a {
  color: #fff;
  text-decoration: none;
  text-shadow:
    0 0 4px #000,
    0 0 8px #000,
    0 1px 2px #000,
    1px 0 2px #000,
    0 1px 2px #000,
    -1px 0 2px #000,
    0 -1px 2px #000,
    1px 1px 3px #000;
}

.immersive-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.immersive-back-overview {
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
}

.immersive-index-link {
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
}

.immersive-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  z-index: 0;
}

.immersive-inner {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
  /* Clear the absolute Overview nav so first line isn’t cut off */
  padding-top: calc(2 * var(--gap) + 2em);
}

/* Full-bleed immersive when content is the overlocked flyer (match photo-story layout) */
.immersive-main:has(.immersive-flyer) {
  overflow: hidden;
}

.immersive-inner:has(.immersive-flyer) {
  padding: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding-top: 0;
}

.immersive-placeholder {
  width: 100%;
  max-width: 60ch;
  padding: 2rem;
  background: rgba(0, 0, 0, .04);
  color: var(--muted);
}

/* Overlocked: single archival scan + drag + loupe */
.immersive-flyer {
  --flyer-max: none;
  --flyer-paper: #e8e4dc;
  --flyer-ink: #2a2622;
  /* HUD scale (overridden at breakpoints) */
  --flyer-hud-btn: 2.35rem;
  --flyer-hud-icon: 21px;
  --flyer-hud-hint: 0.7rem;
  --flyer-hud-gap: 0.35rem;
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-light), var(--font);
  color: var(--flyer-ink);
}

.immersive-flyer__viewport {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, #cfc8be 0%, #b8b0a6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 0;
  cursor: default;
  touch-action: none;
  overflow: hidden;
}

.immersive-flyer__viewport.is-loupe-active {
  cursor: none;
}

.immersive-flyer__viewport.is-dragging:not(.is-loupe-active) {
  cursor: grabbing;
}

.immersive-flyer__viewport.is-dragging.is-loupe-active {
  cursor: none;
}

.immersive-flyer__viewport.is-flyer-flip-loading .immersive-flyer__sheet {
  opacity: 0.62;
  transition: opacity 0.12s ease;
}

.immersive-flyer__stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  max-height: none;
  aspect-ratio: unset;
  background: var(--flyer-paper);
  padding: 7%;
  box-sizing: border-box;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* In-canvas tools: bottom-right stack */
.immersive-flyer__hud {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: var(--flyer-hud-gap);
  padding:
    0 max(1rem, env(safe-area-inset-right)) max(var(--gap), env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
}

.immersive-flyer__hud-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: min(100%, 38rem);
  pointer-events: none;
}

.immersive-flyer__hud-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0;
  pointer-events: auto;
}

.immersive-flyer__tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--flyer-hud-btn);
  height: var(--flyer-hud-btn);
  min-width: var(--flyer-hud-btn);
  min-height: var(--flyer-hud-btn);
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 1);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 12px rgba(0, 0, 0, 0.25);
}

.immersive-flyer__tool-btn:hover {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.65);
}

.immersive-flyer__tool-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.immersive-flyer__tool-btn svg {
  width: var(--flyer-hud-icon);
  height: var(--flyer-hud-icon);
}

@media (max-width: 1024px) {
  .immersive-flyer {
    --flyer-hud-btn: 2.1rem;
    --flyer-hud-icon: 19px;
    --flyer-hud-hint: 0.65rem;
    --flyer-hud-gap: 0.3rem;
  }
}

@media (max-width: 768px) {
  .immersive-flyer {
    --flyer-hud-btn: 1.95rem;
    --flyer-hud-icon: 18px;
    --flyer-hud-hint: 0.6rem;
    --flyer-hud-gap: 0.28rem;
  }

  .immersive-flyer__hud-panel {
    max-width: min(100%, 32rem);
  }
}

@media (max-width: 480px) {
  .immersive-flyer {
    --flyer-hud-btn: 1.8rem;
    --flyer-hud-icon: 16px;
    --flyer-hud-hint: 0.55rem;
    --flyer-hud-gap: 0.22rem;
  }

  .immersive-flyer__hud-tools {
    gap: 0.15rem;
  }
}

.immersive-flyer__pan {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  pointer-events: auto;
  touch-action: none;
}

.immersive-flyer__sheet {
  position: relative;
  pointer-events: auto;
  touch-action: none;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
}

/* Hit-tests disabled; gives true 50%/50% of sheet border box for transform-origin in client space */
.immersive-flyer__transform-origin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  visibility: hidden;
}

.immersive-flyer__figure {
  margin: 0;
  pointer-events: auto;
}

/* Fits inside mat paper */
.immersive-flyer__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.immersive-flyer__img.is-ready {
  opacity: 1;
}

.immersive-flyer__img.is-preview {
  filter: blur(1px);
}

.immersive-flyer__loading {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  animation: immersive-flyer-spin 0.75s linear infinite;
  pointer-events: none;
}

.immersive-flyer.is-image-loading .immersive-flyer__loading {
  display: block;
}

@keyframes immersive-flyer-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Loupe: disk + magnifier stroke (matches site icon) */
.immersive-flyer__loupe {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 0;
  height: 0;
  pointer-events: none;
  color: #fff;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.immersive-flyer__loupe[hidden] {
  display: none !important;
}

.immersive-flyer__loupe-disk {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  overflow: hidden;
  /* Match mat paper where magnified UV is outside the scan (not black) */
  background: var(--flyer-paper);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.95),
    inset 0 0 12px rgba(0, 0, 0, 0.12);
}

.immersive-flyer__loupe-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}

.immersive-flyer__loupe-strip {
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
}

.immersive-flyer__loupe-strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  background: var(--flyer-paper);
}

/* Position (left/top) is set in JS next to the lens disk */
.immersive-flyer__loupe-ring {
  position: absolute;
  pointer-events: none;
  width: 26px;
  height: 26px;
  overflow: visible;
}

.project-gallery-panel-scroll img {
  cursor: pointer;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
}

.image-lightbox[hidden] {
  display: none !important;
}

.image-lightbox__close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font-strong), var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.35rem;
}

.image-lightbox__img {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  object-fit: contain;
  pointer-events: auto;
  user-select: none;
  cursor: inherit;
}

/* Custom single-direction arrow cursors*/
.image-lightbox.is-cursor-prev {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M17 7 L11 14 L17 21' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 14 14, pointer;
}

.image-lightbox.is-cursor-next {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M11 7 L17 14 L11 21' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 14 14, pointer;
}

.image-lightbox.is-cursor-default {
  cursor: default;
}

.project-timeline {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 0.65rem 0.85rem;
  justify-content: flex-start;
  align-items: baseline;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 0;
  background: transparent;
  border-bottom: none;
}

.project-timeline::-webkit-scrollbar {
  display: none;
}

.project-timeline-scroll {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  padding-bottom: 0.25rem;
}

.project-timeline-nav {
  flex-shrink: 0;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg);
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
}

.project-timeline-nav svg {
  width: 1rem;
  height: 1rem;
}

.project-timeline-nav:hover:not(:disabled),
.project-timeline-nav:focus-visible:not(:disabled) {
  opacity: 1;
}

.project-timeline-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.project-timeline-nav[hidden] {
  display: none !important;
}

@media (max-width: 599px) {
  .project-timeline-nav {
    display: none !important;
  }
}

.project-timeline-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.project-fall-meta {
  padding: 0.25rem 0 0 0;
  font-size: 0.8rem;
  opacity: 0.7;
  font-family: var(--font-project-meta), var(--font-light), var(--font);
}

.project-gallery-panels {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  isolation: isolate;
  contain: paint;
  clip-path: inset(0);
  scrollbar-width: none;
}

/* Desktop: disable user-initiated horizontal swiping/scrolling. */
@media (hover: hover) and (pointer: fine) {
  .project-gallery-panels {
    overflow-x: hidden;
    scroll-snap-type: none;
  }
}

.project-gallery-panels::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.project-gallery-panel {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

.project-gallery-panel-scroll {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-bottom: 1.25em;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-gallery-panel-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.project-timeline__item {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-family: var(--font-project-tab), var(--font-strong), var(--font);
  font-weight: 700;
  cursor: pointer;
  padding: 0.1rem 0;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(0.68rem, 0.95vw, 0.88rem);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-timeline__item:hover,
.project-timeline__item:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.project-timeline__item[aria-current="true"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}