:root {
  --paper: #f2f1ed;
  --ink: #141413;
  --muted: #5f5d57;
  --rule: #d6d3cc;
  --row-hover: #e8e6e0;
  --plate: #e2e0da;
  --night: #0b0a09;
  --light: #f3f0ea;
  --light-muted: #b7b1a6;
  --idle: #9b958b;
  --foot-rule: #2c2b28;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html {
  /* Dark behind the page so overscroll never shows a white edge next to the hero. */
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; }
h1, h2, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

[id] { scroll-margin-top: 24px; }

/* Header, pinned to the top of the hero */

.site-header {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  padding: 28px var(--gutter);
  color: var(--light);
  font-size: 14px;
}

.site-nav { display: flex; gap: 8px 24px; }
.site-nav-start { justify-self: start; }
.site-nav-end { justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { text-decoration: none; transition: opacity .3s ease; }
.site-nav a:hover { opacity: .7; }

.site-nav a:focus-visible,
.contact-details a:focus-visible,
.hero-pick:focus-visible {
  outline: 1px solid var(--light);
  outline-offset: 4px;
}

.wordmark {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.wordmark-name { font-size: 21px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; }
.wordmark-note { font-size: 11px; color: var(--light-muted); line-height: 1.3; }

/* Hero */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--night);
  color: var(--light);
}

/* The lights come on: the whole stack starts dark, and main.js adds .lit to the root. */
.hero-photos {
  position: absolute;
  inset: 0;
  filter: brightness(.08) saturate(.2);
  transition: filter 3s var(--ease);
  will-change: filter;
}
.lit .hero-photos { filter: none; }
.settled .hero-photos { will-change: auto; }

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, center 60%);
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.hero-photo.is-on { opacity: 1; }

.hero-scrim, .hero-assist {
  position: absolute;
  inset: 0;
}

.hero-scrim {
  background: linear-gradient(180deg, rgba(11, 10, 9, .6) 0%, rgba(11, 10, 9, 0) 24%, rgba(11, 10, 9, 0) 50%, rgba(11, 10, 9, .85) 100%);
}

/*
 * The brief's scrim is enough for the dark Paddington photo. The brighter photos get
 * this extra layer, which crossfades with them, so text holds its contrast on bright
 * facades without dimming the Paddington scheme.
 */
.hero-assist {
  --clear-from: 24%;
  --clear-to: 38%;
  --full-at: 60%;
  background: linear-gradient(180deg, rgba(11, 10, 9, .5) 0%, rgba(11, 10, 9, .5) 10%, rgba(11, 10, 9, 0) var(--clear-from), rgba(11, 10, 9, 0) var(--clear-to), rgba(11, 10, 9, .72) var(--full-at), rgba(11, 10, 9, .72) 100%);
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.hero[data-active="1"] .hero-assist { opacity: .9; }
.hero[data-active="2"] .hero-assist,
.hero[data-active="3"] .hero-assist { opacity: 1; }

/* The h1 sits higher on the photo on short landscape screens. */
@media (min-width: 821px) and (min-aspect-ratio: 3/2) and (max-height: 800px) {
  .hero-assist { --full-at: 54%; }
}

/* The photo is height-locked and the text block climbs past the middle. */
@media (max-width: 820px), (max-aspect-ratio: 3/2) {
  .hero-assist { --clear-from: 20%; --clear-to: 28%; --full-at: 48%; }
}

.hero-foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(32px, 5vw, 64px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.hero-main { flex: 0 1 820px; min-width: 0; }
.hero-notes { flex: none; }

h1 {
  margin-bottom: 32px;
  font-weight: 500;
  font-size: clamp(38px, 5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.hero-pick {
  min-height: 30px;
  padding: 5px 0;
  background: none;
  border: 0;
  color: var(--idle);
  text-align: left;
  cursor: pointer;
  transition: color .6s ease;
}
.hero-pick:hover, .hero-pick:focus-visible, .hero-pick.is-on { color: var(--light); }

.hero-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--light-muted);
  font-size: 13px;
  text-align: right;
}
.hero-sunset { color: var(--light); }
.hero-sunset[hidden] { display: none; }

/* Studio */

.studio {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 32px 64px;
  padding: clamp(88px, 11vw, 150px) var(--gutter) clamp(72px, 9vw, 120px);
}

.studio h2 {
  flex: 3 1 560px;
  max-width: 900px;
  font-weight: 500;
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.studio-side {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  color: var(--muted);
  font-size: 15px;
}

/* Selected work */

.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 440px);
  align-items: start;
  gap: 40px;
  padding: 0 var(--gutter) clamp(88px, 11vw, 150px);
}

.work-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 24px;
  padding: 14px 10px 10px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.work-head h2 { font-size: 14px; font-weight: 500; }
.work-key { color: var(--muted); font-size: 13px; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 2.2fr) minmax(0, 1.3fr);
  align-items: baseline;
  gap: 8px 32px;
  padding: 18px 10px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background-color .4s ease;
}
.row:hover, .row.is-on { background: var(--row-hover); }

