/* =========================================================
   PROJECT — magazine feature (project/<id>.html, built by tools/build_projects.py)
   ========================================================= */
:root { --f-serif: 'Cormorant Garamond', 'Cormorant Fallback', Georgia, serif; --measure: 60ch; }
.page-project main { background: var(--bone); color: var(--ink); }
.mag { background: var(--bone); }
.mag__section { display: flex; align-items: center; gap: 14px; opacity: 0.72; }
.mag__section i, .mag__kicker i { display: inline-block; width: 28px; height: 1px; background: currentColor; opacity: 0.5; }

/* ---------- 1 · opening: full-screen lead photo, the name over it ---------- */
.mag__hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; color: var(--bone); background: var(--ink); display: grid; align-items: end; }
.mag__hero-media { position: absolute; inset: 0; }
.mag__hero-media img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.mag__hero::after { /* a wash at the foot so the name always reads */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 65% at 0% 100%, rgba(14, 12, 11, 0.6) 0%, rgba(14, 12, 11, 0.3) 45%, rgba(14, 12, 11, 0) 78%),
              linear-gradient(180deg, rgba(20, 18, 17, 0.38) 0%, rgba(20, 18, 17, 0) 22%, rgba(20, 18, 17, 0) 45%, rgba(20, 18, 17, 0.62) 100%);
}
.mag__hero-text { position: relative; z-index: 1; display: grid; gap: clamp(12px, 1.4vw, 20px); padding-bottom: clamp(64px, 9vh, 110px); max-width: 1500px; }
.mag__crumbs { opacity: 0.8; display: flex; gap: 10px; }
.mag__crumbs a { border-bottom: 1px solid var(--line-light); }
.mag__crumbs a:hover { border-color: currentColor; }
.mag__kicker { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mag__title { font-size: clamp(52px, 8.5vw, 160px); text-shadow: 0 2px 30px rgba(10, 8, 7, 0.3); font-weight: 300; line-height: 0.86; letter-spacing: -0.05em; overflow-wrap: anywhere; margin-left: -0.04em; }
.mag__standfirst { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: clamp(24px, 2.6vw, 42px); line-height: 1.2; max-width: 32ch; }
.mag__hero-cap { position: absolute; z-index: 1; right: var(--gutter); bottom: clamp(24px, 3vh, 36px); display: flex; gap: 10px; opacity: 0.8; max-width: 40ch; text-align: right; }
.mag__hero-cap b { font-weight: 400; color: var(--terra); }

/* ---------- 2 · the facts, across the page ---------- */
.mag__strip { display: flex; justify-content: space-between; align-items: center; gap: 28px 48px; flex-wrap: wrap; padding-block: clamp(28px, 3vw, 44px); border-bottom: 1px solid var(--line-dark); }
.mag__strip dl { display: flex; flex-wrap: wrap; gap: 20px clamp(28px, 4vw, 72px); }
.mag__strip dt { font-family: var(--f-ui); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72; margin-bottom: 6px; }
.mag__strip dd { font-size: clamp(17px, 1.3vw, 21px); }

/* captions — shared */
.fig figcaption, .cmp figcaption { font-family: var(--f-ui); font-size: 13px; line-height: 1.5; opacity: 0.7; display: flex; gap: 12px; max-width: 70ch; }
.fig figcaption b, .cmp figcaption b { font-weight: 400; color: var(--brick); min-width: 1.4em; }

/* ---------- 3 · body: facts + text ---------- */
.mag__body { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.6fr); gap: clamp(32px, 6vw, 110px); padding-block: clamp(48px, 6vw, 96px) clamp(40px, 6vw, 90px); }
.mag__about { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }

.mag__text { max-width: var(--measure); font-size: clamp(17px, 1.25vw, 20px); line-height: 1.75; font-weight: 400; }
.mag__text > * + * { margin-top: 1.25em; }
.mag__drop::first-letter {
  float: left; font-family: var(--f-serif); font-weight: 500; font-size: 5.2em; line-height: 0.8;
  padding: 0.06em 0.1em 0 0; color: var(--brick);
}
.mag__quote { margin: 2.2em 0 !important; padding: 0.4em 0 0.4em clamp(20px, 3vw, 40px); border-left: 2px solid var(--brick); }
.mag__quote p { font-family: var(--f-serif); font-style: italic; font-size: clamp(28px, 3vw, 48px); line-height: 1.15; letter-spacing: -0.01em; }
.mag__quote p::before { content: '“'; } .mag__quote p::after { content: '”'; }

