/* ==========================================================================
   dayne.online — design system
   Monochrome, editorial, motion-led.
   ========================================================================== */

:root {
  --bg: #f5f4f1;
  --ink: #101010;
  --muted: #71706c;
  --line: rgba(16, 16, 16, 0.14);
  --accent: #c84b31; /* one accent, one job: the availability dot */
  --glass-tint: rgba(245, 244, 241, 0.4);

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "Fragment Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.65, 0.05, 0, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);

  --pad: clamp(1.25rem, 4vw, 4rem);
  --gap: clamp(1rem, 2.5vw, 2rem);

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-md: clamp(1rem, 1.1vw, 1.125rem);
  --text-lg: clamp(1.375rem, 2.4vw, 2rem);
  --text-xl: clamp(2rem, 5vw, 4.25rem);
  --text-display: clamp(3.5rem, 14vw, 13rem);
}

.theme-dark {
  --bg: #0c0c0c;
  --ink: #f3f2ef;
  --muted: #8d8c88;
  --line: rgba(243, 242, 239, 0.16);
  --glass-tint: rgba(12, 12, 12, 0.45);
}

/* ---------- Reset ---------- */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: clip;
}

img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--ink); color: var(--bg); }

/* Keyboard focus: one consistent, theme-aware ring */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Skip link: invisible until focused, then drops in from the top */
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 120;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.8em 1.3em;
  transform: translateY(calc(-100% - 1.5rem));
  transition: transform 0.3s var(--ease);
}

.skip-link:focus-visible {
  transform: none;
  outline-offset: -5px;
  outline-color: var(--bg);
}

/* Film-grain overlay, very faint; --grain swells during transitions */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: var(--grain, 0.035);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography helpers ---------- */

/* Film-rebate metadata: all labels run in mono, like frame markings */
.label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.serif-i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---------- Layout primitives ---------- */

.wrap { padding-inline: var(--pad); }

