/* ==========================================================================
   House of Grant — shared stylesheet
   One file for every page. Sections:
   1. Tokens   2. Base   3. Typography helpers   4. Layout primitives
   5. Header   6. Footer + CTA   7. Carousel   8. Page sections
   9. Forms   10. Utilities   11. Motion preferences
   Mobile breakpoint: 640px (brand spec). Tablet tweaks at 1024px.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --c-bg: hsl(37 33% 96%);
  --c-brand: rgb(87 15 36);
  --c-ink: #1e1b1a;
  --c-muted: #4d4644;
  --c-line: rgb(87 15 36 / 0.25);
  --c-on-brand: hsl(37 33% 96%);

  /* AW Conqueror Didot (Adobe Fonts) → Antic Didone fallback */
  --font-display: "aw-conqueror-didot", "AW Conqueror Didot", "Antic Didone", "Didot", "Bodoni 72", Georgia, serif;
  --font-label: "GFS Didot", "Didot", "Bodoni 72", Georgia, serif;
  /* Article title faces (self-hosted, see src/layout.mjs) */
  --font-script: "MoonTime", "Mrs Saint Delafield", "Snell Roundhand", cursive;
  --font-condensed: "Perandory Condensed", var(--font-display);
  --font-semicondensed: "Perandory SemiCondensed", var(--font-display);
  --font-body: "Open Sans", "Helvetica Neue", Arial, system-ui, sans-serif;

  --fs-body: 0.875rem;      /* 14px */
  --fs-small: 0.8125rem;    /* 13px */
  --fs-label: 0.75rem;      /* 12px — header labels spec */
  --fs-micro: 0.6875rem;    /* 11px */
  --fs-display: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);

  --ls-label: 0.25em;       /* header labels spec */
  --ls-display: 0.03em;     /* content headings spec */

  --gutter: clamp(16px, 2.6vw, 40px);
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-s: 16px;
  --space-m: 24px;
  --space-l: 48px;
  --space-xl: clamp(64px, 8vw, 128px);
  --space-2xl: clamp(96px, 13vw, 208px);
  --section-gap: var(--space-xl);
  --grid-gap: 10px;

  --measure: 34rem;
  --ease: cubic-bezier(.25, .1, .25, 1);

  /* Header geometry (also drives the spacer on the home page) */
  --wm-ratio: 0.0855;               /* logo height / width (1310 × 112) */
  --hdr-pt: 18px;
  --hdr-pb: 16px;
  --nav-gap: 10px;
  --nav-h: 20px;
  --hdr-small-w: min(600px, calc(100% - 2 * var(--gutter)));
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* never break words with hyphens */
*, *::before, *::after { -webkit-hyphens: manual; hyphens: manual; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font: 400 var(--fs-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* short pages: footer still sits at the bottom of the window */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh;
}
body > main { flex: 1 0 auto; }
img, video, svg { display: block; max-width: 100%; }
/* Discourage saving pictures: no dragging them out, no long-press "Save image" on iPhone/iPad */
img, video { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
img, video { height: auto; }
/* <picture> only chooses the file (AVIF or WebP); the <img> inside does the layout */
picture { display: contents; }
/* blurred preview behind a photo until it loads (main.js removes it after) */
img[data-lqip] { background-size: cover; background-position: center; background-repeat: no-repeat; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
main:focus { outline: none; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* 3. Typography helpers ---------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1;
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
}
.label {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: var(--fs-label);
  line-height: 1.6;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.eyebrow {
  font: 700 var(--fs-small)/1.4 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.prose p + p { margin-top: 1.1em; }
.prose { font-size: var(--fs-small); line-height: 1.55; }
.link-underline {
  display: inline-block;
  font: 700 var(--fs-label)/1 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  padding-block: var(--space-xs);
}
.link-underline:hover { text-decoration-thickness: 2px; }

/* 4. Layout primitives ----------------------------------------------------- */
.section { padding: var(--section-gap) var(--gutter); }
.section--tight { padding: var(--space-m) var(--gutter) var(--space-xl); }
.full-bleed { width: 100%; }
.full-bleed img, .full-bleed video { width: 100%; }

/* 5. Header ---------------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--c-brand); color: var(--c-on-brand); padding: 8px 14px;
}
.skip-link:focus { top: 8px; }

.site-header { position: relative; z-index: 50; background: var(--c-bg); color: var(--c-brand); }
.site-header__inner {
  --hdr-w: var(--hdr-small-w);
  width: var(--hdr-w);
  margin-inline: auto;
  padding-block: var(--hdr-pt) var(--hdr-pb);
  transition: width .32s var(--ease);
}
.site-header--large .site-header__inner { --hdr-w: calc(100% - 2 * var(--gutter)); }

.wordmark { display: block; color: var(--c-brand); }
.wordmark__img { width: 100%; height: auto; }

.site-nav { margin-top: var(--nav-gap); }
.site-nav__list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--nav-h);
  transition: padding .32s var(--ease);
}
.site-header--large .site-nav__list { padding-inline: 6.5%; }
.site-nav__link {
  font-family: var(--font-label);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: 1;
  color: var(--c-brand);
  padding-block: 4px;
}
.site-nav__link[aria-current="page"] { font-weight: 700; }
.site-nav__link.is-soon { opacity: .55; cursor: default; }
.menu-toggle { display: none; }

/* Home: large header that condenses on scroll. Fixed so the change never
   shifts the content; the spacer reserves the large header's height. */
.site-header--shrink { position: fixed; inset: 0 0 auto 0; }
.header-spacer {
  position: relative;
  height: calc(var(--hdr-pt) + (100vw - 2 * var(--gutter)) * var(--wm-ratio) + var(--nav-gap) + var(--nav-h) + var(--hdr-pb));
}
.header-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 32px; }
.site-header--shrink.is-condensed .site-header__inner { --hdr-w: var(--hdr-small-w); }
.site-header--shrink.is-condensed .site-nav__list { padding-inline: 0; }
.site-header--shrink.is-condensed { box-shadow: 0 1px 0 rgb(87 15 36 / .08); }

/* 6. Footer + CTA ---------------------------------------------------------- */
.site-footer { background: var(--c-brand); color: var(--c-on-brand); }
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr minmax(0, 2.2fr) 1fr;
  gap: var(--space-m);
  align-items: start;
  padding: var(--space-l) var(--gutter);
}
.site-footer__contact, .site-footer__hours {
  font: 400 0.6875rem/1.4 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-footer__col li + li { margin-top: 10px; }
.site-footer__contact a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__hours { text-align: right; }
.site-footer__ack {
  text-align: center;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  max-width: 34rem;
  margin-inline: auto;
}
/* small House of Grant logo under the acknowledgement */
.site-footer__name { display: block; width: 150px; margin: 18px auto 0; }
.site-footer__name img { width: 100%; height: auto; }

.cta { text-align: center; padding-top: var(--space-l); }
.page-project .cta { padding-top: 0; }
.cta__title { margin-bottom: var(--space-s); color: var(--c-ink); font: 400 var(--fs-body)/1.4 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; }

/* 7. Carousel -------------------------------------------------------------- */
.carousel { position: relative; --h: 360px; }
.carousel__viewport { overflow: hidden; padding-block: 28px; touch-action: pan-y; }
.carousel__track {
  display: flex;
  gap: 0;
  width: max-content;
  transition: transform .7s var(--ease);
  will-change: transform;
}
.carousel__track.is-jumping, .carousel__track.is-jumping img { transition: none !important; }
.carousel__item { flex: 0 0 auto; position: relative; }
.carousel__item img { height: var(--h); width: auto; max-width: none; object-fit: cover; }
.carousel__link { display: block; }

.carousel__btn {
  position: absolute; top: 50%; z-index: 3;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 0;
  background: rgb(248 246 241 / .85);
  color: var(--c-brand);
  font: 400 1.5rem/1 var(--font-label);
  cursor: pointer;
  transition: background .2s;
}
.carousel__btn:hover { background: var(--c-bg); }
.carousel__btn--prev { left: var(--gutter); }
.carousel__btn--next { right: var(--gutter); }

/* Instagram: equal heights, image grows on hover */
.carousel--instagram .carousel__item img { transition: transform .35s var(--ease); }
.carousel--instagram .carousel__item:hover { z-index: 2; }
@media (hover: hover) {
  .carousel--instagram .carousel__item:hover img { transform: scale(1.08); }
}
.carousel--instagram .carousel__item:focus-within img { transform: scale(1.08); }

/* Feature (project gallery): centred, active image at full size */
.carousel--feature { --h: 520px; }
.carousel--feature .carousel__item img { transform: translateX(var(--shift, 0px)) scale(.7); transition: transform .7s var(--ease); }
.carousel--feature .carousel__item.is-active img { transform: none; }

.instagram { padding-inline: 0; padding-bottom: var(--space-m); }
.instagram__title { text-align: center; margin-bottom: var(--space-xs); color: var(--c-ink); }
.instagram__title a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* 8. Page sections --------------------------------------------------------- */

/* Home */
.intro { padding-block: var(--space-2xl); text-align: center; }
.intro__text { line-height: 2.6; color: var(--c-ink); }
.intro__lead { display: block; margin-bottom: 1.4em; font: 700 var(--fs-label)/1.6 var(--font-body); letter-spacing: 0.12em; }
.page-home .full-bleed + .full-bleed { margin-top: var(--section-gap); }
.full-bleed img[src*="home-rear-facade"] { aspect-ratio: 6 / 5; object-fit: cover; }
.video-block__video { aspect-ratio: 16 / 9; object-fit: cover; background: #d9d2c8; }

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
  max-width: 1080px;
  margin-inline: auto;
}
.service__img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.service__title { margin-top: 12px; font: 700 var(--fs-small)/1.4 var(--font-body); text-transform: uppercase; }
.service__text { margin-top: 6px; font-size: var(--fs-micro); line-height: 1.55; text-align: justify; }

/* About */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
/* portrait runs alongside both The Studio and The Founder */
.studio__media { aspect-ratio: 2 / 3; }
.studio__media img { width: 100%; height: 100%; object-fit: cover; }
/* The Studio sits at the top of the portrait, The Founder ends level with its bottom */
.studio__body {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-xl);
  padding: var(--space-xs) var(--gutter) 0;
  max-width: calc(27rem + 2 * var(--gutter));
}
.studio__title { margin-bottom: var(--space-m); }
.studio__body p { text-align: justify; }
.studio__body .lead { font-size: var(--fs-small); }

.philosophy { display: flex; justify-content: flex-end; padding-block: var(--space-2xl); }
.philosophy__quote { text-align: right; font: 700 var(--fs-small)/2.7 var(--font-body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--c-ink); }

.ethos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: var(--grid-gap);
  align-items: end;
}
.ethos__title { padding-bottom: 5.5rem; }
.ethos__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
.ethos__name { font: 700 var(--fs-small)/1.3 var(--font-body); text-transform: uppercase; }
.ethos__sub { font-style: italic; font-size: var(--fs-small); margin-bottom: 14px; }
.ethos__img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ethos__text { margin-top: 12px; font-size: var(--fs-small); line-height: 1.45; max-width: 24rem; min-height: 4.4em; }

/* Projects grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-l) var(--space-s);
}
.project-card__link { display: block; cursor: pointer; }
.project-card__media { position: relative; aspect-ratio: 5 / 4; overflow: hidden; }
.project-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.project-card__img--colour { opacity: 0; transition: opacity .45s var(--ease); }
@media (hover: hover) {
  .project-card:hover .project-card__img--colour { opacity: 1; }
}
.project-card:focus-within .project-card__img--colour,
.project-card.is-colour .project-card__img--colour { opacity: 1; }
.project-card__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-xs);
  margin-top: 12px; padding-top: 2px;
}
.project-card__title { font: 700 var(--fs-small)/1.3 var(--font-body); text-transform: uppercase; letter-spacing: 0.02em; }
.project-card__status { font-size: var(--fs-small); white-space: nowrap; }
.project-card__link:hover .project-card__title { text-decoration: underline; text-underline-offset: 4px; }

/* Single project */
.project-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* desktop: the opening screen shows only the title, facts and sketch; the first
   photograph starts at the fold (--hdr-h is the header's height, set by main.js) */
@media (min-width: 641px) {
  .project-hero { min-height: calc(100vh - var(--hdr-h, 120px)); min-height: calc(100svh - var(--hdr-h, 120px)); }
}
.project-hero__text { padding: var(--space-l) var(--gutter); }
.project-hero__title { margin-bottom: var(--space-l); }
.project-hero__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 60% center; }
/* drawings: shown whole, centred beside the facts */
.project-hero__media.is-contain { align-self: center; padding: var(--space-l) var(--gutter); }
.project-hero__media.is-contain img { aspect-ratio: auto; object-fit: contain; max-height: 80vh; margin-inline: auto; width: auto; max-width: 100%; }
.project-facts { display: grid; grid-template-columns: auto auto auto; gap: var(--space-m) var(--space-l); justify-content: start; font-size: var(--fs-micro); }
.project-facts dt { font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.project-facts dd { font-style: italic; }
.project-facts ul { list-style: none; padding: 0; margin: 0; }
.project-facts li + li { margin-top: 10px; }

/* Text beside an image sits on the image's bottom edge, however tall the image */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.split__text { padding: var(--space-l) var(--gutter); max-width: calc(24rem + 2 * var(--gutter)); } /* bottom padding: text never touches the picture below */
.split__text .eyebrow { margin-bottom: 4px; }
.split__text p { text-align: justify; }
.split__media img { width: 100%; }
.split__media.is-contain { padding: var(--space-l) var(--gutter) 0; } /* drawing's bottom edge stays level with the text */
/* text-only sections, placed in the left or right column */
.split--text-left, .split--text-right { padding-block: var(--space-xl); }
.split--text-left .split__text { padding-bottom: 0; }
.split--text-right .split__text { grid-column: 2; max-width: none; padding: 0 var(--gutter); }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.pair__item img { width: 100%; }
/* photos in a pair fill their half edge to edge, so no gaps between pictures */
.pair__item:not(.is-contain):not(.is-inset) img { height: 100%; object-fit: cover; }
.pair__item.is-contain, .pair__item.is-inset { align-self: center; }
.pair__item.is-contain { padding: var(--space-l) var(--gutter); }
.pair__item.is-inset { align-self: center; padding: var(--space-m) var(--space-m); }
/* reversed split: image left, text right (still on the image's bottom edge) */
.split--reverse .split__media { order: -1; }
.split--reverse .split__text { justify-self: start; }
.credits p { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; }
.credits p + p { margin-top: 0.6em; }
/* a single image filling one half of the page */
.single { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.single--right .single__media { grid-column: 2; }
.single__media img { width: 100%; }
/* standard frame crops, matching the layout PDFs */
.is-crop-half img { aspect-ratio: 8 / 9; object-fit: cover; }
.is-crop-slide img { aspect-ratio: 16 / 9; object-fit: cover; }
.is-crop-portrait img { aspect-ratio: 4 / 5; object-fit: cover; }

.gallery { padding-inline: 0; }
.project-back { text-align: center; padding-bottom: var(--space-xl); }
/* pages that end on a picture rather than the carousel: same space above the link */
.split:not(.split--text-left):not(.split--text-right) + .project-back,
.pair + .project-back, .project-wide + .project-back, .single + .project-back { padding-top: var(--section-gap); }
/* Project team credits sit on the right; the longest line ends level with the
   footer's right-hand column (Sydney | Adelaide) */
.split--reverse .split__text.credits { justify-self: end; width: fit-content; padding-right: var(--gutter); }

/* Musings (journal index) */
.musing-tiles {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  background: var(--c-brand);
  color: var(--c-on-brand);
}
.musing-tile { position: relative; aspect-ratio: 150 / 207; display: grid; place-items: center; text-align: center; }
.musing-tile__label {
  position: relative; z-index: 1;
  padding: var(--space-s);
  /* same face as the main navigation */
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(var(--fs-label), 0.5rem + 0.4vw, 0.875rem);
  line-height: 1.7;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.musing-tile__link { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: #fff; }
.musing-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s var(--ease); }
.musing-tile__title { width: 100%; text-shadow: 0 1px 12px rgb(0 0 0 / .35); }
/* letter-spacing adds space after the last letter of each line; balance it
   on the left so every line sits exactly in the middle of the picture */
.musing-tile__label { padding: var(--space-xs); padding-left: calc(var(--space-xs) + var(--ls-label)); text-wrap: balance; }
/* title appears on hover; on touch screens it is always shown */
@media (hover: hover) {
  .musing-tile__title { opacity: 0; transform: translateY(6px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
  .musing-tile__link:hover .musing-tile__title,
  .musing-tile__link:focus-visible .musing-tile__title { opacity: 1; transform: none; }
  .musing-tile__link:hover .musing-tile__img,
  .musing-tile__link:focus-visible .musing-tile__img { transform: scale(1.04); filter: brightness(.82); }
}
.musing-tile__link:focus-visible { outline: 1px solid #fff; outline-offset: -6px; }

.musings-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-l);
  align-items: stretch;
  padding: var(--space-l) var(--gutter);
  color: var(--c-brand);
}
.musings-intro__title {
  font: 400 clamp(4rem, 10vw, 13rem)/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
/* The right-hand text spans exactly the height of MUSINGS: top of
   "Big Dreamers" level with the top of the capitals, last line of the
   paragraph sitting on MUSINGS' baseline. text-box trims the space above
   capitals and below the baseline so the edges meet exactly. */
.musings-intro__title,
.musings-intro__tagline,
.musings-intro__body { text-box: trim-both cap alphabetic; }
.musings-intro__text {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
  gap: var(--space-s);
  text-align: right;
  container-type: inline-size;
}
.musings-intro__tagline {
  /* one line, never wider than its column */
  font: 400 min(3.9vw, 5.6cqi, 5rem)/1 var(--font-display);
  text-transform: uppercase;
  white-space: nowrap;
}
.musings-intro__body { color: var(--c-ink); font-size: var(--fs-body); line-height: 1.45; max-width: 27rem; }
@media (max-width: 900px) {
  .musings-intro { grid-template-columns: minmax(0, 1fr); gap: var(--space-m); }
  .musings-intro__text { align-items: flex-start; text-align: left; }
  .musings-intro__tagline { white-space: normal; font-size: clamp(1.5rem, 6vw, 2.5rem); }
}

/* Musing (article) */
.musing-hero { position: relative; overflow: hidden; color: #fff; }
.musing-hero__media { display: flex; justify-content: center; height: min(47vw, 82vh); }
.musing-hero__media img { flex: 0 0 50%; width: 50%; height: 100%; object-fit: cover; }
.musing-hero__side { filter: brightness(.62) saturate(.9); }
.musing-hero__title {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 400; text-align: center;
  text-shadow: 0 1px 18px rgb(0 0 0 / .18);
}
.musing-hero__kicker {
  font: 400 clamp(1.5rem, 0.8rem + 2vw, 3rem)/1 var(--font-script);
  margin: 0 0 -0.2em -4.5em;
  transform: rotate(-8deg);
}
.musing-hero__main { display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); text-transform: uppercase; line-height: .92; }
.musing-hero__line--1 { font-family: var(--font-condensed); font-size: clamp(1.75rem, 0.8rem + 2.7vw, 3.75rem); }
.musing-hero__line--2 { font-family: var(--font-semicondensed); font-size: clamp(2.5rem, 1rem + 4.4vw, 6rem); }
.musing-hero__tagline {
  font: 400 clamp(1.5rem, 0.8rem + 2vw, 3rem)/1.05 var(--font-script);
  max-width: 6.5em;
  margin: 0.6em -9em 0 0;
  transform: rotate(-22deg);
}

/* scroll story: the text changes while the illustration stays put; a new
   illustration cross-fades in (main.js marks the active step and image) */
.scrolly {
  display: grid;
  grid-template-columns: minmax(var(--gutter), 15.5fr) minmax(15rem, 19fr) minmax(var(--space-m), 7fr) minmax(0, 50fr) minmax(var(--gutter), 8.5fr);
}
.scrolly__steps { grid-column: 2; grid-row: 1; padding-block: 10vh 20vh; }
.scrolly__step { min-height: 100vh; display: flex; align-items: center; }
.scrolly__copy { font-size: var(--fs-small); line-height: 1.6; }
.scrolly__copy p { text-align: justify; }
.scrolly__copy p + p { margin-top: 1.25em; }
.scrolly__copy strong { font-weight: 700; }
.js .scrolly__step { opacity: .18; transition: opacity .6s var(--ease); }
.js .scrolly__step.is-active { opacity: 1; }
.scrolly__figure {
  grid-column: 4; grid-row: 1; align-self: start;
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; place-items: center;
}
.scrolly__img { grid-area: 1 / 1; display: grid; place-items: center; opacity: 0; transition: opacity .9s var(--ease), transform 1.2s var(--ease); transform: scale(.985); }
.scrolly__img.is-active { opacity: 1; transform: none; }
.scrolly__img img { width: 100%; max-height: 80vh; object-fit: contain; }
.no-js .scrolly__img:first-child, html:not(.js) .scrolly__img:first-child { opacity: 1; }
.page-musing .project-back { padding-top: var(--space-l); }

/* Legal pages */
.legal { max-width: calc(44rem + 2 * var(--gutter)); margin-inline: auto; }
.legal__header { margin-bottom: var(--space-l); }
.legal__title { color: var(--c-brand); margin-bottom: var(--space-s); }
.legal__updated { font-size: var(--fs-small); color: var(--c-muted); }
.legal__body { font-size: var(--fs-body); }
.legal__body section { margin-top: var(--space-l); }
.legal__body h2 { margin-bottom: var(--space-s); color: var(--c-brand); }
.legal__body ul { margin: 1.1em 0 0; padding-left: 1.2em; }
.legal__body li + li { margin-top: .5em; }
.legal__body a { text-decoration: underline; text-underline-offset: 3px; }

/* "Muse with us": subscribe band at the end of every page */
.muse {
  display: grid;
  grid-template-columns: minmax(0, 30fr) minmax(0, 40fr) minmax(14rem, 20fr);
  /* rows: [space] title / intro / note [space]; the form starts on the intro's
     row, so "First name" lines up with the top of the paragraph */
  grid-template-rows: 1fr auto auto auto 1fr;
  justify-items: start;
  column-gap: 3vw;
  margin-top: var(--section-gap);
  padding-right: var(--gutter);
  color: var(--c-ink);
}
.muse__media { grid-column: 1; grid-row: 1 / -1; align-self: center; width: 100%; }
.muse__img { width: 100%; aspect-ratio: 7 / 5; object-fit: cover; }
.muse__title { font-weight: 400; line-height: 1; margin-bottom: var(--space-m); white-space: nowrap; }
.muse__title-main { font-family: var(--font-display); font-size: clamp(2.5rem, 4.2vw, 4.75rem); text-transform: uppercase; letter-spacing: 0.01em; }
.muse__title-script { font-family: var(--font-script); font-size: clamp(1.75rem, 2.9vw, 3.25rem); margin-left: 0.15em; }
.muse__text { grid-column: 2; grid-row: 2 / 5; display: grid; grid-template-rows: subgrid; max-width: 30rem; }
.muse__intro { font-size: var(--fs-body); line-height: 1.45; letter-spacing: 0.08em; align-self: start; }
.muse__note { margin-top: var(--space-s); font-size: var(--fs-micro); line-height: 1.45; letter-spacing: 0.06em; }
.muse__note a { text-decoration: underline; text-underline-offset: 2px; }
.muse__form { grid-column: 3; grid-row: 3 / -1; align-self: start; display: grid; gap: var(--space-s); justify-items: start; justify-self: stretch; }
.muse__input {
  width: 100%; padding: 0 0 6px; /* no top padding: text starts level with the paragraph */
  background: none; border: 0; border-bottom: 1px solid var(--c-line); border-radius: 0;
  font-size: var(--fs-label); line-height: 1.45; letter-spacing: 0.1em; text-transform: uppercase;
}
.muse__input::placeholder { color: var(--c-ink); opacity: 1; }
.muse__input:focus { text-transform: none; }
.muse__input:focus::placeholder { opacity: .4; }
.muse__input:focus-visible { outline: none; border-bottom-color: var(--c-brand); }
.muse__input[aria-invalid="true"] { border-bottom-color: #b3261e; }
.muse__btn {
  margin-top: var(--space-2xs); padding: 0;
  background: none; border: 0; cursor: pointer;
  font: 700 var(--fs-label)/1.2 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.muse__btn:disabled { opacity: .5; cursor: progress; }
.muse__status { min-height: 1.4em; font-size: var(--fs-small); letter-spacing: 0.02em; }
.muse + .cta { padding-top: var(--space-xl); }

/* Contact */
.page-contact .site-footer__inner { border-top: 1px solid rgb(248 246 241 / .15); }
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.15fr);
  gap: var(--space-l);
  padding: var(--space-l) var(--gutter) var(--space-xl);
  background: var(--c-brand);
  color: var(--c-on-brand);
}
.contact__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 70%; }
.contact__title { margin-block: var(--space-xs) var(--space-l); }
.contact__list { display: grid; gap: var(--space-m); font-size: var(--fs-small); }
.contact__legal { display: grid; gap: var(--space-2xs); margin-top: var(--space-l); font-size: var(--fs-micro); letter-spacing: 0.04em; }
.contact__legal a { text-decoration: underline; text-underline-offset: 3px; }
.contact__list dt { text-transform: uppercase; letter-spacing: 0.04em; }
.contact__list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.contact__intro { font: 700 var(--fs-small)/1.5 var(--font-body); text-transform: uppercase; margin-block: var(--space-xs) var(--space-l); }

/* 404 */
.not-found { text-align: center; min-height: 50vh; display: grid; place-content: center; gap: var(--space-m); }
.not-found .link-underline { margin-inline: var(--space-s); }

/* 9. Forms ----------------------------------------------------------------- */
.form { display: grid; gap: var(--space-m); }
.form__group { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-m); min-width: 0; }
.form__group[hidden] { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-m); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.04em; }
.field__hint { text-transform: none; opacity: .75; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgb(248 246 241 / .5);
  border-radius: 0;
  color: var(--c-on-brand);
  font-size: var(--fs-body);
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 24px;
  cursor: pointer;
}
.field select option { color: var(--c-ink); }
.field textarea { resize: vertical; min-height: 6rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--c-on-brand); box-shadow: 0 1px 0 var(--c-on-brand); }
.field [aria-invalid="true"] { border-bottom-color: #ffb3c1; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__submit { justify-self: start; background: none; border: 0; padding-inline: 0; color: var(--c-on-brand); cursor: pointer; }
.form__status { font-size: var(--fs-small); min-height: 1.5em; }

/* 10. Utilities ------------------------------------------------------------ */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Tablet ------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .contact__form-wrap { grid-column: 1 / -1; max-width: 40rem; }
  .ethos { grid-template-columns: minmax(0, 1fr); }
  .ethos__title { padding-bottom: var(--space-s); }
  .project-facts { grid-template-columns: auto auto; }
}

/* Mobile (≤ 640px) ---------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --hdr-pt: 14px;
    --hdr-pb: 12px;
    --nav-gap: 6px;
    --nav-h: 32px;
    --hdr-small-w: calc(72% - 2 * var(--gutter));
    --fs-display: 2.25rem;
  }
  .js .site-nav { display: none; }
  .js .menu-toggle {
    display: block;
    margin: var(--nav-gap) auto 0;
    min-height: var(--nav-h);
    padding: 6px 14px;
    background: none; border: 0;
    font-family: var(--font-label);
    font-size: var(--fs-label);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    color: var(--c-brand);
    cursor: pointer;
    position: relative; z-index: 2;
  }
  .site-nav__list { flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
  .site-header--large .site-nav__list { padding-inline: 0; }
  .js .site-header.is-menu-open .site-nav {
    display: flex; align-items: center; justify-content: center;
    position: fixed; inset: 0; z-index: 1; margin: 0;
    background: var(--c-bg);
  }
  .js .site-header.is-menu-open .site-nav__list { flex-direction: column; gap: 28px; }
  .js .site-header.is-menu-open .site-nav__link { font-size: 1rem; }
  .js .site-header.is-menu-open .wordmark,
  .js .site-header.is-menu-open .menu-toggle { position: relative; z-index: 2; }
  .no-scroll { overflow: hidden; }

  .section { padding-block: var(--space-xl); }
  .intro { padding-block: var(--space-xl); }
  .intro__text br, .philosophy__quote br, .contact__intro br { display: none; }
  .intro__text { line-height: 2.2; }

  .services__grid, .ethos__grid, .project-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-l); }

  .studio, .project-hero, .split, .pair, .contact { grid-template-columns: minmax(0, 1fr); }
  .studio__body { padding-block: var(--space-l) 0; }
  .philosophy { justify-content: center; }
  .philosophy__quote { text-align: center; line-height: 2.2; }
  .ethos__text { min-height: 0; }

  .project-hero__media { order: -1; }
  .project-facts { grid-template-columns: minmax(0, 1fr); gap: var(--space-s); }
  .split__media { order: -1; }
  .split__text { padding-top: var(--space-m); }
  .split--text-right .split__text { grid-column: 1; }
  .single { grid-template-columns: minmax(0, 1fr); }
  .single--right .single__media { grid-column: 1; }
  .pair__item.is-inset { padding: 0; }
  .project-hero__media.is-contain { padding-block: var(--space-m) 0; }


  .contact { gap: var(--space-l); }
  .contact__form-wrap { grid-column: auto; }
  .field-row { grid-template-columns: minmax(0, 1fr); }

  .carousel { --h: 240px; }
  .carousel--feature { --h: 380px; }
  .carousel__btn { width: 36px; height: 36px; font-size: 1.25rem; }

  .musing-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .musing-hero__media { height: 92vw; }
  .musing-hero__media img { flex-basis: 70%; width: 70%; }
  .musing-hero__tagline { margin-right: -5em; }
  /* phones: the picture stays pinned at the top while the text scrolls beneath it */
  .scrolly { display: flex; flex-direction: column; }
  .scrolly__figure {
    order: -1; z-index: 2;
    height: 46vh; height: 46svh;
    padding: var(--space-s) var(--gutter) 0;
    background: var(--c-bg);
    box-shadow: 0 18px 18px -6px var(--c-bg);
  }
  .scrolly__img img { max-height: calc(46svh - var(--space-s)); }
  .scrolly__steps { padding: 0 var(--gutter) 20vh; }
  .scrolly__step { min-height: 54vh; min-height: 54svh; align-items: flex-start; padding-top: var(--space-l); }

  .muse { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: var(--space-l); padding-right: 0; }
  .muse__media, .muse__text, .muse__form { grid-column: 1; grid-row: auto; }
  .muse__text { display: block; }
  .muse__text, .muse__form { padding-inline: var(--gutter); }
  .muse__form { width: 100%; }
  .site-footer__inner { grid-template-columns: minmax(0, 1fr); text-align: center; gap: var(--space-l); }
  .site-footer__hours { text-align: center; }
  .site-footer__ack { order: 3; }
}

/* 11. Motion preferences --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
