/* Darkroom: the work as one roll of film. The index is a contact sheet on a light table
   (negatives: light type on black film); each frame prints as a positive under the safelight. */

:root {
  --table: #f4f2ed;      /* light table */
  --film: #0f0e0d;
  --base: #1d1a17;       /* image area of a negative */
  --emul: #ebe5d7;       /* light parts of a negative */
  --edge: #b88a4c;       /* edge printing on the film */
  --marker: #c6352a;     /* red china marker */
  --ink: #141210;
  --muted: #6b655b;
  --safe-bg: #150d0c;    /* darkroom under the safelight */
  --safe: #d8735b;
  --safe-dim: #93513f;
  --paper: #f3ede6;
  --cond: "Archivo", "Arial Narrow", sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --gutter: clamp(18px, 5vw, 72px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.6 var(--cond); font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.skip { position: absolute; left: 12px; top: 12px; transform: translateY(-300%); padding: 8px 12px; background: var(--ink); color: #fff; z-index: 9; }
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--marker); outline-offset: 3px; }

/* ---------- contact sheet ---------- */
.sheet { background: var(--table); color: var(--ink); min-height: 100vh; }
.sleeve { padding: clamp(40px, 8vh, 88px) var(--gutter) clamp(26px, 4vh, 44px); display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 6px 48px; }
.sleeve-meta { grid-column: 1 / -1; margin: 0; font: 400 13px/1 var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.name { margin: 0; font-weight: 800; font-variation-settings: "wdth" 62; font-size: clamp(64px, 11vw, 168px); line-height: .82; letter-spacing: -.01em; text-transform: uppercase; }
.tag { margin: 0 0 .5em; max-width: 34ch; font-size: clamp(16px, 1.35vw, 19px); color: #2b2824; }

.roll { padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); }
.strip {
  --hole: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Crect x='6' y='2' width='12' height='10' rx='2.4' fill='%23f4f2ed'/%3E%3C/svg%3E");
  list-style: none; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  padding: 34px 12px 46px;
  background: var(--hole) repeat-x left 9px / 24px 14px, var(--hole) repeat-x left calc(100% - 9px) / 24px 14px, var(--film);
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 24px -14px rgba(0,0,0,.35);
}
.strip:nth-child(2) { transform: rotate(-.35deg); margin-left: clamp(0px, 1.2vw, 18px); }
.strip:nth-child(1) { transform: rotate(.2deg); }
.frame { position: relative; aspect-ratio: 3 / 2; }
.frame > a {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(10px, 1.2vw, 16px);
  background: var(--base); color: var(--emul); text-decoration: none; border-radius: 2px;
  transition: background-color .25s, color .25s;
}
.f-no { font: 400 12px/1 var(--mono); letter-spacing: .08em; opacity: .7; }
.f-title { align-self: end; font-weight: 700; font-variation-settings: "wdth" 70; font-size: clamp(26px, 3.1vw, 50px); line-height: .92; text-transform: uppercase; letter-spacing: .005em; }
.f-sub { margin-top: 8px; font: 400 12.5px/1.2 var(--mono); opacity: .75; }
.frame > a:hover, .frame > a:focus-visible { background: #262220; color: #fff; outline: none; }
.edge { position: absolute; left: 4px; bottom: -16px; font: 700 9.5px/1 var(--mono); letter-spacing: .14em; color: var(--edge); white-space: nowrap; pointer-events: none; }
.fogged { background: linear-gradient(100deg, var(--base) 0 28%, #4a2416 62%, #a4522a 88%, #c9763c); border-radius: 2px; opacity: .9; }

/* the china-marker circle, drawn by darkroom.js */
.mark { position: absolute; left: -16px; top: -14px; width: calc(100% + 32px); height: calc(100% + 28px); overflow: visible; pointer-events: none; z-index: 2; }
.mark path { fill: none; stroke: var(--marker); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .92; transition: stroke-dashoffset .5s cubic-bezier(.5, 0, .3, 1); }
.frame:hover .mark path, .frame:focus-within .mark path { stroke-dashoffset: 0; }

/* frames develop once on arrival */
.js .sheet .frame > a { opacity: 0; transition: opacity 1.1s ease calc(var(--i) * 110ms + 150ms), background-color .25s, color .25s; }
.js .sheet.developed .frame > a { opacity: 1; }

.margin { display: flex; flex-wrap: wrap; gap: 8px 36px; padding: clamp(40px, 7vh, 72px) var(--gutter) 40px; font: 400 14px/1.4 var(--mono); color: var(--muted); }
.margin p { margin: 0; }
.margin p:first-child { flex: 1 1 100%; color: var(--ink); }
.margin a { color: var(--ink); text-decoration-color: rgba(0,0,0,.3); text-underline-offset: 3px; }
.margin a:hover { text-decoration-color: var(--marker); }

/* ---------- print pages: under the safelight ---------- */
.room { background: radial-gradient(120% 70% at 50% -20%, rgba(170, 34, 20, .22), transparent 60%), var(--safe-bg); color: var(--safe); min-height: 100vh; }
.safebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--gutter); font: 400 14px/1.2 var(--mono); }
.safebar a { text-decoration: none; }
.safebar a:hover { color: #f0a08a; }
.safebar .count { color: var(--safe-dim); }
.pn { display: flex; gap: 22px; }
.bench { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 300px); gap: clamp(28px, 5vw, 80px); align-items: start; padding: clamp(18px, 4vh, 40px) var(--gutter) 40px; max-width: 1240px; }
.print { background: var(--paper); color: var(--ink); padding: clamp(22px, 4.2vw, 58px); box-shadow: 0 34px 70px -24px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.3); transform: rotate(-.45deg); }
.emulsion > :first-child { margin-top: 0; }
.p-photo { margin: 0 0 clamp(20px, 3vw, 34px); }
.p-photo img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.18) brightness(.96); }
.p-meta { margin: 0 0 10px; font: 400 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #6f675d; }
.p-title { margin: 0; font-weight: 800; font-variation-settings: "wdth" 62; font-size: clamp(54px, 8.2vw, 124px); line-height: .84; text-transform: uppercase; letter-spacing: -.005em; }
.p-mail { font-size: clamp(30px, 5.8vw, 82px); line-height: .95; text-transform: none; overflow-wrap: anywhere; }
.p-mail a { text-decoration: none; }
.p-mail a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.p-line { margin: 18px 0 0; max-width: 38ch; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.38; font-variation-settings: "wdth" 92; }
.p-body { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(20,18,16,.25); columns: 2 18em; column-gap: 34px; }
.p-body p { margin: 0 0 14px; break-inside: avoid; color: #2e2a26; font-size: 16px; }
.p-links { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.p-links a { font: 700 15px/1.3 var(--mono); text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
.p-links a:hover { color: var(--marker); border-color: var(--marker); }
.out { font-weight: 400; margin-left: 3px; }
.copy-row { margin: 22px 0 0; display: flex; align-items: center; gap: 14px; }
.copy { font: 700 14px/1 var(--mono); padding: 11px 16px; background: var(--ink); color: var(--paper); border: 0; cursor: pointer; }
.copy:hover { background: var(--marker); }
.copied { font: 400 14px/1 var(--mono); color: var(--marker); }

.js .room .emulsion { animation: develop 1.8s cubic-bezier(.3, 0, .2, 1) .25s both; }
.js .room.seen .emulsion { animation: none; }
@keyframes develop {
  0% { opacity: 0; filter: contrast(.2) brightness(1.5); }
  45% { opacity: .55; filter: contrast(.45) brightness(1.25); }
  100% { opacity: 1; filter: none; }
}

.log { font: 400 14px/1.5 var(--mono); position: sticky; top: 24px; }
.log h2 { margin: 6px 0 16px; font: 700 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--safe-dim); }
.log dl { margin: 0; }
.log .row { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; }
.log dt { white-space: nowrap; color: var(--safe-dim); }
.log .row::before { content: ""; order: 1; flex: 1 1 16px; border-bottom: 1px dotted var(--safe-dim); transform: translateY(-4px); min-width: 12px; }
.log dt { order: 0; }
.log dd { order: 2; margin: 0; text-align: right; max-width: 62%; }
.printed { margin-top: 22px; color: var(--safe-dim); }

.reel { padding: 26px var(--gutter) 0; }
.reel ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; border-top: 1px solid rgba(216, 115, 91, .25); padding-top: 18px; font: 400 14px/1.4 var(--mono); }
.reel a { text-decoration: none; color: var(--safe-dim); }
.reel a span { opacity: .8; }
.reel a:hover, .reel a[aria-current="page"] { color: var(--safe); }
.reel a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.room-foot { display: flex; justify-content: space-between; gap: 16px; padding: 30px var(--gutter) 36px; font: 400 13px/1.4 var(--mono); color: var(--safe-dim); }
.room-foot a { text-decoration: none; }
.room-foot a:hover { color: var(--safe); }

/* ---------- phones ---------- */
@media (max-width: 980px) {
  .bench { grid-template-columns: 1fr; }
  .log { position: static; }
  .p-body { columns: 1; }
}
@media (max-width: 760px) {
  .sleeve { grid-template-columns: 1fr; }
  .strip {
    --hole-v: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 24'%3E%3Crect x='2' y='6' width='10' height='12' rx='2.4' fill='%23f4f2ed'/%3E%3C/svg%3E");
    grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 12px 32px;
    background: var(--hole-v) repeat-y 8px top / 14px 24px, var(--hole-v) repeat-y calc(100% - 8px) top / 14px 24px, var(--film);
  }
  .strip:nth-child(2) { margin-left: 0; }
  .edge { display: none; }
  .fogged { aspect-ratio: 3 / 1; }
  .f-title { font-size: clamp(34px, 11vw, 50px); }
  .safebar { flex-wrap: wrap; font-size: 13px; }
  .safebar .count { display: none; }
  .print { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .sheet .frame > a { opacity: 1; transition: none; }
  .js .room .emulsion { animation: none; }
  .mark path { transition: none; }
}
