/* ============================================================
   Longagogo — "Wood Type" direction (1c, expanded in turn 2)
   Condensed poster caps, heavy rules, laid paper. Grayscale
   throughout — no hue anywhere, including in the noise.
   Every value below is a token. Change it here, not in a page.
   ============================================================ */

:root {
  /* --- Ink & paper ------------------------------------------------ */
  --paper:     #eaeaea;   /* page stock */
  --plate:     #dbdbdb;   /* unexposed photo plate */
  --ink:       #232323;   /* the heavy impression */
  --ink-soft:  #565656;   /* inactive tab, secondary caps */
  --rule:      #c4c4c4;   /* hairline between rows */
  --muted:     #6f6f6f;   /* meta / captions */
  --faint:     #949494;   /* plate labels, folios */

  /* No second colour on a grayscale press — so emphasis is a
     second, heavier impression instead. Active nav, hover, and
     a live project all print in this, the darkest value here. */
  --spot:      #0a0a0a;

  /* Warm tints, neutralised. Used inside the hatch and the
     letterpress offset shadows. */
  --ink-a09: rgba(0, 0, 0, .09);
  --ink-a28: rgba(0, 0, 0, .28);
  --ink-a35: rgba(0, 0, 0, .35);

  /* --- Type ------------------------------------------------------- */
  --display: "Antonio", "Oswald", "Haettenschweiler", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* --- Measure ---------------------------------------------------- */
  --measure: 1140px;
  --pad: clamp(20px, 4vw, 46px);
  --gutter: clamp(24px, 3.4vw, 40px);

  /* --- Rules ------------------------------------------------------ */
  --rule-heavy: 6px;      /* under the masthead */
  --rule-mid: 3px;        /* above a section */
  --rule-hair: 1px;       /* between rows */

  /* --- Surfaces --------------------------------------------------- */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.34'/%3E%3C/svg%3E");
  --hatch: repeating-linear-gradient(45deg, var(--ink-a09) 0 4px, transparent 4px 9px);
}

/* ============================================================
   Reset
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--noise);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--spot);
  outline-offset: 3px;
}

/* ============================================================
   Type primitives
   ============================================================ */

/* Tiny letterspaced mono — the voice of every caption on the site. */
.meta {
  font: 400 clamp(10px, 1.05vw, 12px)/1.7 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.meta--tight { line-height: 1; }
.meta--spread { letter-spacing: .22em; }
.meta--spot { color: var(--spot); }
.meta--ink { color: var(--ink); }
.meta--faint { color: var(--faint); }

/* Condensed poster caps. */
.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: .88;
  color: var(--ink);
  margin: 0;
}

/* ============================================================
   Shell
   ============================================================ */

.sheet {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 44px) var(--pad) clamp(48px, 6vw, 88px);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  position: static;
  display: inline-block;
  margin: 8px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font: 500 12px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ============================================================
   Masthead
   ============================================================ */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px 24px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: var(--rule-heavy) solid var(--ink);
}

.masthead__mark {
  font: 700 clamp(19px, 2.4vw, 27px)/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2.4vw, 32px);
  font: 400 clamp(10px, 1.05vw, 12px)/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--spot); }

/* ============================================================
   Page head — the big title block
   ============================================================ */

.page-head {
  padding: clamp(28px, 3.6vw, 46px) 0 clamp(22px, 2.8vw, 32px);
  border-bottom: var(--rule-hair) solid var(--rule);
}

.page-head--rule-mid { border-bottom: var(--rule-mid) solid var(--ink); }

.page-head__title {
  font: 700 clamp(46px, 11.5vw, 128px)/.88 var(--display);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin: 0;
  color: var(--ink);
}

.page-head__title--stacked { line-height: .9; }

.page-head .meta { margin-top: clamp(10px, 1.2vw, 16px); }

/* ============================================================
   Tab strip (gallery switcher, book shelves)
   ============================================================ */

.tabs {
  display: flex;
  flex-wrap: wrap;
  padding-top: clamp(14px, 1.8vw, 22px);
  border-bottom: var(--rule-hair) solid var(--rule);
}

