/* failmode - archive of what the camera cannot hold */

:root {
  --field: #0e2438;
  --field-deep: #0a1a2b;
  --field-raise: #14304c;
  --paper: #f4f1e8;
  --dim: #a8bccd;
  --faint: #6e8aa3;
  --cyan: #1e4d7b;
  --flare: #ffffff;
  --ghost: #16314b;
  --mono: 'Fragment Mono', ui-monospace, monospace;
  --sans: 'Figtree', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(20px, 4vw, 56px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--field);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--paper); color: var(--field); }

/* grain varnish over the whole field */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--paper);
  color: var(--field);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.skip:focus { left: 0; }

a { color: var(--paper); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--flare);
  outline-offset: 3px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wrap { max-width: 1360px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.6rem;
  padding-bottom: 1.6rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-decoration: none;
}
.brand b { font-weight: 400; color: var(--flare); }

.masthead nav { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.masthead nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  transition: color 0.2s var(--ease);
}
.masthead nav a:hover { color: var(--flare); }

/* ----------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3rem, 8vh, 6rem);
  padding-bottom: clamp(4rem, 10vh, 8rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  position: relative;
  z-index: 1;
}

.ghost-word {
  position: absolute;
  top: -0.18em;
  right: -0.12em;
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(9rem, 24vw, 22rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--ghost);
  z-index: 0;
  user-select: none;
  white-space: nowrap;
  /* the ghost word is cropped by the hero's overflow; fade the cut edges so the display
     type dissolves into the field tier instead of shipping a hard seam at the boundary. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}

.kicker { color: var(--faint); margin-bottom: 2.2rem; }
.kicker .tick { color: var(--dim); }

h1 {
  font-weight: 800;
  font-size: clamp(3.4rem, 9vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 1.4rem;
}
h1 .stroke {
  color: var(--flare);
  /* warm aperture in a cold field: the display glow reads as lamplight, not screen-blue
     (house signature — darkness is the room, warmth is the work). */
  text-shadow: 0 0 9px rgba(255, 232, 205, 0.19);
}

.hero-sub {
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-weight: 300;
  line-height: 1.35;
  max-width: 24ch;
  text-wrap: balance;
  color: var(--dim);
  margin-bottom: 2.2rem;
}
.hero-sub em { font-style: normal; color: var(--paper); }

.hero-body { max-width: 44ch; color: var(--dim); font-size: 1rem; }
.hero-body strong { font-weight: 600; color: var(--paper); }

.hero-print { position: relative; }
.hero-print canvas { display: block; width: 100%; height: auto; background: var(--field-deep); }
.print-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.7rem;
  color: var(--faint);
}
.print-caption .id { color: var(--dim); }
.print-caption .state { color: var(--faint); }

/* two-line grid captions */
.print .print-caption { display: block; margin-top: 0.6rem; }
.cap-row { display: flex; justify-content: space-between; gap: 1rem; }
.cap-row .state { color: var(--faint); }
.cap-exif {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-top: 0.25rem;
}
/* EXIF is parameter-true: shutter stays lowercase (186s, 1/250s), never uppercased by an
   inherited .mono transform. Casing is part of the print's credibility. Used on the grid
   caption exif, the hero caption exif, and the darkroom exposure-triplet values. */
.cap-exif,
.exif-val { text-transform: none; }

/* ---------------------------------------------------------------- index */

.index { padding-top: clamp(3rem, 7vh, 5.5rem); padding-bottom: clamp(4rem, 9vh, 7rem); }

.index-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.section-label { color: var(--faint); margin-bottom: 1rem; }

.index-controls {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.viewmode { display: flex; }
.viewmode button {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--field-raise);
  color: var(--dim);
  border: 0;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.viewmode button[aria-pressed='true'] { background: var(--paper); color: var(--field); }
.viewmode button:hover:not([aria-pressed='true']) { color: var(--flare); }

.dial {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--dim);
  min-width: 260px;
}
.dial label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.dial output { font-family: var(--mono); font-size: 0.72rem; min-width: 5.5ch; color: var(--flare); }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 2px;
  background: var(--field-raise);
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 4px;
  height: 18px;
  background: var(--flare);
}
input[type='range']::-moz-range-thumb {
  width: 4px;
  height: 18px;
  border: 0;
  border-radius: 0;
  background: var(--flare);
}

.series { margin-bottom: clamp(3.5rem, 8vh, 6rem); }
.series:last-child { margin-bottom: 0; }

.series-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1rem 3rem;
  align-items: baseline;
  margin-bottom: 1.8rem;
}
.series-head h3 {
  font-weight: 800;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.series-head h3 .snum { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--faint); vertical-align: super; margin-right: 0.9rem; }
.series-head p { color: var(--faint); font-size: 0.9rem; max-width: 52ch; justify-self: end; text-align: left; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.6rem 1.4rem;
}

.print { grid-column: span 1; }
.print.wide { grid-column: span 2; }

.print button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.print canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--field-deep);
  transition: filter 0.25s var(--ease);
}
.print button:hover canvas { filter: brightness(1.18); }
.print .print-caption { pointer-events: none; }
.print button:hover .id { color: var(--flare); }