/* figures (inline, spaces, gallery) */
.fig { display: grid; gap: 12px; }
.fig__media { display: block; width: 100%; padding: 0; overflow: hidden; border-radius: var(--radius-sm); background: var(--bone-2); cursor: zoom-in; }
.fig__media img { width: 100%; height: auto; display: block; transition: scale 1.2s var(--ease-out); }
.fig__media:hover img { scale: 1.03; }
.fig--inline { margin-block: 2.4em !important; }
.fig--inline.is-tall { width: min(100%, 440px); }
@media (min-width: 1100px) {
  .fig--inline.is-wide { margin-right: calc(-1 * clamp(0px, 8vw, 160px)); }
}

/* ---------- 4 · before / after ---------- */
.mag__compare { padding-block: clamp(40px, 6vw, 90px); display: grid; gap: 22px; }
.cmp { display: grid; gap: 12px; max-width: 1400px; }
.cmp__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bone-2); touch-action: pan-y; }
.cmp__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--bone); box-shadow: 0 0 20px rgba(0, 0, 0, 0.35); pointer-events: none; }
.cmp__handle::after {
  content: '‹ ›'; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bone); color: var(--ink); font-family: var(--f-ui); font-size: 18px; letter-spacing: 0.1em;
}
.cmp__tag { position: absolute; top: 18px; padding: 8px 14px; border-radius: 999px; background: rgba(36, 35, 35, 0.55); color: var(--bone); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; }
.cmp__tag--a { left: 18px; } .cmp__tag--b { right: 18px; }
.cmp__range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp__range:focus-visible + * , .cmp__frame:has(.cmp__range:focus-visible) { outline: 2px solid var(--brick); outline-offset: 4px; }

/* ---------- 5 · the spaces ---------- */
.mag__spaces { padding-block: clamp(56px, 8vw, 120px); display: grid; gap: clamp(64px, 10vw, 160px); }
.space { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 96px); align-items: center; }
.space:nth-of-type(even) { grid-template-columns: 1fr 1.35fr; }
.space:nth-of-type(even) .space__fig { order: 2; }
.space__body { display: grid; gap: 18px; max-width: 44ch; }
.space__num { font-family: var(--f-serif); font-style: italic; font-size: clamp(48px, 5vw, 88px); line-height: 1; color: var(--brick); }
.space__title { font-size: clamp(30px, 3vw, 52px); font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; }
.space__body p { font-size: clamp(16px, 1.15vw, 18px); line-height: 1.7; opacity: 0.85; }
.space__fig.is-tall .fig__media { max-height: 88svh; }
.space__fig.is-tall .fig__media img { height: 100%; max-height: 88svh; object-fit: cover; }

/* ---------- 6 · gallery ---------- */
.mag__gallery { padding-block: clamp(40px, 6vw, 90px) clamp(64px, 9vw, 140px); display: grid; gap: 28px; }
.mag__grid { columns: 2; column-gap: clamp(16px, 2vw, 28px); }
.mag__grid .fig { break-inside: avoid; margin-bottom: clamp(24px, 3vw, 40px); }

/* ---------- 7 · end ---------- */
.mag__end { padding-block: clamp(48px, 7vw, 100px); border-top: 1px solid var(--line-dark); }
.mag__endline { font-family: var(--f-serif); font-style: italic; font-size: clamp(26px, 3vw, 46px); line-height: 1.2; max-width: 32ch; }
.mag__endline a { color: var(--brick); border-bottom: 1px solid currentColor; }
.mag__more { padding-bottom: clamp(80px, 10vw, 150px); display: grid; gap: 28px; }
.mag__more-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.mag__more-head a { opacity: 0.72; } .mag__more-head a:hover { opacity: 1; color: var(--brick); }
.mag__more-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.more { display: grid; gap: 10px; }
.more__media { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--bone-2); }
.more__media img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.2s var(--ease-out); }
.more:hover .more__media img { scale: 1.05; }
.more__meta { opacity: 0.72; margin-top: 6px; }
.more__name { font-size: clamp(22px, 2vw, 32px); font-weight: 300; letter-spacing: -0.015em; }

