/* Roberts Gray Architects — site styles
   Mesura-direction layout (v1) with the requested changes:
   header reads white over imagery (no blend mode), new footer, prominent project links,
   project gallery view, and project colour used only as a page-transition wipe.
   Sans: Plain (licensed) — Light 300 / Medium 600 / Regular Italic
   Serif: Newsreader (Production Type, OFL) */

@font-face { font-family: "Plain"; src: url("fonts/Plain-Light.otf") format("opentype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Plain"; src: url("fonts/Plain-LightItalic.otf") format("opentype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Plain"; src: url("fonts/Plain-RegularItalic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plain"; src: url("fonts/Plain-Medium.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f5f1;
  --ink: #1c1b19;
  --mute: #7d7a73;
  --rule: #d9d6cf;
  --grey: #d2d2d2;
  --sans: "Plain", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Times New Roman", serif;
  --gut: 14px;
  --edge: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; background: var(--grey); }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.25; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------- Header: ink on paper, white over imagery ---------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut);
  padding: var(--edge); align-items: start;
  color: var(--ink); pointer-events: none;
  transition: color .3s ease;
}
.site-head .over-img { color: #fff; text-shadow: 0 0 14px rgba(0,0,0,.22); }
.mark, .nav a, .nav-right { transition: color .3s ease; }
.site-head a { pointer-events: auto; }
.mark { grid-column: 1 / 4; font: 600 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }
.mark span { display: block; }
.mark span:last-child { padding-left: 0.7em; }
.nav { grid-column: 4 / 10; font: 600 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }
.nav a { opacity: 1; transition: opacity .2s; }
.nav a[aria-current] { opacity: .45; }
.nav-right { grid-column: 10 / 13; justify-self: end; text-align: right; font: italic 400 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }

/* ---------- Type primitives ---------- */
.lead {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(26px, 2.65vw, 42px); line-height: 1.1; letter-spacing: -0.012em;
  max-width: 30ch;
}
.lead + .lead { margin-top: 0.6em; }
.label { font: 600 clamp(20px, 1.7vw, 26px)/1 var(--sans); letter-spacing: -0.02em; text-transform: uppercase; }
.cap { font: 500 13px/1.3 var(--serif); }
.cap .n { font-feature-settings: "tnum"; }
.more { font: 300 13px/1.3 var(--sans); display: inline-block; margin-top: 2px; }
.more::after { content: " \2197"; }
.more:hover, .cap a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Intro ---------- */
.intro { padding: calc(var(--edge) + 104px) var(--edge) 120px; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); }
.intro .body { grid-column: 1 / 11; }
.intro .lead { max-width: 34ch; }

/* ---------- Hero full-bleed ---------- */
.hero { height: 100svh; position: relative; }
.hero figcaption { position: absolute; left: var(--edge); bottom: var(--edge); color: #fff; }

/* ---------- Mosaic: three-up, unequal, top-aligned ---------- */
.mosaic { display: grid; grid-template-columns: 3.4fr 5fr 3.6fr; column-gap: 0; align-items: start; }
.tile { position: relative; }
.tile .frame { overflow: hidden; background: var(--rule); }
.tile figcaption { padding: 8px 10px 0; }
.r-45 .frame { aspect-ratio: 4 / 5; }
.r-34 .frame { aspect-ratio: 3 / 4; }
.r-23 .frame { aspect-ratio: 2 / 3; }
.r-11 .frame { aspect-ratio: 1 / 1; }
.r-32 .frame { aspect-ratio: 3 / 2; }
.inset { padding: 22px 22px 0; }
.text-tile { padding: 8px 10px 0; max-width: 46ch; }
.text-tile p + p { margin-top: .7em; }
.mosaic.flip { grid-template-columns: 5.2fr 3fr 3.8fr; }
.spacer-top { margin-top: 18vh; }

/* ---------- Project links: whole image opens the project ---------- */
a.frame { display: block; position: relative; cursor: pointer; }
a.frame img { transition: transform 1s cubic-bezier(.2,.7,.2,1); }
a.frame:hover img { transform: scale(1.035); }
.ptitle { display: inline-block; font: 600 clamp(19px, 1.6vw, 26px)/1.05 var(--sans); letter-spacing: -0.025em; margin-bottom: 4px; }
.ptitle i { font-style: normal; display: inline-block; transition: transform .25s; }
.tile:hover .ptitle i, .ptitle:hover i { transform: translate(3px, -3px); }
.tile:hover .ptitle, .ptitle:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ---------- Project index ---------- */
.index { padding: 140px var(--edge) 40px; }
.index .label { margin-bottom: 26px; }
.index table { width: 100%; border-collapse: collapse; }
.index tr { border-top: 1px solid var(--ink); }
.index tr:last-child { border-bottom: 1px solid var(--ink); }
.index td { padding: 14px 0; vertical-align: middle; font: 500 clamp(20px, 1.9vw, 30px)/1.1 var(--serif); letter-spacing: -0.01em; }
.index td.s { font: 300 14px/1.3 var(--sans); letter-spacing: 0; color: var(--mute); }
.index td.go { text-align: right; padding-right: 6px; font: 600 14px/1.3 var(--sans); color: var(--ink); white-space: nowrap; }
.index td:nth-child(1) { width: 5%; padding-left: 4px; }
.index td:nth-child(2) { width: 42%; }
.index td:nth-child(3) { width: 22%; }
.index tr { position: relative; transition: background .2s; cursor: pointer; }
.index tr:hover { background: var(--t, var(--ink)); color: var(--ti, var(--paper)); }
.index tr:hover td.s, .index tr:hover td.go { color: var(--ti, var(--paper)); }
.index .peek { position: fixed; width: 22vw; aspect-ratio: 4/5; pointer-events: none; z-index: 30; opacity: 0; transition: opacity .2s; }
.index .peek.on { opacity: 1; }

/* ---------- Statement band ---------- */
.band { padding: 160px var(--edge); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); }
.band .label { grid-column: 1 / 4; padding-top: .35em; }
.band .body { grid-column: 4 / 12; }

/* ---------- Footer (new) ---------- */
.site-foot { background: var(--grey); color: var(--ink); padding: 90px var(--edge) 0; }
.f-cols { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: var(--gut); font: 300 15px/1.45 var(--sans); }
.f-cols .f-h { font-weight: 600; margin-bottom: 6px; }
.f-cols a:hover { opacity: .55; }
.f-cols .arrow { display: inline-block; margin-top: 8px; }
.f-cols .arrow::after { content: " \2197"; }
.f-about { margin-top: 64px; max-width: 62ch; font: 500 13px/1.3 var(--serif); }
.f-base { margin-top: 28px; display: flex; justify-content: space-between; border-top: 1px solid rgba(28,27,25,.35); padding-top: 10px; font: 300 13px/1 var(--sans); }

/* ---------- Practice page ---------- */
.people { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); padding: 0 var(--edge); margin-top: 140px; }
.people .label { grid-column: 1 / 4; padding-top: .35em; }
.people-grid { grid-column: 4 / 13; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gut); row-gap: 56px; }
.person .frame { aspect-ratio: 4 / 5; overflow: hidden; background: var(--rule); }
.person img { filter: grayscale(1); transition: filter .4s; }
.person:hover img { filter: none; }
.person figcaption { padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.pname { font: 500 clamp(20px, 1.9vw, 28px)/1.1 var(--serif); letter-spacing: -0.01em; }

/* ---------- Project page ---------- */
.p-head { padding: calc(var(--edge) + 104px) var(--edge) 0; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); }
.p-head h1 { grid-column: 1 / 9; font: 500 clamp(44px, 5.6vw, 92px)/0.98 var(--serif); letter-spacing: -0.025em; }
.p-meta { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: var(--gut); margin-top: 48px; border-top: 1px solid var(--ink); padding-top: 10px; }
.p-meta dt { font: 300 13px/1.4 var(--sans); color: var(--mute); }
.p-meta dd { font: 500 16px/1.3 var(--serif); }
.views { grid-column: 1 / 13; margin: 26px 0 44px; font: 600 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }
.views button { font: inherit; letter-spacing: inherit; transition: opacity .2s; }
.views button.on { opacity: .45; }
.views button:hover { opacity: .7; }
sup { font-size: .62em; vertical-align: .55em; margin-left: 2px; }
.p-text { padding: 120px var(--edge) 40px; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); }
.p-text .body { grid-column: 4 / 11; }
.p-text .body p { font: 400 clamp(18px, 1.45vw, 22px)/1.38 var(--serif); }
.p-text .body p + p { margin-top: 1em; text-indent: 2.5em; }
.p-text .body p.lead { font-weight: 500; font-size: clamp(26px, 2.65vw, 42px); line-height: 1.1; text-indent: 0; margin-bottom: 1.2em; }
.p-text .body h2.cite-h { margin: 64px 0 18px; text-indent: 0; }
.p-text .body h2.cite-h + p { text-indent: 0; }
.p-extra { grid-column: 4 / 11; margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr 1fr; column-gap: var(--gut); border-top: 1px solid var(--ink); padding-top: 10px; }
.p-extra dt { font: 300 13px/1.4 var(--sans); color: var(--mute); }
.p-extra dd { font: 500 15px/1.35 var(--serif); }
.quote { margin-bottom: 2em; }
.quote p { font: italic 400 clamp(24px, 2.3vw, 36px)/1.15 var(--serif); letter-spacing: -0.01em; }
.quote cite { display: block; margin-top: 10px; font-style: normal; }