.section {
  padding-block: clamp(5rem, 12vw, 11rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.section-head h2 {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Spacing / inline-style replacements */
.section-end { padding-bottom: clamp(5rem, 12vw, 11rem); }
.pad-end-sm { padding-bottom: clamp(4rem, 8vw, 6rem); }
.push-top { margin-top: clamp(5rem, 12vw, 10rem); }
.label-block { display: block; margin-bottom: 2rem; }
.label-link { border-bottom: 1px solid currentColor; padding-bottom: 0.3em; }
.hero-note { text-transform: none; font-size: 1rem; letter-spacing: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding: clamp(1.1rem, 2.5vw, 1.6rem) var(--pad);
  mix-blend-mode: difference;
  color: #f3f2ef;
}

.site-header .logo { margin-right: auto; }

.bg-toggle {
  font-family: var(--mono);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.2rem;
}

.site-header a, .site-header button { color: #f3f2ef; }

.logo {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logo sup {
  font-size: 0.55em;
  font-weight: 400;
  margin-left: 0.2em;
  vertical-align: super;
}

.site-nav { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }

.site-nav a {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-block: 0.2em;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Burger — mobile only */
.menu-toggle {
  display: none;
  position: relative;
  z-index: 51;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  position: absolute;
  left: 50%;
  width: 1.5rem;
  height: 1.5px;
  background: currentColor;
  transform: translateX(-50%);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}

.menu-toggle span:nth-child(1) { top: calc(50% - 4px); }
.menu-toggle span:nth-child(2) { top: calc(50% + 3px); }

.menu-open .menu-toggle span:nth-child(1) { top: 50%; transform: translateX(-50%) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { top: 50%; transform: translateX(-50%) rotate(-45deg); }

/* mix-blend-mode traps the toggle in the header's stacking context,
   so the whole header must rise above the overlay while it is open */
.menu-open .site-header { z-index: 55; }

/* Mobile menu overlay */
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  padding-bottom: clamp(2rem, 8vw, 4rem);
  background: #0c0c0c;
  color: #f3f2ef;
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
}

.menu-open .menu { visibility: visible; }

.menu ol { counter-reset: m; margin-bottom: 3rem; }

.menu ol a {
  counter-increment: m;
  display: block;
  overflow: hidden;
  font-size: clamp(2.75rem, 11vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-transform: uppercase;
}

.menu ol a::before {
  content: counter(m, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.25em;
  font-weight: 400;
  letter-spacing: 0.08em;
  vertical-align: super;
  margin-right: 0.8em;
  color: var(--muted);
}

.menu ol a > span { display: inline-block; }

.menu-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(243, 242, 239, 0.16);
  padding-top: 1.25rem;
  font-size: var(--text-sm);
  color: #8d8c88;
}

@media (max-width: 760px) {
  .site-nav { display: none; }
  .menu-toggle { display: flex; }
}

@media (min-width: 761px) {
  .menu { display: none; }
}

/* ==========================================================================
   First-visit develop-in & page transition (frame advance)
   ========================================================================== */

/* Darkroom-timer loader: a circular dial sweeps while the first page
   develops. First visit per session only; ~2s; failsafe-fades even if
   scripts never arrive. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: #0c0c0c;
  color: #f3f2ef;
}

.js.preload .loader {
  display: flex;
  animation: loader-failsafe 0.6s ease 5s forwards;
}

@keyframes loader-failsafe {
  to { opacity: 0; visibility: hidden; }
}

.loader-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loader-dial {
  position: relative;
  width: clamp(7rem, 16vw, 9.5rem);
  aspect-ratio: 1;
}

.loader-dial svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* sweep starts at 12 o'clock */
}

.loader-dial .track {
  fill: none;
  stroke: rgba(243, 242, 239, 0.15);
  stroke-width: 1.5;
}

.loader-dial .ring {
  fill: none;
  stroke: #f3f2ef;
  stroke-width: 1.5;
  stroke-dasharray: 339.292; /* 2 * pi * r54 */
  stroke-dashoffset: 339.292;
}

.loader-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.loader-pct::after {
  content: "%";
  font-size: 0.7em;
  margin-left: 0.15em;
  color: #8d8c88;
}

.loader .label { color: #8d8c88; }

/* Liquid-glass transition: a frosted pane sweeps through the gate.
   The page stays visible through it, heavily blurred — the page swap
   happens behind the glass, and the new page sharpens as the pane
   exits. Edges feather out via a mask; a faint luminous gradient at
   each edge gives the glass its specular quality. */
.transition {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
}

.transition .strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 140vh; /* 100vh frosted core + 20vh feathered edges */
  transform: translateY(100vh); /* parked below the gate */
  background:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.3),
      rgba(255, 255, 255, 0) 18%,
      rgba(255, 255, 255, 0) 82%,
      rgba(255, 255, 255, 0.3)),
    var(--glass-tint);
  -webkit-backdrop-filter: blur(28px) brightness(1.06);
  backdrop-filter: blur(28px) brightness(1.06);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}

/* Without backdrop-filter the glass can't conceal the page swap —
   fall back to a near-opaque pane in the page color */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .transition .strip {
    background: var(--bg);
    opacity: 0.98;
  }
}

/* Arriving mid-transition: the gate starts covered by the frosted core */
.pt-in .transition .strip { transform: translateY(-20vh); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

.hero-title {
  font-size: var(--text-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.88;
  text-transform: uppercase;
  margin-left: -0.05em;
}

.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.char { display: inline-block; }

.hero-title .serif-i {
  font-size: 0.92em;
  text-transform: none;
  font-weight: 400;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  border-top: 1px solid var(--line);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-top: 1.1rem;
}

.hero-scroll {
  position: absolute;
  top: 50%;
  right: var(--pad);
  transform: rotate(90deg) translateX(-50%);
  transform-origin: right center;
}

/* Availability dot — the accent color's only job */
.status { display: inline-flex; align-items: center; gap: 0.6em; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 760px) {
  .hero-scroll { display: none; }
}

/* Full-bleed image that scales open under the hero */
.hero-figure {
  position: relative;
  overflow: hidden;
}

.hero-figure .frame { aspect-ratio: 16 / 9; }

@media (max-width: 760px) {
  .hero-figure .frame { aspect-ratio: 3 / 4; }
}

/* ==========================================================================
   Image frames (reveal + parallax containers)
   ========================================================================== */

.frame {
  position: relative;
  overflow: hidden;
  background: #e3e2de;
}

.theme-dark .frame { background: #181818; }

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* --vblur is the scroll-velocity softening; it lives here on the
     images (never on an ancestor) because a filtered ancestor becomes
     the containing block for position:fixed and breaks pinning. */
  filter: grayscale(1) contrast(1.04) blur(var(--vblur, 0px));
}

/* Hover zoom on linked frames */
a .frame img { transition: transform 0.9s var(--ease); }
a:hover .frame img, a:focus-visible .frame img { transform: scale(1.05); }

/* Parallax owns these transforms and updates them every scroll frame —
   a CSS transition would smear each update over 0.9s and fight the scrub */
a .frame[data-parallax] img,
a [data-parallax] .frame img { transition: none; }

/* ==========================================================================
   Intro statement
   ========================================================================== */

.statement {
  max-width: 62rem;
  font-size: var(--text-xl);
  font-weight: 450;
  letter-spacing: -0.025em;
  line-height: 1.14;
}

.statement .serif-i { font-weight: 400; }

/* word masks for any text split by JS (statement, project notes, about) */
[data-split-words] .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

[data-split-words] .word > span { display: inline-block; }

.statement-foot {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  max-width: 26rem;
  color: var(--muted);
}

/* ==========================================================================
   Featured work (home) — alternating editorial blocks
   ========================================================================== */

.feature {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  align-items: end;
}

.feature + .feature { margin-top: clamp(4rem, 10vw, 9rem); }

.feature-media { grid-column: 1 / 9; }
.feature:nth-child(even) .feature-media { grid-column: 5 / 13; order: 2; }

.feature-media .frame { aspect-ratio: 4 / 3; }

.feature-info {
  grid-column: 9 / 13;
  padding-left: var(--gap);
  padding-bottom: 0.25rem;
}

.feature:nth-child(even) .feature-info {
  grid-column: 1 / 5;
  order: 1;
  padding-left: 0;
  padding-right: var(--gap);
}

.feature-info .index {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.feature-info h3 {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.feature-info p {
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: 22rem;
}

.feature-info .more {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.25em;
  transition: opacity 0.3s ease;
}

.feature-info .more:hover { opacity: 0.5; }

@media (max-width: 760px) {
  .feature, .feature:nth-child(even) { display: block; }
  .feature-info, .feature:nth-child(even) .feature-info { padding: 1.25rem 0 0; }
}

/* ==========================================================================
   Marquee
   ========================================================================== */

.marquee {
  display: block;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: clamp(1rem, 2.5vw, 1.75rem);
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  gap: 0;
  will-change: transform;
  animation: marquee 28s linear infinite;
}

.marquee-track span {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  padding-right: 1.2em;
}

.marquee-track .serif-i { text-transform: none; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   Row list (journal index, home journal preview)
   ========================================================================== */

.row-list { border-top: 1px solid var(--line); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: baseline;
  gap: var(--gap);
  padding-block: clamp(1.4rem, 3vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.5s var(--ease);
}

.row:hover { padding-left: 1.25rem; }

.row .date {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row .title {
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.row .tag {
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Chips (journal filter, work view toggle) */
.chip {
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.5em 1.1em;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.chip:hover { color: var(--ink); border-color: var(--ink); }

.chip[aria-pressed="true"] {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}

/* Category filter (journal index) — chips appear once >1 category exists */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.row.is-hidden { display: none; }

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr auto; }
  .row .date { grid-column: 1 / -1; order: -1; }
}

/* Floating hover preview image */
.list-preview {
  position: fixed;
  z-index: 30;
  width: clamp(180px, 20vw, 300px);
  aspect-ratio: 4 / 5;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.9);
}

.list-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
}

/* ==========================================================================
   Work index grid
   ========================================================================== */

.page-head {
  padding-top: clamp(8rem, 18vh, 13rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.page-head h1 {
  font-size: var(--text-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.9;
  text-transform: uppercase;
  margin-left: -0.04em;
}

.page-head h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }

.page-head .sub {
  margin-top: 1.5rem;
  max-width: 28rem;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(2rem, 5vw, 4rem) var(--gap);
}

.work-card { grid-column: span 6; }

.work-grid .work-card:nth-child(4n + 1) { grid-column: 1 / 8; }
.work-grid .work-card:nth-child(4n + 2) { grid-column: 9 / 13; margin-top: clamp(3rem, 8vw, 7rem); }
.work-grid .work-card:nth-child(4n + 3) { grid-column: 1 / 5; }
.work-grid .work-card:nth-child(4n + 4) { grid-column: 6 / 13; margin-top: clamp(-3rem, -4vw, -1rem); }

.work-card .frame { aspect-ratio: 4 / 3; }
.work-grid .work-card:nth-child(4n + 2) .frame,
.work-grid .work-card:nth-child(4n + 3) .frame { aspect-ratio: 3 / 4; }

.work-card-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 0.9rem;
}

.work-card-info h2 {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.work-card-info .label { white-space: nowrap; }

/* Frame numbers on the work grid, like a contact sheet */
.work-grid { counter-reset: wfr; }

.work-card-info .label::before {
  counter-increment: wfr;
  content: "FR " counter(wfr, decimal-leading-zero) " — ";
}

@media (max-width: 760px) {
  .work-grid .work-card { grid-column: 1 / -1 !important; margin-top: 0 !important; }
}

/* View toggle on the work index */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* Contact-sheet mode: dense uniform thumbnails */
.work-grid.is-sheet { gap: var(--gap); }

.work-grid.is-sheet .work-card {
  grid-column: span 3 !important;
  margin-top: 0 !important;
}

.work-grid.is-sheet .work-card .frame { aspect-ratio: 3 / 2 !important; }

.work-grid.is-sheet .work-card-info { padding-top: 0.6rem; }
.work-grid.is-sheet .work-card-info h2 { font-size: var(--text-md); }

@media (max-width: 760px) {
  .work-grid.is-sheet .work-card { grid-column: span 6 !important; }
}

/* ==========================================================================
   Horizontal film strip (series pages)
   Native swipe strip by default; JS pins it on desktop so the page's
   scroll axis flips to horizontal inside the work.
   ========================================================================== */

.h-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  margin-top: clamp(3rem, 7vw, 6rem);
}

.h-scroll.is-pinned {
  overflow: hidden;
  scroll-snap-type: none; /* snapping fights the pinned scrub */
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.h-track {
  display: flex;
  gap: var(--gap);
  padding-inline: var(--pad);
  width: max-content;
  will-change: transform;
}

.h-item {
  flex: 0 0 auto;
  width: clamp(16rem, 38vw, 34rem);
  scroll-snap-align: center;
}

.h-item .frame { aspect-ratio: 3 / 2; }
.h-item.tall { width: clamp(12rem, 26vw, 24rem); }
.h-item.tall .frame { aspect-ratio: 3 / 4; }

.h-scroll { counter-reset: hfr; }

.h-item::after {
  counter-increment: hfr;
  content: "FR " counter(hfr, decimal-leading-zero);
  display: block;
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ==========================================================================
   Project detail
   ========================================================================== */

.project-head { padding-top: clamp(8rem, 18vh, 13rem); }

.project-head h1 {
  font-size: var(--text-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.9;
  text-transform: uppercase;
  margin-left: -0.04em;
}

.project-head h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }

.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, max-content));
  gap: 1rem 4rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.project-meta dt { font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.project-meta dd { font-size: var(--text-sm); font-weight: 500; }

.project-cover { margin-top: clamp(3rem, 7vw, 6rem); }
.project-cover .frame { aspect-ratio: 16 / 9; }

.project-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(3rem, 8vw, 7rem) var(--gap);
  padding-block: clamp(4rem, 9vw, 8rem);
}

.project-body .full { grid-column: 1 / -1; }
.project-body .left { grid-column: 1 / 8; }
.project-body .right { grid-column: 6 / 13; }
.project-body .small-left { grid-column: 2 / 7; }
.project-body .small-right { grid-column: 8 / 12; align-self: center; }

.project-body .frame { aspect-ratio: 4 / 3; }
.project-body .small-left .frame, .project-body .small-right .frame { aspect-ratio: 3 / 4; }
.project-body .full .frame { aspect-ratio: 16 / 9; }

/* Contact-sheet frame numbers, stamped automatically under each image */
.project-body { counter-reset: fr; }

.project-body .left::after,
.project-body .right::after,
.project-body .full::after,
.project-body .small-left::after,
.project-body .small-right::after {
  counter-increment: fr;
  content: "FR " counter(fr, decimal-leading-zero);
  display: block;
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.project-note {
  grid-column: 3 / 11;
  max-width: 38rem;
  margin-inline: auto;
  font-size: var(--text-lg);
  font-weight: 450;
  letter-spacing: -0.015em;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 760px) {
  .project-body > * { grid-column: 1 / -1 !important; }
  .project-note { text-align: left; }
}

/* Next project footer link */
.next-project {
  display: block;
  border-top: 1px solid var(--line);
  padding-block: clamp(4rem, 10vw, 8rem);
  text-align: center;
}

.next-project .label { display: block; margin-bottom: 1.5rem; }

.next-project .next-title {
  font-size: var(--text-xl);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  transition: letter-spacing 0.6s var(--ease);
}

.next-project:hover .next-title { letter-spacing: 0.02em; }

/* ==========================================================================
   Journal post
   ========================================================================== */

.post { max-width: 42rem; margin-inline: auto; }

/* Reading progress hairline */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

.post-head { text-align: center; padding-top: clamp(8rem, 18vh, 12rem); margin-bottom: clamp(3rem, 7vw, 5rem); }

/* Full-bleed cover under the post header */
.post-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.post-hero .frame { aspect-ratio: 21 / 9; }

@media (max-width: 760px) {
  .post-hero .frame { aspect-ratio: 4 / 3; }
}

.post-head .label { display: block; margin-bottom: 1.5rem; }

.post-head h1 {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.post-head .post-date { margin-top: 1.5rem; color: var(--muted); font-size: var(--text-sm); }

.post-body > * + * { margin-top: 1.6em; }

.post-body p { font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); line-height: 1.75; }

.post-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  line-height: 0.8;
  float: left;
  padding-right: 0.12em;
  padding-top: 0.08em;
}

/* Numbered chapters, contact-sheet style */
.post-body { counter-reset: ch; }

.post-body h2 {
  font-size: var(--text-lg);
  font-weight: 550;
  letter-spacing: -0.02em;
  margin-top: 2.4em;
  counter-increment: ch;
}

.post-body h2::before {
  content: counter(ch, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.post-body blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.3;
  text-align: center;
  padding-block: 1.2em;
  margin-block: 2em;
  border-block: 1px solid var(--line);
}

.post-body figure { margin-block: 3em; }
.post-body figcaption { margin-top: 0.8em; font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--muted); text-align: center; }

/* Magazine breakouts: images escape the reading column */
.post-body .full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.post-body .full-bleed .frame { aspect-ratio: 21 / 9; }

@media (max-width: 760px) {
  .post-body .full-bleed .frame { aspect-ratio: 4 / 3; }
}

/* Cross-link card (post -> series, series -> journal entry) */
.related {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border: 1px solid var(--line);
  padding: 1.1rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  transition: border-color 0.4s ease;
}

.related:hover { border-color: var(--ink); }

.related .thumb {
  width: 5.5rem;
  flex-shrink: 0;
}

.related .thumb .frame { aspect-ratio: 1; }

.related .label { display: block; margin-bottom: 0.4rem; }

.related .rel-title {
  display: block;
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.related .rel-arrow {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--muted);
  transition: transform 0.4s var(--ease), color 0.4s ease;
}

.related:hover .rel-arrow { transform: translateX(0.35rem); color: var(--ink); }

.post-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 1.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.post-foot a { border-bottom: 1px solid currentColor; padding-bottom: 0.2em; }
.post-foot a:hover { color: var(--ink); }

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem) var(--gap);
  align-items: start;
}

.about-grid .portrait { grid-column: 1 / 6; }
.about-grid .portrait .frame { aspect-ratio: 3 / 4; }

.about-copy { grid-column: 7 / 13; }

.about-copy .statement { font-size: clamp(1.5rem, 3vw, 2.4rem); }

.about-copy .bio { margin-top: 2.5rem; max-width: 34rem; color: var(--muted); }
.about-copy .bio + .bio { margin-top: 1.25rem; }

.about-list { margin-top: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }

.about-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}

.about-list li strong { font-weight: 500; font-size: var(--text-md); }

@media (max-width: 760px) {
  .about-grid .portrait, .about-copy { grid-column: 1 / -1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: #0c0c0c;
  color: #f3f2ef;
  padding: clamp(5rem, 12vw, 10rem) var(--pad) clamp(1.5rem, 3vw, 2.5rem);
}

.footer-cta { display: block; text-align: center; margin-bottom: clamp(4rem, 10vw, 8rem); }

.footer-cta .label { display: block; color: #8d8c88; margin-bottom: 2rem; }

.footer-cta .big {
  font-size: clamp(2.75rem, 10vw, 9rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
  display: inline-block;
  position: relative;
}

.footer-cta .big::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.04em;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}

.footer-cta:hover .big::after { transform: scaleX(1); transform-origin: left; }

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem 3rem;
  border-top: 1px solid rgba(243, 242, 239, 0.16);
  padding-top: 1.5rem;
  font-size: var(--text-sm);
  color: #8d8c88;
}

.footer-grid nav { display: flex; gap: 1.75rem; }
.footer-grid a:hover { color: #f3f2ef; }

.to-top { letter-spacing: 0.12em; text-transform: uppercase; font-size: var(--text-xs); }

/* ==========================================================================
   Custom cursor
   ========================================================================== */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f3f2ef;
  mix-blend-mode: difference;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0; /* revealed by JS on first mousemove */
  transition: width 0.35s var(--ease), height 0.35s var(--ease);
}

.cursor .cursor-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0c0c0c;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cursor.is-view { width: 72px; height: 72px; }
.cursor.is-view .cursor-label { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .js .cursor { display: flex; }
}

/* ==========================================================================
   Idle screensaver (home)
   ========================================================================== */

.screensaver {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #0c0c0c;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s 0.8s;
}

.screensaver.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease;
}

.screensaver .frame {
  position: absolute;
  inset: clamp(1.5rem, 5vw, 4rem);
  background: transparent;
}

.screensaver .frame img { object-fit: contain; }

.screensaver .label {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #8d8c88;
}

/* ==========================================================================
   Archive — infinite drag canvas
   Plain scrollable grid by default; html.archive-mode (set by JS)
   converts it to a fixed, draggable, endlessly tiling field.
   ========================================================================== */

.archive-page main { padding-top: clamp(7rem, 16vh, 11rem); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
  padding: var(--pad);
}

.ar-item .frame { aspect-ratio: 3 / 2; }
.ar-item:nth-child(3n) .frame { aspect-ratio: 3 / 4; }

.archive-grid { counter-reset: ar; }

.ar-item::after {
  counter-increment: ar;
  content: "FR " counter(ar, decimal-leading-zero);
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.archive-hint {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

.archive-mode { overflow: hidden; }
.archive-mode body { overflow: hidden; height: 100vh; }

.archive-mode main {
  position: fixed;
  inset: 0;
  padding: 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.archive-mode main:active { cursor: grabbing; }

.archive-mode .archive-canvas { position: absolute; inset: 0; }

.archive-mode .archive-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  grid-template-columns: repeat(4, clamp(14rem, 22vw, 22rem));
  gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(1rem, 2vw, 2rem);
  will-change: transform;
}

.archive-mode .ar-item img { pointer-events: none; }

.archive-mode .archive-hint { display: block; }

/* ==========================================================================
   Continuity transitions (View Transitions API, progressive)
   Clicking a tagged work thumbnail morphs it into the series cover on
   the next page (Darker Lights / Exo Ape pattern). Browsers without
   cross-document support fall back to the frame-advance overlay.
   ========================================================================== */

@view-transition {
  navigation: auto;
}

/* The destination cover only takes the shared name when the arrival
   was initiated from a tagged thumbnail (html.vt-in, set inline). */
.vt-in .project-cover .frame img { view-transition-name: cover; }

::view-transition-old(cover),
::view-transition-new(cover) {
  height: 100%;
  width: 100%;
  object-fit: cover;
  animation-duration: 0.65s;
}

::view-transition-group(cover) {
  animation-duration: 0.65s;
  animation-timing-function: cubic-bezier(0.65, 0.05, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-image-pair(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
