/* John Springett – Springimages
   Near-black like a darkened venue, warm paper-white text,
   and one red, used sparingly, like a camera's record light. */

:root {
  --ink: #111111;
  --ink-2: #1a1a1a;
  --rule: #2c2c2c;
  --paper: #ece8e1;
  --dim: #8f8a82;
  --red: #e2442f;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 1320px;
  --space: clamp(4.5rem, 10vw, 8.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
body {
  background: var(--ink);
  color: var(--paper);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -3rem; z-index: 100; background: var(--paper); color: var(--ink); padding: .5rem .8rem; }
.skip:focus { top: .75rem; }

/* Type */
h1, h2, h3 { font-weight: 700; font-stretch: 72%; line-height: .95; letter-spacing: -.005em; }
h1 { font-size: clamp(3rem, 9vw, 7.5rem); }
h2 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); }
h3 { font-size: 1.5rem; font-stretch: 80%; line-height: 1.1; }
.kicker, .hero-credit, dt, figcaption, .archive-list, .search input, label, .btn, .menu a, .menu-btn {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .02em;
}

/* Buttons & links */
.btn {
  display: inline-block;
  background: var(--paper); color: var(--ink);
  border: 0; padding: .9rem 1.4rem;
  text-decoration: none; text-transform: uppercase; letter-spacing: .08em;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #fff; }
.link { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: .3em; text-decoration-thickness: 2px; }
.link:hover { color: #fff; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  transition: background .2s, border-color .2s;
  border-bottom: 1px solid transparent;
}
.site-header.solid { background: var(--ink); border-color: var(--rule); }
.wordmark {
  text-decoration: none; font-weight: 800; font-stretch: 72%;
  font-size: 1.5rem; line-height: 1; text-transform: uppercase; letter-spacing: .01em;
  display: flex; align-items: baseline; gap: .6rem;
}
.wordmark span { font: 400 .75rem var(--mono); text-transform: none; letter-spacing: .02em; color: var(--dim); }
.menu { display: flex; gap: 2rem; }
.menu a { text-decoration: none; text-transform: uppercase; letter-spacing: .1em; }
.menu a:hover, .menu a.current { color: #fff; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: .4em; text-decoration-thickness: 2px; }
.menu-btn { display: none; background: none; border: 1px solid var(--rule); padding: .45rem .8rem; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; background: #000; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero::after {
  /* Only a bottom scrim, so the type stays readable and the photo stays untouched */
  content: ""; position: absolute; inset: 40% 0 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(17,17,17,0), rgba(17,17,17,.92));
}
.hero-text { position: relative; z-index: 1; padding: 0 var(--gutter) clamp(2.5rem, 7vh, 5rem); max-width: 60rem; }
.kicker { color: var(--paper); text-transform: uppercase; letter-spacing: .12em; display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.kicker::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--red); }
.lede { max-width: 34rem; margin: 1.4rem 0 2rem; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #d7d2ca; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; }
.hero-credit { position: absolute; z-index: 1; right: var(--gutter); bottom: clamp(2.5rem, 7vh, 5rem); color: var(--dim); writing-mode: vertical-rl; transform: rotate(180deg); }

/* Credits */
.credits { border-block: 1px solid var(--rule); }
.credits dl { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.credits dl > div { padding: 1.4rem var(--gutter); border-left: 1px solid var(--rule); }
.credits dl > div:first-child { border-left: 0; }
dt { color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; margin-bottom: .3rem; }
.credits dd { font-weight: 600; font-stretch: 85%; font-size: 1.15rem; line-height: 1.25; }

/* Section headers */
.section-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); align-items: end; gap: 1rem 3rem; margin-bottom: 2.5rem; }
.section-header p { color: var(--dim); }