.tab {
  font: 600 clamp(10px, 1.15vw, 13px)/1 var(--display);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 9px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--display);
}

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

.tab[aria-current="page"],
.tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ============================================================
   Plate — a photograph, or the space one will occupy
   ============================================================ */

.plate {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: var(--plate);
  background-image: var(--hatch);
}

.plate--square { aspect-ratio: 1; }

/* The single frame. Empty, it reserves a 4:3 plate sized so the
   caption still clears the fold. With a photograph in it, the
   negative decides the shape — nothing gets cropped here. The
   contact-sheet plates above still crop square, on purpose. */
.plate--frame {
  aspect-ratio: 4 / 3;
  width: min(100%, calc(74vh * 4 / 3));
  margin-inline: auto;
}

.plate--frame.has-image {
  aspect-ratio: auto;
  width: fit-content;
  max-width: 100%;
  background-image: none;
}

.plate--frame.has-image img {
  position: static;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
}

.plate--hairline { box-shadow: inset 0 0 0 1px var(--ink-a28); }

/* The letterpress offset: paper, then a hard shadow one step behind. */
.plate--offset {
  box-shadow:
    10px 10px 0 0 var(--paper),
    12px 12px 0 1px var(--ink-a35);
}

.plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Label shows only while the plate is empty. */
.plate::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 clamp(8px, .85vw, 10px)/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}

.plate.has-image::after { content: none; }

/* ============================================================
   Gallery index (photographs.html) — galleries as plates
   ============================================================ */

.plates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(34px, 4.4vw, 58px);
  padding-top: clamp(28px, 3.4vw, 44px);
}

.plate-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plate-card__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: var(--rule-mid) solid var(--ink);
  padding-top: 10px;
}

.plate-card__name {
  font: 600 clamp(20px, 2.9vw, 34px)/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}

.plate-card:hover .plate-card__name { color: var(--spot); }

/* ============================================================
   Frame grid (gallery.html) — ink gridlines between plates
   ============================================================ */

.frames {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  margin-top: clamp(26px, 3.2vw, 40px);
  background: var(--ink);
}

.frames a { position: relative; display: block; }

.frames a:hover .plate { opacity: .82; }

/* ============================================================
   Single frame (frame.html)
   ============================================================ */

#frame-plate {
  display: flex;
  justify-content: center;
}

.frame-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  padding: clamp(16px, 1.8vw, 22px) 0 clamp(18px, 2.2vw, 26px);
}

.frame-bar__nav {
  display: flex;
  gap: clamp(16px, 2vw, 26px);
  color: var(--ink);
}

.frame-bar__nav a:hover { color: var(--spot); }
.frame-bar__nav [aria-disabled="true"] {
  color: var(--rule);
  pointer-events: none;
}

.caption {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 32px;
  padding: clamp(18px, 2.2vw, 26px) 0 clamp(20px, 2.4vw, 28px);
  border-bottom: var(--rule-mid) solid var(--ink);
}

.caption__title {
  font: 600 clamp(24px, 3.4vw, 42px)/1.05 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}

.caption__where { display: block; margin-top: 8px; }

.caption__tech { text-align: right; line-height: 1.8; }

.filmstrip {
  display: flex;
  gap: 8px;
  padding: clamp(20px, 2.4vw, 28px) 2px 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filmstrip .plate {
  width: clamp(56px, 6.4vw, 78px);
  flex: none;
  opacity: .55;
}

.filmstrip a:hover .plate { opacity: .85; }

.filmstrip .plate[aria-current="true"],
.filmstrip a[aria-current="page"] .plate {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--ink);
}

/* ============================================================
   Rows — books, projects, about. One line per thing.
   ============================================================ */

.rows {
  display: flex;
  flex-direction: column;
  border-top: var(--rule-mid) solid var(--ink);
}

.row {
  display: grid;
  grid-template-columns: 56px 1fr 80px;
  gap: clamp(14px, 1.8vw, 24px);
  align-items: baseline;
  padding: clamp(16px, 1.9vw, 24px) 0;
  border-bottom: var(--rule-hair) solid var(--rule);
}