/* ---------- phones & tablets ---------- */
@media (max-width: 899px) {
  .mag__body { grid-template-columns: 1fr; }
  .mag__about { position: static; }
  .space, .space:nth-of-type(even) { grid-template-columns: 1fr; }
  .space:nth-of-type(even) .space__fig { order: 0; }
  .mag__more-row { grid-template-columns: 1fr 1fr; }
  .mag__more-row .more:nth-child(3) { display: none; }
}
@media (max-width: 599px) {
  .mag__hero { height: 88svh; }
  .mag__hero-cap { display: none; }
  .mag__strip dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; width: 100%; }
  .mag__grid { columns: 1; }
  .cmp__frame { aspect-ratio: 4 / 3; }
  .mag__more-row { grid-template-columns: 1fr; }
  .mag__more-row .more:nth-child(3) { display: grid; }
  .mag__title { font-size: min(19vw, 84px); }
  .mag__standfirst { font-size: 24px; }
  .mag__body { padding-block: 48px 32px; gap: 40px; }
  .mag__spaces { padding-block: 40px; gap: 56px; }
  .space__num { font-size: 44px; }
  .space__title { font-size: 30px; }
  .mag__gallery { padding-block: 32px 56px; }
  .mag__end { padding-block: 40px; }
  .mag__more { padding-bottom: 72px; }
}

/* ---------- previous link, then the next project as a full-screen photo ---------- */
.mag__pn { display: flex; justify-content: space-between; gap: 20px; padding-block: 22px; border-top: 1px solid var(--line-dark); }
.mag__pn a { opacity: 0.72; transition: opacity 0.3s, color 0.3s; }
.mag__pn a:hover { opacity: 1; color: var(--brick); }
.mag__pn span { opacity: 0.5; }
.mag__next { position: relative; display: grid; align-items: end; height: 92svh; min-height: 520px; overflow: hidden; color: var(--bone); background: var(--ink); }
.mag__next-media { position: absolute; inset: 0; }
.mag__next-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--ease-out), opacity 0.8s; opacity: 0.78; }
.mag__next:hover .mag__next-media img { transform: scale(1); opacity: 0.9; }
.mag__next::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 0% 100%, rgba(14, 12, 11, 0.78) 0%, rgba(14, 12, 11, 0.45) 45%, rgba(14, 12, 11, 0) 78%),
              linear-gradient(180deg, rgba(20, 18, 17, 0) 45%, rgba(20, 18, 17, 0.55) 100%); }
.mag__next-text { position: relative; z-index: 1; display: grid; gap: 16px; padding-bottom: clamp(48px, 8vh, 96px); }
.mag__next-name { font-size: clamp(44px, 7vw, 128px); text-shadow: 0 2px 30px rgba(10, 8, 7, 0.35); font-weight: 300; line-height: 0.86; letter-spacing: -0.05em; margin-left: -0.04em; transition: transform 0.9s var(--ease-out); }
.mag__next:hover .mag__next-name { transform: translateX(0.12em); }
@media (max-width: 599px) { .mag__next { height: 70svh; } .mag__next-name { font-size: min(19vw, 84px); } }

/* actions in the facts strip: full-screen viewer + start a similar project */
.mag__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mag__model { padding-block: clamp(32px, 5vw, 72px); display: grid; gap: 22px; }

/* highlights: key facts and design points as a legible dotted list */
.mag__high { padding-block: clamp(36px, 4vw, 64px); border-bottom: 1px solid var(--line-dark); display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 24px clamp(32px, 5vw, 96px); }
.mag__hl { list-style: none; margin: 0; padding: 0; columns: 2 320px; column-gap: clamp(32px, 4vw, 72px); }
.mag__hl li { position: relative; padding: 0 0 14px 22px; break-inside: avoid; font-size: clamp(16px, 1.15vw, 19px); line-height: 1.5; }
.mag__hl li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--brick); }
.mag__hl .label { display: block; font-size: 11.5px; letter-spacing: 0.14em; opacity: 0.7; margin-bottom: 2px; }
@media (max-width: 767px) { .mag__high { grid-template-columns: 1fr; } }