/* Selected work */
.work { padding-top: var(--space); }
.selected { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3.5rem 1.25rem; }
.shot { margin: 0; cursor: zoom-in; }
.shot .frame { overflow: hidden; background: var(--ink-2); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .4s; opacity: 0; }
.shot img.loaded { opacity: 1; }
.shot:hover img { transform: scale(1.025); }
.shot figcaption { display: flex; justify-content: space-between; gap: 1rem; padding-top: .7rem; color: var(--dim); }
.shot figcaption b { font-weight: 500; color: var(--paper); }
.shot figcaption a { text-decoration: none; white-space: nowrap; }
.shot figcaption a:hover { color: var(--paper); text-decoration: underline; text-decoration-color: var(--red); }
/* An editorial rhythm, not a uniform grid */
.shot:nth-child(1) { grid-column: 1 / span 8; }
.shot:nth-child(2) { grid-column: 9 / span 4; }
.shot:nth-child(3) { grid-column: 1 / span 4; }
.shot:nth-child(4) { grid-column: 5 / span 4; margin-top: 6rem; }
.shot:nth-child(5) { grid-column: 9 / span 4; }
.shot:nth-child(6) { grid-column: 2 / span 6; }
.shot:nth-child(7) { grid-column: 8 / span 5; margin-top: 4rem; }
.shot:nth-child(1) .frame, .shot:nth-child(6) .frame { aspect-ratio: 3 / 2; }
.shot:nth-child(2) .frame { aspect-ratio: 3 / 4; }
.shot:nth-child(3) .frame, .shot:nth-child(4) .frame, .shot:nth-child(5) .frame { aspect-ratio: 2 / 3; }
.shot:nth-child(7) .frame { aspect-ratio: 4 / 5; }

/* Archive */
.archive { padding-top: var(--space); position: relative; }
.archive-header { grid-template-columns: minmax(0, 1fr) minmax(0, 20rem) minmax(0, 18rem); }
.search input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--dim);
  padding: .6rem 0; font-size: .9rem; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--red); }
