/* choui photography
   ------------------------------------------------------------------
   Organising idea: a print hung on a wall has margin around it.
   Photographs never bleed to the page edge. Type recedes so the work
   carries the page. One family, wide weight range.
   ------------------------------------------------------------------ */

:root {
  /* Gallery wall, cool and slightly green. Deliberately not cream. */
  --wall:     #E3E2DD;
  --mat:      #F2F1EE;
  --ink:      #2B2A28;
  --muted:    #7C7A74;
  --rule:     #C6C4BD;
  /* Selenium toner shifts print blacks toward a cool purple-brown. */
  --selenium: #6E4B5A;

  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  /* John's wordmark choice drops in here and nowhere else. */
  --font-wordmark: var(--font);

  --page: 74rem;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall:     #1E2021;
    --mat:      #292B2C;
    --ink:      #E4E3DE;
    --muted:    #918F89;
    --rule:     #3C3E3F;
    --selenium: #B88A9B;
  }
}

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

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

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--selenium);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 1rem;
  z-index: 10;
  background: var(--mat);
  color: var(--ink);
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- navigation ---------------------------------------- */

.nav {
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2.5rem;
}

.wordmark {
  font-family: var(--font-wordmark);
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--selenium);
}

/* ---------- the hung print ------------------------------------ */

/* The hero is one photograph sitting in its margin, the way a single
   piece is hung, rather than a full-bleed banner. */
.hung {
  margin-block: clamp(2.5rem, 7vw, 5rem) 0;
  /* Sized like a piece hung on a large wall, not a banner filling it.
     The whole photograph stays visible; a print is never cropped to fit. */
  max-width: 52rem;
}

.hung-plate {
  background: var(--mat);
  padding: clamp(0.75rem, 2.5vw, 1.75rem);
}

.hung img { width: 100%; }

.plate-label {
  margin: 0.9rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.plate-label .title {
  color: var(--ink);
  font-style: italic;
}

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

.statement {
  margin-block: clamp(3rem, 8vw, 5rem);
}

.statement p {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(1.6rem, 4.6vw, 2.5rem);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.statement .detail {
  margin-top: 1.25rem;
  max-width: var(--measure);
  font-size: 1rem;
  font-weight: 350;
  line-height: 1.65;
  letter-spacing: 0;
  color: var(--muted);
}

/* ---------- section openers ----------------------------------- */

.opener {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-block: clamp(3rem, 7vw, 4.5rem) 1.75rem;
}

.opener h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.opener .count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- category tiles ------------------------------------ */

.tiles {
  display: grid;
  /* Five subjects sit in one row on a desktop; narrower screens wrap. */
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.tile {
  display: grid;
  gap: 0.7rem;
  text-decoration: none;
}

.tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tile:hover img { opacity: 0.88; }

.tile-name {
  font-size: 1.0625rem;
  font-weight: 400;
}

.tile-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- print category sections --------------------------- */

.category { margin-bottom: clamp(3rem, 7vw, 4.5rem); }

.category-grid {
  /* Columns rather than a grid, so upright and wide photographs keep their
     own shape. A print is never cropped to fit a cell. */
  columns: 3 16rem;
  column-gap: clamp(1rem, 2.5vw, 1.75rem);
}

.work {
  margin: 0 0 clamp(1rem, 2.5vw, 1.75rem);
  break-inside: avoid;
}
.work img { width: 100%; }

.route {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

.route a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--selenium);
  padding-bottom: 0.1rem;
}

.route a:hover { color: var(--selenium); }

/* ---------- commissions --------------------------------------- */

.tour {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: var(--mat);
}

.tour iframe,
.tour img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 1.1rem;
  line-height: 1.7;
}

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

/* ---------- contact form -------------------------------------- */

.form {
  max-width: 32rem;
  margin-top: 2rem;
  display: grid;
  gap: 1.35rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.field label {
  font-size: 0.875rem;
  color: var(--muted);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--mat);
  border: 1px solid var(--rule);
  padding: 0.7rem 0.85rem;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--selenium);
}

.field textarea { resize: vertical; }

.submit {
  font: inherit;
  font-size: 0.9375rem;
  background: var(--ink);
  color: var(--wall);
  border: 1px solid var(--ink);
  padding: 0.75rem 2rem;
  cursor: pointer;
  justify-self: start;
}

.submit:hover {
  background: var(--selenium);
  border-color: var(--selenium);
}

/* ---------- provisional content marker ------------------------ */

.provisional {
  margin-top: 2rem;
  padding: 0.85rem 1rem;
  border-left: 2px solid var(--selenium);
  background: var(--mat);
  font-size: 0.875rem;
  color: var(--muted);
  max-width: var(--measure);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(4rem, 10vw, 7rem);
  padding-block: 2rem 3.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-inner {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.site-footer p { margin: 0; }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social a { text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 0.1rem; }
.social a:hover { color: var(--ink); border-bottom-color: var(--selenium); }

/* ---------- page headings ------------------------------------- */

.page-head { margin-block: clamp(2.5rem, 7vw, 4rem) 0; }

.page-head h1 {
  margin: 0;
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.page-head .intro {
  margin: 1.1rem 0 0;
  max-width: var(--measure);
  color: var(--muted);
  line-height: 1.7;
}

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

/* ---------- lightbox ------------------------------------------ */

.work img[role="button"] { cursor: zoom-in; }

/* Always dark, whatever the theme: a print reads best in a dim room. */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #121213;
  color: #E4E3DE;
  overscroll-behavior: contain;
}
/* Block, not grid: the plate's height: 100% needs this definite height to
   resolve against, or a tall photograph overflows the screen. */
.lightbox[open] { display: block; overflow: hidden; }
.lightbox::backdrop { background: transparent; }
html:has(.lightbox[open]) { overflow: hidden; }

.lightbox-plate {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 3.5rem clamp(1rem, 7vw, 6rem) 1.5rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  gap: 1rem;
}

.lightbox-plate img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox figcaption {
  max-width: 40rem;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  margin-top: 0.35rem;
  color: #918F89;
  font-size: 0.875rem;
}

.lightbox-order {
  color: #E4E3DE;
  text-decoration: none;
  border-bottom: 1px solid #B88A9B;
}
.lightbox-order:hover { color: #B88A9B; }

.lightbox button {
  position: fixed;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
}
.lightbox button:hover { opacity: 1; }
.lightbox :focus-visible { outline: 2px solid #B88A9B; outline-offset: 2px; }

.lightbox-close { top: 0.5rem; right: 0.5rem; }
.lightbox-prev,
.lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

/* On a phone the arrows would sit on the photograph; move them below it.
   Swiping works too. */
@media (max-width: 40rem) {
  .lightbox-plate { padding-bottom: 4rem; }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 0.5rem; transform: none; }
  .lightbox-prev { left: 1rem; }
  .lightbox-next { right: 1rem; }
}