.row-name { display: flex; flex-direction: column; gap: 2px; }

.row-name button {
  padding: 0;
  background: none;
  border: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.row-name button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.row-under { color: var(--muted); font-size: 13px; }
.row-line { font-size: 15px; }
.row-award { color: var(--muted); font-size: 14px; }
.row-photo { display: none; }

.plate { position: sticky; top: 24px; width: 100%; max-width: 440px; }

.plate-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--plate);
}
.plate-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.plate-frame img.is-on { opacity: 1; }

.plate-caption { margin-top: 10px; color: var(--muted); font-size: 13px; }

/* Contact */

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px 64px;
  padding: clamp(72px, 9vw, 120px) var(--gutter);
  background: var(--ink);
  color: var(--light);
}

.contact-lead { flex: 1 1 420px; display: flex; flex-direction: column; gap: 14px; }
.contact-lead p { color: var(--light-muted); }

.contact h2 {
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.contact-details {
  flex: 0 1 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 15px;
  font-style: normal;
  line-height: 1.9;
}
.contact-details a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity .3s ease;
}
.contact-details a:hover { opacity: .7; }
.contact-details span { color: var(--light-muted); }

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px var(--gutter) 32px;
  background: var(--ink);
  border-top: 1px solid var(--foot-rule);
  color: var(--idle);
  font-size: 12px;
}

/* Mobile */

@media (max-width: 820px) {
  .site-header { padding: 16px var(--gutter); }

  .site-nav { gap: 0 16px; }
  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }
  .site-nav-end a { justify-content: flex-end; }
  .wordmark { padding-top: 6px; }

  .hero-foot {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-end;
    gap: 16px;
    bottom: 24px;
  }
  .hero-main { flex: none; }
  h1 { margin-bottom: 16px; }
  .hero-pick { display: flex; align-items: center; min-height: 44px; padding: 0; width: 100%; }
  .hero-list li { width: 100%; }
  .hero-notes { text-align: left; }

  .studio { display: block; }
  .studio-side { margin-top: 32px; max-width: none; }

  .work { display: block; }
  .work-index { overflow-anchor: none; }
  .plate { display: none; }

  .work-head { display: block; }
  .work-key { display: block; }

  .row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 10px 18px; }
  .row-award:empty { display: none; }

  .row-name button { display: flex; align-items: center; width: 100%; min-height: 44px; }

  /* Inline photo: only the active row opens, then the image fades in once it is ready. */
  .row.is-on .row-photo {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 10px 0 6px;
    overflow: hidden;
    background: var(--plate);
  }
  .row-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.1s ease;
  }
  .row-photo img.is-shown { opacity: 1; }

  .contact { display: block; }
  .contact-details { margin-top: 32px; }
  .contact-details a { line-height: 44px; }
  .contact-details span { margin-top: 6px; line-height: 1.5; }

  .site-footer { flex-direction: column; }
}

@media (max-width: 379px) {
  .site-header { font-size: 13px; }
  .site-nav { gap: 0 10px; }
  .site-nav a { min-width: 0; }
}

/* Smallest phones: side columns shrink to their links so nothing wraps or collides. */
@media (max-width: 340px) {
  .site-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .site-nav-end { flex-wrap: nowrap; }
}

/* Keeps the foot clear of the header on the shortest portrait phones. */
@media (max-width: 820px) and (max-height: 700px) {
  h1 { margin-bottom: 8px; }
  .hero-foot { gap: 8px; bottom: 16px; }
}

/* Here the text fills most of the screen, so every photo needs the assist and no clear band. */
@media (max-width: 820px) and (max-height: 640px) {
  .hero-assist { --clear-from: 12%; --clear-to: 14%; --full-at: 30%; }
  .hero[data-active="0"] .hero-assist,
  .hero[data-active="1"] .hero-assist { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photos { filter: none; will-change: auto; }
  *, *::before, *::after { transition: none !important; }
}