.search input::placeholder { color: var(--dim); }
.archive-list {
  list-style: none; padding: 0;
  columns: 3; column-gap: 1.25rem;
  border-top: 1px solid var(--rule);
  counter-reset: g;
}
.archive-list li { break-inside: avoid; border-bottom: 1px solid var(--rule); counter-increment: g; }
.archive-list a {
  display: flex; gap: 1rem; align-items: baseline;
  padding: .7rem 0; text-decoration: none; font-size: .875rem;
}
.archive-list a::before { content: counter(g, decimal-leading-zero); color: var(--dim); min-width: 1.6rem; }
.archive-list a::after { content: "↗"; margin-left: auto; color: var(--dim); opacity: 0; transition: opacity .15s; }
.archive-list a:hover { color: #fff; }
.archive-list a:hover::after { opacity: 1; color: var(--red); }
.archive-list li[hidden] { display: none; }
.archive-empty { color: var(--dim); padding: 1.5rem 0; }
.archive-more {
  margin-top: 1.5rem; width: 100%; background: none; border: 1px solid var(--rule); padding: .9rem;
  font: 500 .8125rem var(--mono); text-transform: uppercase; letter-spacing: .1em; cursor: pointer;
}
.archive-more:hover { border-color: var(--paper); }
@media (max-width: 700px) {
  .archive-list.collapsed li:nth-child(n+13) { display: none; }
}
.archive-preview {
  position: fixed; z-index: 30; left: 0; top: 0; width: 240px; pointer-events: none;
  opacity: 0; transition: opacity .15s; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.archive-preview.on { opacity: 1; }

/* About */
.about { padding-top: var(--space); display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.about-photo { margin: 0; position: sticky; top: 6rem; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1); }
.about-photo figcaption { color: var(--dim); padding-top: .7rem; }
.about-text h2 { margin-bottom: 2rem; }
.about-text p { max-width: 36rem; margin-bottom: 1.1rem; font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.about-text p:first-of-type { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.4; font-stretch: 90%; }

/* Hire */
.hire { padding-top: var(--space); }
.hire-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.hire-grid > div { border-top: 1px solid var(--paper); padding-top: 1.1rem; }
.hire-grid h3 { margin-bottom: .6rem; }
.hire-grid p { color: #bdb7ae; font-size: 1rem; }
.brief { margin-top: 3rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .8rem 2.5rem; padding: 1.3rem 0; border-block: 1px solid var(--rule); }
.brief h3 { font: 500 .8125rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--red); }
.brief ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.brief li::before { content: "– "; color: var(--dim); }

/* Contact */
.contact { padding-block: var(--space); display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); }
.contact-intro p { color: #bdb7ae; margin: 1.5rem 0 2.5rem; max-width: 26rem; }
.contact-details > div { padding: .9rem 0; border-top: 1px solid var(--rule); }
.contact-details dd a { text-decoration: none; font-size: 1.1rem; }
.contact-details dd a:hover { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: .25em; }
.contact-form { display: grid; gap: 1.4rem; align-content: start; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
label { display: grid; gap: .45rem; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
input, select, textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--rule); border-radius: 0;
  padding: .85rem .9rem; font-family: var(--sans); font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--paper);
}
input::placeholder, textarea::placeholder { color: #5f5b55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--paper); }
select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(-45deg, transparent 50%, var(--dim) 50%); background-position: right 1.1rem center, right .8rem center; background-size: .35rem .35rem; background-repeat: no-repeat; }
input[type="date"] { color-scheme: dark; }
textarea { resize: vertical; min-height: 8rem; }
.contact-form .btn { justify-self: start; }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-block: 2rem 2.5rem; border-top: 1px solid var(--rule); color: var(--dim); font-size: .875rem; }
.site-footer a { margin-left: 1.25rem; text-decoration: none; }
.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { color: var(--paper); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: #0a0a0a; display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; padding: 3.5rem 0 1rem; height: 100svh; display: grid; grid-template-rows: 1fr auto; justify-items: center; min-width: 0; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; min-height: 0; }
.lightbox figcaption { padding-top: 1rem; display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.lightbox figcaption a { color: var(--dim); }
.lightbox figcaption a:hover { color: var(--paper); }
.lb-btn { background: none; border: 0; cursor: pointer; font: 500 .8125rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--dim); padding: 1.2rem var(--gutter); }
.lb-btn:hover { color: var(--paper); }
.lb-close { position: absolute; top: 0; right: 0; }

/* Tablet */
@media (max-width: 1000px) {
  .credits dl { grid-template-columns: 1fr 1fr; }
  .credits dl > div:nth-child(3) { border-left: 0; }
  .credits dl > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .section-header, .archive-header { grid-template-columns: 1fr; }
  .archive-list { columns: 2; }
  .hire-grid { grid-template-columns: 1fr 1fr; row-gap: 2.2rem; }
  .about, .contact { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 30rem; }
}

/* Phone */
@media (max-width: 700px) {
  body { font-size: 1rem; }
  .menu-btn { display: block; }
  .menu {
    position: fixed; inset: 0; z-index: -1; background: var(--ink);
    flex-direction: column; justify-content: center; padding: 0 var(--gutter); gap: 0;
    visibility: hidden; opacity: 0; transition: opacity .2s, visibility .2s;
  }
  .menu a { font: 700 2.8rem/1 var(--sans); font-stretch: 72%; text-transform: none; letter-spacing: 0; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
  .site-header.open .menu { visibility: visible; opacity: 1; }
  .site-header.open { background: var(--ink); }
  .wordmark span { display: none; }

  .hero { min-height: 92svh; }
  .hero-img { object-position: 50% 40%; }
  .hero::after { inset: 25% 0 0; }
  .hero-credit { writing-mode: horizontal-tb; transform: none; bottom: .9rem; font-size: .7rem; }

  .credits dl > div { padding: 1rem var(--gutter) 1.1rem; }
  .credits dd { font-size: 1rem; }

  .selected { grid-template-columns: 1fr 1fr; gap: 2rem .75rem; }
  .shot:nth-child(n) { grid-column: auto; margin-top: 0; }
  .shot:nth-child(1), .shot:nth-child(6) { grid-column: 1 / -1; }
  .shot:nth-child(7) { grid-column: 1 / -1; }
  .shot:nth-child(2) .frame, .shot:nth-child(7) .frame { aspect-ratio: 2 / 3; }
  .shot:nth-child(7) .frame { aspect-ratio: 4 / 5; }
  .shot figcaption { flex-direction: column; gap: .15rem; font-size: .75rem; }

  .archive-list { columns: 1; }
  .archive-preview { display: none; }
  .hire-grid { grid-template-columns: 1fr; }
  .brief { flex-direction: column; }
  .brief ul { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
  .contact-form .btn { justify-self: stretch; text-align: center; }
  .site-footer { flex-direction: column; }

  .lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; height: calc(100svh - 4rem); padding-top: 3rem; }
  .lb-prev { grid-row: 2; justify-self: start; }
  .lb-next { grid-row: 2; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Gallery pages */
.gallery-page .site-header { position: sticky; }
.gallery-main { padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: var(--space); }
.back { font-family: var(--mono); font-size: .8125rem; color: var(--dim); text-decoration: none; text-transform: uppercase; letter-spacing: .1em; }
.back:hover { color: var(--paper); }
.gallery-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; margin: 1.2rem 0 2rem; }
.gallery-head h1 { font-size: clamp(2.8rem, 8vw, 6rem); }
.gallery-head p { font-family: var(--mono); font-size: .8125rem; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }

/* Justified rows: width grows with each photo's ratio, so every row shares one height */
.justified { --row: 280px; display: flex; flex-wrap: wrap; gap: 6px; }
.justified::after { content: ""; flex-grow: 999999; }
.j-item { position: relative; flex: var(--r) 1 calc(var(--r) * var(--row)); aspect-ratio: var(--r); overflow: hidden; background: var(--ink-2); cursor: zoom-in; }
.j-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .6s ease; }
.j-item img.loaded { opacity: 1; }
.j-item:hover img { transform: scale(1.03); }
.gallery-missing { color: var(--dim); padding: 2rem 0; }
.gallery-missing a { color: var(--paper); }

.gallery-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: clamp(3rem, 7vw, 5rem); padding: 1.6rem 0; border-block: 1px solid var(--rule); }
.gallery-cta p { font-weight: 700; font-stretch: 75%; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.05; }
.gallery-cta[hidden] { display: none; }

.gallery-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2.5rem; }
.gallery-nav-link { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: center; text-decoration: none; }
.gallery-nav-link:last-child { grid-template-columns: 1fr 96px; text-align: right; }
.gallery-nav-link:last-child img { order: 2; }
.gallery-nav-link img { width: 96px; height: 96px; object-fit: cover; }
.gallery-nav-link small { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: .2rem; }
.gallery-nav-link span { font-weight: 700; font-stretch: 80%; font-size: 1.25rem; line-height: 1.1; }
.gallery-nav-link:hover span { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: .2em; }
.lb-count { color: var(--dim); font-size: .75rem; }

@media (max-width: 700px) {
  .justified { --row: 150px; gap: 4px; }
  .gallery-nav { grid-template-columns: 1fr; }
  .gallery-nav-link:last-child { grid-template-columns: 72px 1fr; text-align: left; }
  .gallery-nav-link:last-child img { order: 0; }
  .gallery-nav-link { grid-template-columns: 72px 1fr; }
  .gallery-nav-link img { width: 72px; height: 72px; }
  .gallery-cta .btn { width: 100%; text-align: center; }
}
.load-error { color: var(--dim); grid-column: 1 / -1; }

/* Contact form states */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #ff9d8c; font-size: .95rem; }
.form-error a { color: var(--paper); }
.contact-form .btn:disabled { opacity: .6; cursor: progress; }
.form-sent { align-self: start; border-top: 2px solid var(--red); padding-top: 1.4rem; }
.form-sent h3 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: .8rem; }
.form-sent p { color: #bdb7ae; max-width: 30rem; }
.form-sent a { color: var(--paper); }
.form-sent:focus { outline: none; }
.contact-form[hidden], .form-sent[hidden] { display: none; }
@media (min-width: 1001px) {
  .form-sent { grid-column: 2; grid-row: 1; }
}