/* project image flow */
.full figcaption, .inset-wide figcaption, .plate figcaption, .pair figcaption, .single-inset figcaption { padding: 8px 10px 0; }
.full, .inset-wide, .plate, .pair, .single-inset { margin-top: 120px; }
.full img, .inset-wide img, .plate img, .single-inset img { height: auto; }
/* "+" cursor (echoes the RG plus mark): click any project image to open it in gallery mode */
img[data-g] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M14 4h4v10h10v4H18v10h-4V18H4v-4h10z' fill='%231c1b19' stroke='%23fff' stroke-width='1.5' stroke-linejoin='miter'/%3E%3C/svg%3E") 16 16, zoom-in; }
.inset-wide, .plate, .single-inset { display: grid; grid-template-columns: repeat(12, 1fr); }
.inset-wide figure { grid-column: 3 / 11; }
.plate figure { grid-column: 4 / 10; }
.plate { background: #fff; padding: 64px 0 40px; }
.plate .frame { background: #fff; }

/* Plans: white band; level names stack on the left, levels layered in one frame */
.plans { margin-top: 120px; background: #fff; padding: 64px var(--edge) 40px; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); }
.plans-nav { grid-column: 1 / 4; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font: 600 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }
.plans-nav .label { margin-bottom: 18px; }
.plans-nav button { font: inherit; letter-spacing: inherit; opacity: .3; transition: opacity .25s; text-align: left; }
.plans-nav button.on, .plans-nav button:hover { opacity: 1; }
.plans-stack { grid-column: 4 / 12; display: grid; }
.plans-stack .layer { grid-area: 1 / 1; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.plans-stack .layer.on { opacity: 1; pointer-events: auto; }
.plans-stack img { height: auto; }
.plans-n { grid-column: 4 / 12; padding: 8px 10px 0; }
@media (max-width: 760px) {
  .plans-nav, .plans-stack, .plans-n { grid-column: 1 / -1; }
  .plans-nav { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 24px; font-size: 22px; }
  .plans-nav .label { width: 100%; margin-bottom: 6px; }
  .plans, .plate { margin-top: 40px; padding-top: 32px; }
}
.single-inset figure { grid-column: 4 / 10; }
.pair { display: grid; grid-template-columns: 1fr 1fr; }
.next { display: flex; justify-content: space-between; align-items: baseline; margin-top: 120px; padding: 24px var(--edge) 14px; border-bottom: 1px solid var(--ink); transition: background-color .2s, color .2s; }
.next .big { font: 500 clamp(36px, 4.4vw, 72px)/1 var(--serif); letter-spacing: -0.02em; }
.next:hover { background: var(--t, var(--ink)); color: var(--ti, var(--paper)); }

/* gallery view + lightbox */
.gal { position: fixed; inset: 0; z-index: 60; background: #fff; color: var(--ink); overflow-y: auto; padding: 0 var(--edge) 60px; opacity: 0; transition: opacity .3s; }
.gal.open { opacity: 1; }
.gal-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; padding: var(--edge) 0 24px; background: #fff; font: 600 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }
.gal-bar .n { opacity: .45; }
body.gal-open .site-head { visibility: hidden; }
.gal-bar .x { font: italic 400 clamp(22px, 2.3vw, 34px)/0.95 var(--sans); letter-spacing: -0.03em; }
.gal-bar .x:hover { opacity: .6; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 36px var(--gut); margin-top: 40px; }
.gal-grid button { display: flex; flex-direction: column; text-align: left; }
.gal-grid .cell { aspect-ratio: 1; display: flex; align-items: flex-end; }
.gal-grid img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .2s; }
.gal-grid button:hover img { opacity: .75; }
.gal-grid .cap { margin-top: 6px; }
.lb { position: fixed; inset: 0; z-index: 70; background: #fff; color: var(--ink); display: grid; grid-template-rows: auto 1fr auto; }
.lb-top, .lb-bot { display: flex; justify-content: space-between; align-items: baseline; padding: var(--edge); font: 600 clamp(18px, 1.6vw, 24px)/1 var(--sans); letter-spacing: -0.02em; }
.lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 var(--edge); }
.lb-stage img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.lb button { font: inherit; letter-spacing: inherit; }
.lb button:hover { opacity: .6; }
.lb [data-a=x] { font-style: italic; font-weight: 400; }
.lb-n { font: 500 15px/1 var(--serif); }

/* ---------- Journal ---------- */
.journal { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gut); row-gap: 72px; padding: 0 var(--edge) 80px; align-items: start; grid-auto-flow: dense; }
.j-item { transition: opacity .3s; }
.j-item.off { opacity: .08; pointer-events: none; }
.j-item .frame { overflow: hidden; background: var(--rule); }
.j-item img { height: auto; }
.j-meta { display: flex; gap: 14px; margin: 8px 0 4px; font: 300 12px/1.3 var(--sans); color: var(--mute); text-transform: uppercase; letter-spacing: .02em; }
.j-note { font: 500 clamp(22px, 2vw, 32px)/1.12 var(--serif); letter-spacing: -0.01em; border-top: 1px solid var(--ink); padding-top: 12px; }
.j-filter { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.j-filter button { font: 600 clamp(18px, 1.5vw, 22px)/1 var(--sans); letter-spacing: -0.02em; text-transform: uppercase; color: var(--mute); }
.j-filter button.on, .j-filter button:hover { color: var(--ink); }

/* ---------- Page-transition wipe in the destination's colour (the old site's page colours) ---------- */
.wipe { position: fixed; inset: 0; z-index: 200; background: var(--wipe, var(--grey)); transform: translateY(100%); pointer-events: none; }
.wipe.cover { transform: none; }
html.wiping .wipe { transform: none; transition: none; }
.wipe.in { transition: transform .5s cubic-bezier(.7,0,.25,1); transform: none; }
.wipe.out { transition: transform .6s cubic-bezier(.7,0,.25,1); transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
  .wipe, .wipe.in, .wipe.out { transition: opacity .25s; transform: none; opacity: 0; }
  .wipe.cover, .wipe.in { opacity: 1; }
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  :root { --edge: 12px; }
  .mark { grid-column: 1 / 7; }
  .nav { grid-column: 7 / 13; justify-self: end; text-align: right; }
  .nav-right { display: none; }
  .mosaic, .mosaic.flip, .pair { grid-template-columns: 1fr; }
  .tile { margin-bottom: 32px; }
  .mosaic .tile { margin-top: 0 !important; }
  .spacer-top { margin-top: 0; }
  .inset { padding: 0; }
  .intro .body, .band .label, .band .body, .people .label, .people-grid, .p-head h1, .p-text .body, .p-extra,
  .inset-wide figure, .plate figure, .single-inset figure { grid-column: 1 / 13; }
  .band .label, .people .label { margin-bottom: 20px; }
  .people-grid { grid-template-columns: 1fr 1fr; }
  .index td:nth-child(1), .index td:nth-child(3), .index td:nth-child(4) { display: none; }
  .p-meta { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .p-extra { grid-template-columns: 1fr; row-gap: 12px; }
  .f-cols { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .journal .j-item { grid-column: 1 / -1 !important; margin-top: 0 !important; }
  .full, .inset-wide, .plate, .pair, .single-inset { margin-top: 40px; }
  .gal-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Footer wordmark (kept from v1); extra room below so the y descender isn't cropped ---------- */
.wordmark {
  margin: 40px calc(var(--edge) * -1) 0; padding: 0 0 .22em .6vw;
  font: 600 17.7vw/1 var(--sans); letter-spacing: -0.065em; white-space: nowrap; overflow: hidden;
}
.wordmark span { display: block; }