.row__title {
  font: 600 clamp(19px, 2.2vw, 28px)/1.1 var(--display);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink);
}

.row__note { display: block; margin-top: 7px; }

.row__right { text-align: right; }

.row[hidden] { display: none; }

/* Projects carry a thumbnail and a status. */
.row--project {
  grid-template-columns: clamp(72px, 8vw, 104px) 1fr;
  align-items: start;
}

.row--project .plate { width: 100%; }

.row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}

.status--working { color: var(--spot); }

.rows__foot {
  margin-top: clamp(24px, 3vw, 38px);
  letter-spacing: .18em;
  color: var(--faint);
}

/* ============================================================
   Home (index.html) — the poster
   ============================================================ */

.poster {
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 46px) var(--pad) clamp(28px, 3.4vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(40px, 7vw, 96px);
}

.poster__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.poster__bar {
  height: clamp(10px, 1.4vw, 17px);
  background: var(--ink);
}

.poster__wordmark {
  font: 700 clamp(52px, 15vw, 168px)/.82 var(--display);
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 0;
  padding: clamp(18px, 2.2vw, 30px) 0 6px;
}

.poster__rule {
  height: var(--rule-mid);
  background: var(--ink);
  margin-top: clamp(14px, 1.8vw, 22px);
}

.poster__line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  align-items: baseline;
  padding-top: clamp(12px, 1.5vw, 18px);
}

/* The 2×2 index at the foot of the poster. */
.index {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: var(--rule-mid) solid var(--ink);
}

.index__cell {
  padding: clamp(16px, 2vw, 24px) 0;
  border-bottom: var(--rule-hair) solid var(--rule);
}

.index__cell:nth-child(odd) {
  border-right: var(--rule-hair) solid var(--rule);
  padding-right: clamp(16px, 2vw, 24px);
}

.index__cell:nth-child(even) { padding-left: clamp(16px, 2vw, 24px); }

.index__cell:nth-last-child(-n+2) { border-bottom: 0; }

.index__name {
  font: 600 clamp(22px, 3vw, 36px)/1 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
}

.index__cell:hover .index__name { color: var(--spot); }

.index__cell .meta { margin-top: 8px; }

/* ============================================================
   About — a column of text, set in the same voice
   ============================================================ */

.column {
  max-width: 62ch;
  padding: clamp(28px, 3.4vw, 44px) 0 clamp(8px, 1.4vw, 18px);
}

.column p {
  font: 400 clamp(13px, 1.25vw, 15px)/1.85 var(--mono);
  color: var(--ink-soft);
  margin: 0 0 1.3em;
}

.column p:last-child { margin-bottom: 0; }

.column a { border-bottom: 1px solid var(--rule); }
.column a:hover { color: var(--spot); border-bottom-color: var(--spot); }

/* ============================================================
   Colophon
   ============================================================ */

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  margin-top: clamp(48px, 6vw, 84px);
  padding-top: clamp(14px, 1.8vw, 20px);
  border-top: var(--rule-hair) solid var(--rule);
}

/* ============================================================
   Narrow sheets
   ============================================================ */

@media (max-width: 720px) {
  .frames { grid-template-columns: repeat(2, 1fr); }
  .plates { grid-template-columns: 1fr; }
  .row { grid-template-columns: 40px 1fr; }
  .row__right { grid-column: 2; text-align: left; margin-top: 6px; }
  .row--project { grid-template-columns: 64px 1fr; }
  .row--project .row__right { grid-column: auto; }
  .caption__tech { text-align: left; }
  .index { grid-template-columns: 1fr; }
  .index__cell:nth-child(odd) { border-right: 0; padding-right: 0; }
  .index__cell:nth-child(even) { padding-left: 0; }
  .index__cell:nth-last-child(-n+2):not(:last-child) {
    border-bottom: var(--rule-hair) solid var(--rule);
  }
  .plate--offset {
    box-shadow: 6px 6px 0 0 var(--paper), 7px 7px 0 1px var(--ink-a35);
  }
}

@media (max-width: 420px) {
  .frames { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