/* contact sheet mode: every series collapses to one strip */
#archive.sheet .grid { grid-template-columns: repeat(8, 1fr); gap: 1.4rem 0.5rem; }
#archive.sheet .cap-exif, #archive.sheet .state { display: none; }
#archive.sheet .print-caption { margin-top: 0.35rem; }
#archive.sheet .cap-row { justify-content: center; }
#archive.sheet .id { font-size: 0.6rem; letter-spacing: 0.04em; }
#archive.sheet .series { margin-bottom: 3rem; }
#archive.sheet .series-head p { display: none; }

@media (max-width: 900px) {
  #archive.sheet .grid { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------------------ statement */

.statement { background: var(--field-deep); padding-top: clamp(4rem, 10vh, 8rem); padding-bottom: clamp(4rem, 10vh, 8rem); }
.statement .wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 2rem 4rem; }
.statement blockquote {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 300;
  line-height: 1.35;
  max-width: 30ch;
  text-wrap: balance;
}
.statement blockquote strong { font-weight: 600; color: var(--flare); }
.statement figcaption { margin-top: 2rem; color: var(--faint); }
.statement-body { color: var(--dim); max-width: 58ch; align-self: end; }
.statement-body p + p { margin-top: 1rem; }

/* -------------------------------------------------------------- process */

.process { padding-top: clamp(4rem, 9vh, 7rem); padding-bottom: clamp(4rem, 9vh, 7rem); }
.process-intro { color: var(--dim); max-width: 58ch; margin-bottom: 3rem; }
.process-intro strong { font-weight: 600; color: var(--paper); }

.treatments { list-style: none; }
.treatments li {
  display: grid;
  grid-template-columns: 8ch minmax(0, 3fr) minmax(0, 7fr);
  gap: 1rem 2.5rem;
  align-items: baseline;
  padding: 1.5rem 0;
}
.treatments li:nth-child(even) { background: var(--field-deep); padding-left: 1.2rem; padding-right: 1.2rem; margin-left: -1.2rem; margin-right: -1.2rem; }
.treatments .tnum { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--faint); }
.treatments .tname { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.treatments .tdesc { color: var(--dim); font-size: 0.95rem; max-width: 58ch; }

/* --------------------------------------------------------------- prints */

.prints { background: var(--field-deep); padding-top: clamp(4rem, 9vh, 7rem); padding-bottom: clamp(4rem, 9vh, 7rem); }
.prints .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 4rem; }
.prints h3 { font-weight: 800; font-size: 1.25rem; margin-bottom: 1rem; }
.prints p { color: var(--dim); font-size: 0.95rem; max-width: 48ch; }
.prints .contact { margin-top: 1.4rem; }
.prints .contact a {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--flare);
  text-decoration: none;
  border-bottom: 1px solid var(--flare);
  padding-bottom: 2px;
}

/* --------------------------------------------------------------- footer */

footer { padding-top: 3rem; padding-bottom: 3rem; }
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--faint);
}
footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--flare); }

/* -------------------------------------------------------------- darkroom */

.darkroom {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(4, 10, 16, 0.96);
}
.darkroom.open { display: block; }

.darkroom-inner {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  padding: clamp(16px, 3vw, 48px);
  max-width: 1360px;
  margin: 0 auto;
}

.darkroom-stage { display: flex; align-items: center; justify-content: center; min-width: 0; }
.darkroom-stage canvas { display: block; max-width: 100%; max-height: calc(100vh - 2 * clamp(16px, 3vw, 48px)); background: var(--field-deep); }

.darkroom-rail {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  color: var(--dim);
  overflow-y: auto;
  padding-top: 0.4rem;
}
.darkroom-rail .dr-id { font-family: var(--mono); font-size: 1rem; letter-spacing: 0.1em; color: var(--flare); }
.darkroom-rail .dr-title { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.01em; color: var(--paper); line-height: 1.15; }
.darkroom-rail dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.2rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.darkroom-rail dt { color: var(--faint); }
.darkroom-rail dd { color: var(--dim); }
.darkroom-rail .dr-state { color: var(--faint); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }

.darkroom-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: auto; }
.darkroom button {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--field-raise);
  color: var(--paper);
  border: 0;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.darkroom button:hover { background: var(--paper); color: var(--field); }
.darkroom .dr-close { position: absolute; top: clamp(16px, 3vw, 48px); right: clamp(16px, 3vw, 48px); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-print { max-width: 480px; }
  .ghost-word { font-size: clamp(7rem, 30vw, 12rem); top: auto; bottom: -0.1em; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .series-head { grid-template-columns: 1fr; }
  .series-head p { justify-self: start; }
  .statement .wrap { grid-template-columns: 1fr; }
  .prints .wrap { grid-template-columns: 1fr; }
  .treatments li { grid-template-columns: 1fr; gap: 0.3rem; padding: 1.2rem 0; }
  .darkroom-inner { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .darkroom-stage canvas { max-height: 58vh; }
  .darkroom-rail { padding-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
