/* Bluu Next, Jean-Baptiste Morizot. Sporting Grotesque, Lucas Le Bihan.
   Both SIL OFL, official webfonts. Licenses in /fonts. */
@font-face {
  font-family: "Bluu Next Titling";
  src: url("../fonts/bluu-next-titling.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block; /* the hero name: never flash a fallback face at 20vw */
}

@font-face {
  font-family: "Bluu Next";
  src: url("../fonts/bluu-next-bold.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sporting Grotesque";
  src: url("../fonts/sporting-grotesque-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sporting Grotesque";
  src: url("../fonts/sporting-grotesque-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Sporting Grotesque's ampersand reads as a stray letter at text sizes, so
   "&" alone comes from the system grotesque */
@font-face {
  font-family: "Amp";
  src: local("Helvetica Neue"), local("HelveticaNeue"), local("Helvetica"), local("Arial");
  unicode-range: U+0026;
  size-adjust: 118%;
}

/* Swiss grid: 12 columns on desktop, 4 on mobile. Everything sits on it. */
:root {
  --bg: #f2f1ed;
  --ink: #0d0d0d;
  --muted: #65635d;
  --rule: #cfcdc6;
  --red: #d42a00;
  --cols: 12;
  --margin: 24px;
  --gutter: 16px;
  --display: "Bluu Next Titling", "Iowan Old Style", Palatino, serif;
  --serif: "Bluu Next", "Iowan Old Style", Palatino, serif;
  --text: "Amp", "Sporting Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (max-width: 760px) {
  :root { --cols: 4; --margin: 16px; --gutter: 12px; }
}

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

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--text);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Work titles: the text face has no italic, so titles switch to the serif */
em {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.14em;
  line-height: 1;
  letter-spacing: 0.01em;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

::selection { background: var(--red); color: #fff; }

.n { color: var(--red); }

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--bg);
  font: 400 13px/1 var(--text);
  transform: translateY(-200%);
}

.skip:focus { transform: none; }

/* Shared 12-column track definition */
.grid-lines,
.bar,
.page {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--margin);
}

/* Visible hairline grid */
.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.grid-lines i {
  border-left: 1px solid rgba(0, 0, 0, 0.07);
  border-right: 1px solid rgba(0, 0, 0, 0.07);
}

.grid-lines i:nth-child(n + 5) { display: var(--wide-only, block); }
@media (max-width: 760px) { .grid-lines { --wide-only: none; } }

body.no-grid .grid-lines { opacity: 0; }

.defs { position: absolute; width: 0; height: 0; }

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  /* Background sits behind text, so keep it faint enough to read over */
  opacity: 0.3;
}

/* Fixed top bar on the grid */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  align-items: center;
  height: calc(40px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  font: 400 13px/1 var(--text);
  background: var(--bg);
  border-bottom: 1px solid var(--ink);
}

.bar a {
  text-decoration: none;
  display: flex;
  align-items: center;
  align-self: stretch;
}
.bar-mark { grid-column: 1 / 5; }
.bar nav { grid-column: 9 / 13; display: flex; align-self: stretch; }
.bar nav a { padding-inline: 10px; }

/* Phones: the name on its own row, the links spread across the one below.
   Equal columns clip "Sculpture" and "Contact" once the screen is near 320px. */
@media (max-width: 760px) {
  .bar {
    height: auto;
    row-gap: 0;
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: 0;
    font-size: 13px;
  }
  .bar-mark,
  .bar nav { grid-column: 1 / -1; }
  .bar-mark { min-height: 32px; }
  .bar nav { justify-content: space-between; }
  .bar nav a { padding: 12px 0; }
}

/* Ripple switch, bottom-left. Hidden where there is no hover: the effect
   does not work from a finger. */
.fx {
  position: fixed;
  left: var(--margin);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 6px;
  background: var(--bg);
  border: 1px solid var(--ink);
  font: 400 13px/1 var(--text);
  cursor: pointer;
  user-select: none;
}

.fx input {
  appearance: none;
  position: relative;
  width: 26px;
  height: 14px;
  margin: 0;
  border: 1px solid var(--ink);
  background: var(--bg);
  cursor: pointer;
}

.fx input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  background: var(--ink);
  transition: transform 0.15s;
}

.fx input:checked { background: var(--red); border-color: var(--red); }
.fx input:checked::before { background: var(--bg); transform: translateX(12px); }
.fx input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@media (hover: none), (max-width: 760px) { .fx { display: none; } }

/* Infinite loop wrapper: the original page plus a clone stacked below it */
#loop { position: relative; z-index: 1; display: flow-root; }

.page { row-gap: 0; }
.page > * { grid-column: 1 / -1; }

/* Hero: huge stacked name, flush left */
.hero {
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: auto 1fr;
  min-height: 100svh;
  padding: calc(56px + env(safe-area-inset-top)) 0 24px;
}

.name {
  grid-column: 1 / -1;
  margin: 0;
  grid-row: 2;
  align-self: end;
  font-family: var(--display);
  font-weight: 400;
  font-size: 20vw;
  line-height: 0.84;
  letter-spacing: -0.015em;
}

.name span { display: block; }

.hero-sub {
  grid-row: 1;
  grid-column: 9 / 13;
  margin: 0;
  font: 400 15px/1.35 var(--text);
}


@media (max-width: 760px) {
  .name { font-size: 17.5vw; letter-spacing: -0.02em; }
  /* Name sits clear of the two-row bar; the columns fill the space below it */
  .hero {
    grid-template-rows: auto auto 1fr;
    padding-top: calc(108px + env(safe-area-inset-top));
    padding-bottom: 56px;
  }
  .hero-sub { grid-row: 2; grid-column: 1 / -1; margin-top: 20px; text-align: right; }
  .name { grid-row: 1; align-self: start; }
}

/* Sections: label in columns 1–3, content in 5–12 */
.sec {
  display: grid;
  grid-template-columns: subgrid;
  padding-top: 160px;
}

.sec-label {
  grid-column: 1 / 4;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  font: 400 14px/1.3 var(--text);
  align-self: start;
}

.sec-label .n { margin-right: 12px; }

.sec-body {
  grid-column: 5 / 13;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
}

@media (max-width: 760px) {
  .sec { padding-top: 96px; }
  .sec-label { grid-column: 1 / -1; border-top: 0; padding-top: 0; }
  .sec-body { grid-column: 1 / -1; margin-top: 12px; }
  .contact .row-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .contact .row-head a { font-size: clamp(15px, 4.7vw, 18px); }
}

.statement {
  margin: 0 0 32px;
  max-width: 22em;
  font: 400 clamp(26px, 3.1vw, 42px)/1.12 var(--serif);
  letter-spacing: -0.01em;
}

/* A work's title heads its section, with the details tight underneath */
.work-title { margin-bottom: 8px; }
.statement em { font-size: inherit; }

.body { margin: 0 0 16px; max-width: 34em; }

.cols { columns: 2 260px; column-gap: var(--gutter); }
.cols .body { break-inside: avoid; }

.credit {
  margin: 4px 0 0;
  font: 400 14px/1.4 var(--text);
  color: var(--muted);
}

/* Name / year rows */
.rows {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.sec-body > .rows:first-child { margin-top: 0; border-top: 0; }
.rows li { padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.rows p { margin: 4px 0 0; max-width: 40em; font-size: 14px; color: #3b3a37; }
.rows .credit { color: var(--muted); }

.row-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 700;
  font-size: 18px;
}

.row-head a { min-width: 0; text-decoration: none; }
.row-head span:last-child { font: 400 14px/1.4 var(--text); color: var(--muted); white-space: nowrap; }

.sub-label {
  margin: 64px 0 12px;
  font: 400 14px/1.3 var(--text);
}

/* Enquiry form: ruled fields, same weight as the rows above */
.enquiry { max-width: 40em; }
.enquiry .sub-label { padding-top: 8px; border-top: 1px solid var(--ink); }
.enquiry-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
@media (max-width: 760px) { .enquiry-row { grid-template-columns: 1fr; gap: 0; } }

.enquiry label {
  display: block;
  padding: 10px 0 0;
  font: 400 14px/1.3 var(--text);
  color: var(--muted);
}

.enquiry input,
.enquiry textarea {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 4px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 700 18px/1.4 var(--text);
  resize: vertical;
}

.enquiry textarea { font-weight: 400; font-size: 16px; }
.enquiry ::placeholder { color: var(--muted); opacity: 0.6; font-weight: 400; }
.enquiry input:focus,
.enquiry textarea:focus { outline: none; border-bottom-color: var(--red); }

.enquiry .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.enquiry-foot {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-top: 20px;
}

.enquiry button {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  font: 700 14px/1 var(--text);
  cursor: pointer;
}

.enquiry button:hover { background: var(--red); border-color: var(--red); }
.enquiry button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.enquiry button:disabled { opacity: 0.5; cursor: default; }

/* Keeps its line height when empty so the page (and its loop clone) never changes height */
.enquiry-status { margin: 0; min-height: 1.4em; font: 400 14px/1.4 var(--text); color: var(--muted); }
.enquiry-status.error { color: var(--red); }

/* Archive: collapsed rows that open to a strip of photos */
.archive summary {
  cursor: pointer;
  list-style: none;
}

.archive summary::-webkit-details-marker { display: none; }

.archive summary span:first-child::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--red);
  font-family: var(--text);
  font-weight: 400;
}

.archive details[open] summary span:first-child::before { content: "−"; }
.archive summary:hover { color: var(--red); }
.archive summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.archive details > p { margin-left: 1.2em; }

.strip {
  display: flex;
  gap: 8px;
  margin: 16px 0 0 1.2em;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.strip::-webkit-scrollbar { display: none; }

.strip button {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.strip img { height: 180px; width: auto; }
.strip button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Desktop wraps the photos; phones swipe through them */
@media (min-width: 761px) {
  .strip { flex-wrap: wrap; overflow: visible; }
}

@media (max-width: 760px) {
  .strip img { height: 140px; }
}

/* Gallery: images placed in offset pairs across the grid */
.gallery {
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 96px;
  align-items: start;
  padding-top: 96px;
}

.work { margin: 0; }
.work:nth-child(6n + 1) { grid-column: 1 / 6; }
.work:nth-child(6n + 2) { grid-column: 7 / 13; }
.work:nth-child(6n + 3) { grid-column: 4 / 9; }
.work:nth-child(6n + 4) { grid-column: 10 / 13; margin-top: 30vh; }
.work:nth-child(6n + 5) { grid-column: 1 / 8; }
.work:nth-child(6n + 6) { grid-column: 9 / 12; margin-top: 15vh; }

@media (max-width: 760px) {
  .gallery { row-gap: 56px; }
  .work:nth-child(n) { grid-column: 1 / -1; margin-top: 0; }
  .work:nth-child(3n + 2) { grid-column: 2 / -1; }
}

.work button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.work button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }


/* The column field is fixed behind everything. From Contact down, paint the
   paper colour full-bleed so the form isn't drawn through. */
.contact,
.foot {
  position: relative;
  background: var(--bg);
}
.contact::before,
.foot::before {
  content: "";
  position: absolute;
  z-index: -1;
  /* out to the screen edges through .page's side padding; any wider makes
     the page pan sideways on phones */
  left: calc(-1 * var(--margin));
  right: calc(-1 * var(--margin));
  top: 0;
  bottom: 0;
  background: var(--bg);
}

.contact { padding-bottom: 36px; }

.foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0;
  /* Clears the fixed ripple switch on screens that show it */
  padding: 16px 0 calc(64px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ink);
  font: 400 14px/1.4 var(--text);
}

.foot p { margin: 0; }
@media (max-width: 760px) { .foot { flex-direction: column; gap: 4px; } }
@media (hover: none), (max-width: 760px) {
  .foot { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

/* Email picker panel (olliemicek.com) */
#epk {
  position: fixed;
  z-index: 40;
  min-width: 188px;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.11);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 0.13s, transform 0.13s;
}

#epk.epk-open { opacity: 1; pointer-events: auto; transform: none; }

.epk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  font: 400 11px/1 var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.6);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.epk-row:last-child { border-bottom: 0; }
.epk-row:hover, .epk-row:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.05); outline: none; }
.epk-row-gmail, .epk-row-gmail:hover { color: #ff6a3d; }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}

.lightbox::backdrop { background: var(--bg); }

.lightbox figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.lightbox img { max-height: calc(100dvh - 96px); width: auto; }

.lightbox figcaption {
  font: 400 14px/1.4 var(--text);
}

.lightbox button {
  background: none;
  border: 0;
  color: var(--ink);
  font: 400 2rem/1 var(--text);
  cursor: pointer;
  height: 100%;
}

.lightbox button:hover { color: var(--red); }

.lb-close {
  position: absolute;
  top: 12px;
  right: 16px;
  height: auto !important;
  font-size: 2rem !important;
}

@media (max-width: 600px) {
  .lightbox[open] { grid-template-columns: 48px 1fr 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .grid-lines,
  #epk,
  .fx input::before { transition: none; }
}
