/* ==========================================================================
   JN Bespoke Joinery
   Built from Figma: JN Bespoke Joinery · Desktop 1440
   --------------------------------------------------------------------------
   Contents
   1. Tokens
   2. Reset and base
   3. Layout helpers
   4. Type
   5. Buttons and links
   6. Header
   7. Sections
   8. Footer
   9. Project pages
   10. Responsive
   11. Motion
   12. Project covers
   13. Project mosaic
   ========================================================================== */

/* 1. Fonts ===============================================================
   Self hosted so the site has no third party dependency and nothing is
   requested from Google on page load. Latin subset only, woff2 only.
   ========================================================================= */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/cinzel-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/cinzel-latin-900-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/poppins-latin-300-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2");
}

/* 500 and 600 carry the accents: eyebrows, labels and every call to action.
   Cinzel does the display work, this does the signage. */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2");
}

/* 2. Tokens ============================================================== */

:root {
  /* Brand, taken from the logo artwork */
  --navy: #213f6f;
  --navy-deep: #1a3159;
  --green: #6fc72d;
  --cream: #f2efe9;
  --cream-deep: #e6e2db;
  --stage-bg: #c7c0af;
  --ink: #191a1c;
  --white: #fff;

  /* Ink on cream */
  --ink-70: rgba(25, 26, 28, 0.7);

  /* White on navy */
  --white-90: rgba(255, 255, 255, 0.9);
  --white-78: rgba(255, 255, 255, 0.78);
  --white-75: rgba(255, 255, 255, 0.75);
  --white-60: rgba(255, 255, 255, 0.6);
  --white-55: rgba(255, 255, 255, 0.55);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-45: rgba(255, 255, 255, 0.45);
  --white-12: rgba(255, 255, 255, 0.12);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-05: rgba(255, 255, 255, 0.05);

  /* Type. --serif is the display voice and --sans the reading voice.
     --accent is the third: eyebrows, small labels and calls to action, set
     apart from the headings by being unserifed rather than by colour alone.
     It points at --sans today; point it somewhere else and every accent on
     the site follows. */
  --serif: "Cinzel", "Times New Roman", serif;
  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --accent: var(--sans);

  /* Grid: 1440 frame, 72 side margin, 24 gutter */
  --shell: 1296px;
  --gutter: 24px;
  --pad-x: clamp(20px, 5vw, 72px);

  /* Vertical rhythm */
  --section-y: clamp(72px, 9vw, 150px);

  /* Corners. Every photograph on the site is cornered by one of these two, so
     changing them here changes the whole site. They stay separate so the big
     mosaic tiles could be rounded independently of the small ones later
     without touching every rule. */
  --radius: 6px;
  --radius-lg: 6px;

  /* The two drifting columns in the About section sit closer together than
     the page gutter, so they read as one block of work rather than two. */
  --marquee-gap: clamp(8px, 0.9vw, 14px);

  /* How far the drifting columns run past the right edge of the page. The
     shell's own side padding is added to this, so the strip clears the margin
     first and then keeps going, and the right column is cut by the window. */
  --about-bleed: clamp(24px, 6.5vw, 96px);

  /* Kind Words carousel */
  --tc-w: clamp(360px, 46vw, 640px);
  --tc-gap: clamp(16px, 1.8vw, 32px);

}

/* 2. Reset and base ====================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
p,
figure,
blockquote {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 3. Layout helpers ====================================================== */

.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--pad-x) * 2);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section {
  padding-block: var(--section-y);
}

/* Not a flat field. Over a thousand pixels of one unbroken colour reads as a
   printed block rather than a room, so the ground deepens slightly down the
   section. It is a few percent, and you should not be able to point at it. */
.section--navy {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
}

.section--cream {
  background: var(--cream);
  color: var(--ink);
}

/* Headings on the cream ground are navy; on navy they inherit white. */
.section--cream .h2 {
  color: var(--navy);
}

/* Sits straight under the section above it rather than opening with air. */
.section--flush {
  padding-top: clamp(96px, 11vw, 186px);
}

/* Projects paints no ground of its own and shows the page through instead.
   Same colour as the cream either way, but defined in one place rather than
   two, so changing the page ground changes this with it. It keeps the cream
   class so a heading added here later still comes out navy. */
#projects {
  background: transparent;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(48px, 6vw, 70px);
}

.grid {
  display: grid;
  gap: clamp(32px, 3.5vw, 56px) var(--gutter);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 4. Type ================================================================ */

.eyebrow {
  font-family: var(--accent);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 3.2px;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 22px;
}

.display {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 3.6vw, 45px);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--navy);
}

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.12;
  margin: 0;
}

.h2--lg {
  font-size: clamp(38px, 4.6vw, 62px);
}

.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2vw, 27px);
  line-height: 1.26;
  margin: 0;
}

.body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 2.07;
}

.body p + p {
  margin-top: 1.4em;
}

/* Every small letterspaced label on the site runs through this shape. */
.meta,
.tile__eyebrow,
.quote__by,
.testimonial__by,
.project-hero__meta,
.project-spec dt,
.site-footer__label,
.site-footer__copyright {
  font-family: var(--accent);
  text-transform: uppercase;
}

/* 5. Buttons and links =================================================== */

.btn {
  display: inline-block;
  font-family: var(--accent);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  line-height: 1;
  padding: 15px 22px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--navy);
  text-decoration: none;
  /* Solid rather than see-through, so the button reads cleanly wherever it
     sits, including where it overlaps a photograph rather than plain
     section colour. Both current CTAs are on cream sections; --btn-bg lets
     a section override it (see .btn--light) if one on a different
     background ever needs it. */
  background: var(--btn-bg, var(--cream));
  transition: background-color 0.25s ease, color 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--green);
  color: var(--white);
}

.btn--light {
  color: var(--white);
}

.btn--light:hover,
.btn--light:focus-visible {
  background: var(--green);
  color: var(--navy);
}


.link-back {
  display: inline-block;
  font-family: var(--accent);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green);
}

.link-back:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* 6. Header ============================================================== */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding-block: clamp(24px, 4vw, 67px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: block;
  width: clamp(140px, 14vw, 196px);
}

.logo img {
  width: 100%;
  height: auto;
}

/* Header sitting on navy (project pages) uses the reversed lockup */
.site-header--onNavy {
  position: static;
  background: var(--navy);
}

/* 7. Sections ============================================================ */

/* 7.1 Hero --------------------------------------------------------------- */

/* The artwork is 5:4 and paints its own way out of the page: cream along the
   top, the left edge and the bottom. Those are the joins, and none of them
   may be cropped.

   The drawing is sized from the WIDTH of the window and its height follows
   from the artwork's own ratio, so it grows and shrinks with the page instead
   of sitting at one fixed size. The section is then made at least as tall as
   the drawing, which is what keeps the two in step: a fixed-height section
   with a fluid drawing in it either leaves a pool of cream underneath on a
   small window or crops the drawing on a large one.

   Three numbers do all of it. --hero-w is the width and carries the whole
   responsive behaviour; the floor stops it collapsing on a small laptop and
   the ceiling stops it running away on a large monitor, where the rest of the
   page is capped at 1296 anyway. --hero-scale is the nudge, for making the
   drawing bigger or smaller without touching the rest. --hero-art is the
   artwork's aspect ratio, and the one to change if it is ever redrawn to a
   different shape. */
.hero {
  --hero-art: 1.25;
  --hero-scale: 1;
  --hero-w: calc(clamp(560px, 62vw, 980px) * var(--hero-scale));
  --hero-h: calc(var(--hero-w) / var(--hero-art));
  /* How far below the top of the page the drawing starts. */
  --hero-top: clamp(44px, 5.5vw, 104px);
  /* Distance from the true right edge of the viewport to the shell's own
     right edge: pad-x while the viewport is narrower than the shell's max
     width, and pad-x plus half the leftover space once it is wider. Anchoring
     the artwork to this instead of a flat 0 keeps its right edge lined up
     with the rest of the page's content at every width, rather than running
     on past the margin to the window edge. */
  --hero-right: max(var(--pad-x), calc((100vw - var(--shell) - var(--pad-x) * 2) / 2 + var(--pad-x)));

  position: relative;
  background: var(--cream);
  /* Tall enough for the drop and the drawing together, so the drawing's
     bottom still lands exactly on the section's bottom edge and the join
     there is unchanged. */
  min-height: max(640px, calc(var(--hero-h) + var(--hero-top)));
  display: flex;
  /* The copy is set from the top rather than centred in the section. Centred,
     it drifted down as the drawing grew, and the taller the window the lower
     the headline sat. Held at a share of the drawing's height it keeps the
     same relationship to the picture at every size. Box-sizing is border-box
     throughout, so this padding comes out of the section's height rather than
     being added to it. */
  align-items: flex-start;
  padding-top: calc(var(--hero-h) * 0.27);
  overflow: hidden;
}

/* Set in from the top right corner and given the artwork's own shape, rather
   than stretched across a block and cropped to fit. It runs off the right of
   the page, starts --hero-top below the top of it, and its bottom lands on
   the section's bottom edge. Nothing is cropped in any direction at any
   width. */
.hero__media {
  position: absolute;
  top: var(--hero-top);
  right: var(--hero-right);
  width: var(--hero-w);
  aspect-ratio: var(--hero-art);
  background: transparent;
  overflow: hidden;
  /* Two fades, and the block shows only where both let it through.

     Across: the drawing begins with a hard vertical stroke where the line
     work starts, which reads as an edge cut through it rather than a drawing
     that opens out of the page. The first stretch dissolves, so the picture
     arrives instead of starting, and it is the part the headline sits over so
     nothing worth seeing is lost to it.

     Down: the artwork used to end in cream along its top edge and could run
     off the top of the page without showing a join. It does not any more, and
     now that it starts below the top of the page that edge would be a line
     straight across the width. So it fades in instead. */
  mask-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 7%, #000 44%, #000 88%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 15%);
  -webkit-mask-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 7%, #000 44%, #000 88%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 15%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

/* Absolute, so the photograph always crops to the block rather than the block
   stretching to the photograph's own proportions. */
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Spare width comes off the left, where the drawing has already given way to
     cream. The bottom is pinned so the fade stays in the frame. */
  object-position: 100% 100%;
}

/* Placeholder caption. Delete it once a real photograph is in place. */
.hero__mediaLabel {
  position: absolute;
  right: 20px;
  bottom: 18px;
  max-width: 70%;
  font-size: 10px;
  letter-spacing: 1.2px;
  line-height: 1.5;
  text-align: right;
  text-transform: uppercase;
  color: rgba(25, 26, 28, 0.4);
}

/* The feather used to dissolve the photograph into the page. The hero artwork
   now does that itself: it is drawn on the left, rendered on the right, and
   its ground is the same cream as the page. So there is nothing to add here at
   desktop width, and adding it only milked the dark cabinets and the floor.
   The narrow layout still needs one, and gets it further down. */
.hero__feather {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero__copy {
  max-width: 571px;
}

.hero__copy .display {
  margin-bottom: 26px;
}

/* 7.3 Philosophy --------------------------------------------------------- */

/* The quotation marks are their own elements rather than characters inside
   the sentence, so they can be set huge and green and hung either side of it
   without dragging the line height of the quote around with them. */
.quote {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 2vw, 30px);
  align-items: start;
  max-width: 1000px;
  margin-inline: auto;
}

.quote__mark {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(70px, 9vw, 140px);
  line-height: 0.72;
  color: var(--green);
  user-select: none;
}

.quote__mark--close {
  align-self: end;
}

.quote__body {
  text-align: center;
  padding-block: clamp(6px, 1.2vw, 18px);
}

.quote__text {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.53;
  color: var(--white);
}

.quote__rule {
  width: 64px;
  height: 1px;
  background: var(--green);
  border: 0;
  margin: 38px auto 24px;
}

.quote__by {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 2.6px;
  color: var(--white-55);
}

/* 7.4 About =============================================================
   The workshop copy and the two photographs are one block: copy on the left,
   the pair on the right with the second dropped below the first. The section
   carries the usual padding, so the lower photograph has room beneath it,
   which it did not when the pair stood on its own.
   ========================================================================= */

/* No padding on the section: the drifting columns have to reach its top and
   bottom edges. The copy carries the padding instead, and centres itself
   against whatever height that makes. */
#about {
  padding-block: 0;
  /* The strip runs off the right of the page, so something has to clip it or
     the whole document scrolls sideways. */
  overflow: hidden;
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 3.2fr) minmax(0, 3.2fr);
  column-gap: clamp(36px, 6vw, 96px);
  row-gap: clamp(28px, 4vw, 56px);
  align-items: stretch;
}

.about__copy {
  grid-column: 1;
  align-self: center;
  padding-block: var(--section-y);
}

/* Two columns of work, close together, drifting in opposite directions. The
   track holds the set twice, so translating it by exactly half its height
   lands on the copy and the loop never shows a join. Each shot carries its
   own bottom margin rather than the column using gap, because a gap would
   make that half-height arithmetic wrong by one gap.

   The columns run the full height of the section, edge to edge, so the strip
   is cut by the sections above and below rather than floating in the middle
   of the cream with air around it. That is why the section itself carries no
   vertical padding and the copy carries it instead. */
.about__gallery {
  grid-column: 2 / span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* One row that takes whatever height it is given and no more. Without this
     the row is auto and the column would be as tall as its own contents,
     which after duplication is two full sets of photographs. */
  grid-template-rows: minmax(0, 1fr);
  gap: var(--marquee-gap);
  /* Past the shell margin and then some, so the right hand column is cropped
     by the edge of the window rather than stopping neatly inside it. */
  margin-right: calc((var(--pad-x) + var(--about-bleed)) * -1);
  /* The section is as tall as this, not as tall as the paragraph beside it.
     The copy then centres against it. */
  min-height: clamp(560px, 64vw, 880px);
}

/* Softened ends. The columns still run to the very edges of the section, but
   the last inch of each dissolves rather than being cut off square against
   the navy above and below. */
.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(180deg,
    rgba(0, 0, 0, 0) 0%, #000 8%, #000 92%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(180deg,
    rgba(0, 0, 0, 0) 0%, #000 8%, #000 92%, rgba(0, 0, 0, 0) 100%);
}

/* Out of flow, so a column has no height of its own to contribute and simply
   fills the section. The track is still free to be as tall as it likes. */
.marquee__track {
  position: absolute;
  top: 0;
  inset-inline: 0;
}

/* The two columns move in opposite directions, so they drift apart on their
   own; the negative delay just means they are never in step to begin with. */
.marquee--down .marquee__track {
  animation-delay: -24s;
}

.marquee__shot {
  margin: 0 0 var(--marquee-gap);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--cream-deep);
  aspect-ratio: 3 / 4;
}

.marquee__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Only once main.js has duplicated the set is there anything to loop into. */
.marquee.is-live .marquee__track {
  animation: marquee-up var(--marquee-speed, 78s) linear infinite;
  will-change: transform;
}

.marquee--down.is-live .marquee__track {
  animation-name: marquee-down;
  --marquee-speed: 96s;
}

@keyframes marquee-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@keyframes marquee-down {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}

.about__body {
  color: var(--ink-70);
  margin-top: 26px;
  margin-bottom: 40px;
}

/* 7.6 Services ==========================================================
   A numbered index: rule, number, name, one line. No photographs, and that
   is the point. The six that used to live here were portrait shots cropped
   hard to landscape, at six different colour temperatures, laid on a strong
   blue. Type holds a flat ground far better than photography does, and the
   page has plenty of pictures either side of this.
   ========================================================================= */

/* Left aligned, and measured in pixels rather than ch: ch here resolves
   against the 15px body size, not the 52px heading inside it, which set the
   title in a 176px ribbon one word wide. */
.section-head--left {
  text-align: left;
  max-width: 620px;
  margin-bottom: clamp(40px, 4.5vw, 64px);
}

.services {
  border-top: 1px solid var(--white-12);
}

.services__row {
  display: grid;
  grid-template-columns: auto minmax(0, 5fr) minmax(0, 6fr);
  align-items: baseline;
  gap: clamp(16px, 2.4vw, 40px);
  padding-block: clamp(16px, 1.8vw, 26px);
  border-bottom: 1px solid var(--white-12);
}

.services__icon {
  display: flex;
  align-self: center;
  color: var(--green);
}

.services__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.services__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.7vw, 24px);
  line-height: 1.25;
  color: var(--white);
  margin: 0;
}

.services__note {
  font-size: 14px;
  line-height: 1.95;
  color: var(--white-75);
  margin: 0;
}

/* 7.7 Testimonials =======================================================
   A centred carousel of cards. Same machinery as any of these: the set is
   cloned either side so it loops, the active card is centred by translating
   the track, and scale and opacity come off the distance from the middle.
   Card width never changes between states, so the arithmetic that positions
   the track holds while the animation runs.

   It also advances on its own, and stops the moment a pointer or the keyboard
   arrives, which is the part people actually notice.
   ========================================================================= */

.tc {
  position: relative;
}

/* The shadow under the centred card reaches 72px below it, and the viewport
   clips because it has to hide the clones either side. So the padding has to
   clear the shadow, or the shadow gets cut off square. */
.tc__viewport {
  padding-block: clamp(16px, 2vw, 30px) clamp(48px, 5.5vw, 92px);
}

.tc.is-live .tc__viewport {
  overflow: hidden;
  mask-image: linear-gradient(90deg,
    rgba(0, 0, 0, 0) 0%, #000 10%, #000 90%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(90deg,
    rgba(0, 0, 0, 0) 0%, #000 10%, #000 90%, rgba(0, 0, 0, 0) 100%);
}

.tc__track {
  position: relative;
  display: flex;
  gap: var(--tc-gap);
  padding-inline: var(--pad-x);
  width: max-content;
  align-items: stretch;
}

.tc.is-live .tc__track {
  padding-inline: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.tc.is-live .tc__track.no-anim,
.tc.is-live .tc__track.no-anim .tc__card {
  transition: none;
}

.tc__card {
  flex: 0 0 var(--tc-w);
  width: var(--tc-w);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: clamp(24px, 2.2vw, 40px);
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid rgba(25, 26, 28, 0.08);
}

.tc.is-live .tc__card {
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1), opacity 0.6s ease,
              box-shadow 0.6s ease;
  transform: scale(0.86);
  opacity: 0.45;
}

.tc.is-live .tc__card.is-active {
  transform: none;
  opacity: 1;
  box-shadow: 0 22px 50px rgba(33, 63, 111, 0.14);
}

.tc__rule {
  width: 34px;
  height: 2px;
  background: var(--green);
  border: 0;
  margin: 0 0 18px;
}

.tc__text {
  font-family: var(--sans);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.62;
  color: var(--navy);
  margin: 0 0 20px;
  flex: 1 1 auto;
  quotes: "\201C" "\201D";
}

.tc__text::before {
  content: open-quote;
}

.tc__text::after {
  content: close-quote;
}

.tc__by {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ink-70);
}

.tc__controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(22px, 2.5vw, 34px);
}

.tc__btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(25, 26, 28, 0.18);
  border-radius: 50%;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.tc__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tc__btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* 8. Footer ============================================================== */

.site-footer {
  background: var(--navy);
  color: var(--white);
  padding-bottom: 54px;
}

.site-footer__divider {
  height: 1px;
  background: var(--white-12);
  border: 0;
  margin: 0 0 46px;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: center;
}

.site-footer__label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--white-60);
  margin-bottom: 14px;
}

.site-footer__phone {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--white);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.site-footer__phone:hover {
  color: var(--green);
}

.site-footer__email {
  font-size: 14px;
  line-height: 1.85;
  color: var(--white-75);
  text-decoration: none;
}

.site-footer__email:hover {
  color: var(--green);
}

.site-footer__right {
  text-align: right;
}

.site-footer__address {
  font-size: 14px;
  line-height: 1.85;
  color: var(--white-75);
  margin-bottom: 16px;
}

.site-footer__social {
  display: flex;
  gap: 22px;
  justify-content: flex-end;
}

.site-footer__social a {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--green);
  text-decoration: none;
}

.site-footer__social a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer__logo {
  width: 190px;
}

.site-footer__copyright {
  margin-top: 70px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1.6px;
  color: var(--white-45);
}

/* 9. Project pages ====================================================== */

.project-hero {
  background: var(--navy);
  color: var(--white);
  padding-bottom: clamp(48px, 6vw, 90px);
}

.project-hero__back {
  margin-bottom: 40px;
}

/* The project's own name sits small above, where the location used to be,
   and the heading underneath says what the work was and where. */
.project-hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.12;
  margin: 0;
  max-width: 900px;
}

.project-hero__meta {
  font-size: 13px;
  letter-spacing: 1.4px;
  color: var(--white-60);
  margin: 0 0 16px;
}

/* Gallery and writing share the top row, and the spec runs as a band across
   the foot of both. The gallery column is the wider of the two because it has
   a rail down its side and a photograph to hold; the writing is three short
   paragraphs and gets worse, not better, with more width.

   minmax(0, ...) on both so a wide film cannot push the grid past the shell. */
.project-body {
  --thumb-w: 64px;
  --thumb-gap: 16px;
  --stage-h: clamp(380px, 42vw, 620px);

  display: grid;
  /* The gallery column is exactly what the gallery needs and not a pixel
     more: the rail, the gap, and a 3:4 shot at full stage height. That is the
     widest thing the stage ever holds, since the films are narrower still at
     9:16. Left as a fraction the column came out wider than the photograph,
     and the leftover sat between the picture and the writing looking like a
     mistake. */
  grid-template-columns:
    calc(var(--thumb-w) + var(--thumb-gap) + var(--stage-h) * 3 / 4)
    minmax(0, 1fr);
  column-gap: clamp(48px, 7vw, 110px);
  align-items: start;
}

/* Held to a readable measure. The column can be wider than the writing wants
   to be, and a 90 character line is hard work whatever it says. */
.project-body > .body {
  max-width: 34em;
}

/* Runs the full width underneath the two columns. Scoped to a direct child
   of the page grid: unscoped, the span followed the spec into the project
   modal, where it sits in a block of its own and came out stretched across
   the whole sheet under the writing. */
.project-body > .project-spec {
  grid-column: 1 / -1;
}

/* 9.1 Project viewer ------------------------------------------------------
   One photograph large, with the rest as a rail of thumbnails down its left
   side. The rail runs vertically because the work does: this library is
   portrait almost end to end, 91 stills at 3:4 and all 16 films at 9:16,
   with three 4:3 stills the only exceptions. A column of thumbnails is the
   shape that matches, and it puts the picker alongside the picture rather
   than under it.

   The stage is sized by HEIGHT and each item takes whatever width it needs,
   which is what lets one frame hold a 3:4 still and a 9:16 film without
   either being cropped. A fixed height means the page does not jump as you
   step between them, and the rail beside it keeps one height all the way
   down.

   The viewer is the default rather than something a script switches on, so
   there is no moment on load where the whole column of photographs appears
   and then collapses. The no-JavaScript case is handled the other way round,
   by a small block in the head of each page that puts the figures back into
   normal flow, so every shot stays reachable without a script. */
.viewer {
  display: grid;
  grid-template-columns: var(--thumb-w) minmax(0, 1fr);
  gap: var(--thumb-gap);
  align-items: start;
}

/* Centred vertically, hard left horizontally: a portrait shot is a good deal
   narrower than the column, and centring it left its edge floating clear of
   the thumbnails and the paragraphs. Aligned left, the whole column has one
   edge. */
.viewer__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  height: var(--stage-h);
  background: var(--stage-bg);
  border-radius: var(--radius);
}

/* Every figure sits in the same cell. Visibility is delayed off the back of
   the fade so the outgoing photograph is still there while it goes. */
.viewer__item {
  grid-area: 1 / 1;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--stage-bg);
  line-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.viewer__item.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s;
}

.viewer__item img,
.viewer__item video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--stage-h);
}

/* The rail. Exactly as tall as the stage beside it, and scrolling inside that
   height, so a project with two dozen shots takes no more room on the page
   than one with four. */
.viewer__thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  height: var(--stage-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(25, 26, 28, 0.25) transparent;
  /* Only bites once the rail actually runs past the bottom, which is its way
     of saying there is more down there. */
  mask-image: linear-gradient(180deg, #000 0%, #000 93%, rgba(0, 0, 0, 0) 100%);
}

.viewer__thumb {
  position: relative;
  flex: 0 0 auto;
  width: var(--thumb-w);
  /* The same shape as the work, so the rail reads as a column of the
     photographs rather than a row of chips. */
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-deep);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.25s ease;
}

.viewer__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewer__thumb:hover,
.viewer__thumb:focus-visible {
  opacity: 1;
}

/* An inset ring rather than an outline: the rail clips its overflow, and an
   outline sitting outside the button would be shaved off down both edges. */
.viewer__thumb.is-active {
  opacity: 1;
  box-shadow: inset 0 0 0 2px var(--navy);
}

/* A film in the strip is shown by its poster frame, so it needs telling
   apart from a photograph. */
.viewer__film {
  position: absolute;
  inset: 0;
  background: rgba(25, 26, 28, 0.32);
}

.viewer__film::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent var(--white);
}

/* The spec as a band across the foot of the page: one rule, columns under
   it. Each pair is wrapped in a div in the markup, so what the grid lays out
   is one column per field. The five-field placeholder version still gets
   five equal columns; a project with real copy carries only Location and
   Work, marked with --compact, which gives Location a narrow natural column
   and lets Work take the rest of the row. */
.project-spec {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 40px);
  margin: clamp(48px, 5.5vw, 88px) 0 0;
  border-top: 1px solid rgba(25, 26, 28, 0.15);
  padding-top: 22px;
}

.project-spec--compact {
  grid-template-columns: minmax(140px, max-content) 1fr;
}

.project-spec dt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2.4px;
  color: var(--green);
  margin-bottom: 6px;
}

/* No trailing margin: each pair is its own column now, so the spacing between
   them is the grid's gap and nothing needs to push down on anything. */
.project-spec dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-70);
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(25, 26, 28, 0.15);
  padding-top: 34px;
}

.project-nav a {
  font-family: var(--accent);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
}

.project-nav a:hover {
  color: var(--green);
}

/* 9.2 Project modal =======================================================
   A project opens over the homepage rather than as a page of its own.

   The photograph is the point here, so it gets the room: the stage is sized
   from the HEIGHT of the window rather than from a column shared with the
   writing, which makes it about a quarter taller than it was on the page and
   a quarter wider with it. The writing and the spec go underneath, where they
   can be read once the picture has been looked at.

   The viewer inside is the same component as the project pages use, so the
   three custom properties it reads are set here too. Everything else it needs
   it brings with it.
   ========================================================================= */

.pm {
  --thumb-w: 64px;
  --thumb-gap: 16px;
  --stage-h: clamp(340px, 70vh, 860px);

  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(0px, 3vh, 40px) clamp(0px, 3vw, 48px);
}

/* display:grid above beats the browser's own [hidden] rule, so a closed modal
   stayed on screen over the page and swallowed every click on the mosaic
   behind it. It has to be said here, after the display. */
.pm[hidden] {
  display: none;
}

.pm__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 48, 0.55);
  backdrop-filter: blur(3px);
}

.pm__sheet {
  /* Takes focus when the modal opens, and shows no ring for it: the outline
     belongs to things you tab to, not to the sheet itself. */
  outline: none;

  position: relative;
  width: min(1320px, 100%);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(13, 20, 34, 0.35);
}

.pm__eyebrow {
  font-family: var(--accent);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 8px;
}

.pm__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.08;
  color: var(--navy);
  margin: 0 0 clamp(20px, 2.2vw, 34px);
}

/* Hangs over the sheet rather than sitting in a bar of its own, and stays
   there while everything under it scrolls: absolute against the sheet, which
   does not move, not against the body, which does. The tinted ground and the
   blur are so it holds up over a photograph as well as over cream. */
.pm__close {
  position: absolute;
  top: clamp(14px, 1.6vw, 24px);
  right: clamp(14px, 1.6vw, 24px);
  z-index: 3;

  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(25, 26, 28, 0.14);
  border-radius: 50%;
  background: rgba(242, 239, 233, 0.82);
  backdrop-filter: blur(6px);
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.pm__close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.pm__close:hover,
.pm__close:focus-visible {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* Photograph on the left, the writing beside it, and the spec as a band
   across the foot of both. The gallery column is sized to what the gallery
   actually needs rather than a share of the sheet, so the picture is never
   made smaller to leave room for three paragraphs. */
.pm__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(32px, 4vw, 72px);

  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(32px, 4vw, 56px);
  align-items: start;
}

/* The title sits with the writing rather than in a bar above everything, so
   the photograph starts at the top of the sheet. */
.pm__text {
  grid-column: 2;
  max-width: 36em;
  /* Dropped a little below the top of the photograph. Set flush with it the
     eyebrow sat exactly level with the first pixel of the picture, which read
     as an accident rather than a decision. */
  padding-top: clamp(14px, 1.8vw, 32px);
}

.pm .viewer {
  grid-column: 1;
  grid-template-columns: var(--thumb-w) auto;
}

/* The widest thing the stage ever holds is a 3:4 still at full height, so
   this is its natural width, and it is what makes the column above `auto`
   resolve to the gallery's real size. */
.pm .viewer__stage {
  width: calc(var(--stage-h) * 3 / 4);
  max-width: 100%;
  justify-items: center;
}

.pm__text .body {
  max-width: 34em;
}

/* Sits in the text column, directly under the writing, rather than as a
   band across the foot of the whole sheet: it reads as part of the same
   piece of writing rather than a separate footer bolted beneath the
   photograph. */
.pm__body > .project-spec {
  grid-column: 2;
  max-width: 36em;
  margin-top: clamp(24px, 3vw, 40px);
  padding-top: 18px;
}

/* 10. Responsive ========================================================= */

@media (max-width: 1100px) {
  /* The photograph stays behind the hero rather than stacking under it, so
     the logo and the headline sit on the image the way they do on desktop. */
  .hero {
    /* Height follows the width the way the 1440 x 900 frame does, rather than
       filling the screen. Copy sits under the header, photograph shows through
       the band beneath it. */
    min-height: min(78vw, 620px);
    align-items: flex-start;
    /* How far down the photograph starts, so it clears the logo instead of
       running under it. It used to be added to the top padding as well, which
       carried the headline down with it; the section takes it at the BOTTOM
       instead, so the picture still is not squeezed into what is left of a
       fixed height and the copy stays up where it belongs. */
    --hero-drop: clamp(104px, 22vw, 170px);

    padding-top: clamp(120px, 19vw, 168px);
    padding-bottom: calc(clamp(110px, 24vw, 180px) + var(--hero-drop));
  }

  .hero__media {
    /* Dropped below the logo rather than starting at the very top of the
       page. Running full height, the drawing went straight under the lockup
       and there was nowhere quiet for it to sit; this opens a band of cream
       above the picture for it to land on. */
    inset: var(--hero-drop) 0 0 0;
    width: 100%;
    /* The block is sized by the four offsets here, so the desktop rule's
       shape has to be cleared or it fights them. aspect-ratio especially:
       left in place it would try to derive a height from the full width and
       hang the block out of the bottom of a much shorter hero. */
    height: auto;
    aspect-ratio: auto;
    /* Full width here, and cropped to the middle of the drawing by the
       object-position below, so the artwork's hard left edge is not in frame
       and there is nothing to dissolve. The vertical feather does the work at
       this size; a horizontal fade on top of it only milked the whole thing. */
    mask-image: none;
    -webkit-mask-image: none;
  }


  /* Here the block is wide and short, so the artwork is cropped to a band
     across its middle and the copy has to sit on top of it. Enough cream to
     hold the headline, and it lets go by two thirds down.

     The last stops bring it back. At this size the crop is a straight cut
     through the stools and the cabinet run, and the same hard line the
     desktop hero was fixed for, so the bottom inch dissolves into the page
     rather than ending square. It stays clear until 86% so the island and the
     stools, which are the whole picture on a narrow screen, are untouched. */
  .hero__feather {
    background: linear-gradient(
      180deg,
      var(--cream) 0%,
      rgba(242, 239, 233, 0.88) 38%,
      rgba(242, 239, 233, 0.45) 62%,
      rgba(242, 239, 233, 0) 80%,
      rgba(242, 239, 233, 0) 86%,
      var(--cream) 100%
    );
  }

  /* Hold the crop right of centre: that is where the drawing becomes a
     render, and it is the half worth seeing on a phone. */
  .hero__media img {
    object-position: 72% 50%;
  }

  .hero__copy {
    max-width: 640px;
    padding-top: 0;
  }

  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Copy takes the full width and the two drifting columns sit beneath it. */
  .about {
    grid-template-columns: 1fr;
  }

  .about__copy,
  .about__gallery {
    grid-column: 1;
  }

  /* Stacked, the strip keeps its own height and still runs to the bottom
     edge of the section. */
  .about__copy {
    padding-block: var(--section-y) clamp(44px, 6vw, 76px);
  }

  /* Height takes over from the desktop min-height, which would otherwise win
     and leave a very tall strip on a narrow screen. */
  /* Height takes over from the desktop min-height, which would otherwise win
     and leave a very tall strip on a narrow screen, and the strip comes back
     inside the margins now that it is full width anyway. */
  .about__gallery {
    min-height: 0;
    height: clamp(420px, 76vw, 620px);
    margin-right: 0;
  }

  /* One column: gallery, then the writing, then the spec, in that order down
     the page. The writing loses its measure cap because the column is already
     narrower than the cap was. */
  .project-body {
    --stage-h: min(133vw, 693px);

    grid-template-columns: minmax(0, 1fr);
  }

  .project-body > .body {
    max-width: none;
    margin-top: clamp(36px, 5vw, 56px);
  }

  /* Three across rather than five: five columns of Year and Timber on a
     tablet leaves each one too narrow to hold its own words. */
  .project-spec {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 3vw, 32px);
    margin-top: clamp(44px, 6vw, 72px);
  }

  /* The column is the full width of the screen here, and a portrait shot
     sized to a share of that is a stamp adrift in the middle of it. So the
     stage is given a measure of its own and a height of four thirds of it,
     which is the shape of nine shots in ten: the photograph fills the frame
     rather than floating in it. vw rather than vh, because the address bar
     on a phone moves vh around under you. */
  /* No room for a rail beside the photograph once the page is one column, so
     it lies back down underneath it. The stage is first in the DOM order the
     other way round, so both are placed explicitly here. */
  .viewer {
    grid-template-columns: minmax(0, 1fr);
  }

  .viewer__stage {
    order: 1;
    max-width: min(100%, 520px);
  }

  .viewer__thumbs {
    order: 2;
    flex-direction: row;
    height: auto;
    margin-top: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    mask-image: linear-gradient(90deg, #000 0%, #000 94%, rgba(0, 0, 0, 0) 100%);
  }

}

@media (max-width: 700px) {
  .project-body {
    --thumb-w: 54px;
  }

  .project-spec {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The sheet takes the whole screen. A centred card with a margin around it
     is a desktop idea; on a phone it wastes the only screen there is. */
  .pm {
    --thumb-w: 54px;
    --stage-h: min(112vw, 560px);

    padding: 0;
  }

  .pm__sheet {
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }

  /* One column: photograph, then the writing, then the spec. */
  .pm__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm__text {
    grid-column: 1;
    max-width: none;
    margin-top: clamp(26px, 5vw, 42px);
  }

  .pm__body > .project-spec {
    grid-column: 1;
    max-width: none;
  }

  /* Rail underneath again, and the photograph takes the width it is given
     rather than a share of it. */
  .pm .viewer {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm .viewer__stage {
    width: auto;
    order: 1;
  }

  .pm__body > .project-spec {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 18px;
  }

  /* Let the headline find its own line breaks on a narrow screen */
  .display br {
    display: none;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .about__gallery {
    height: 96vw;
  }

  /* Number and name on one line, the note under the name. */
  .services__row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 16px;
    align-items: baseline;
  }

  .services__note {
    grid-column: 2;
  }

  /* The marks go above and below rather than either side. */
  .quote {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .quote__mark--close {
    justify-self: end;
  }

  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .site-footer__right {
    text-align: center;
  }

  .site-footer__social {
    justify-content: center;
  }

  .site-footer__logo {
    margin-inline: auto;
  }

  .site-footer__copyright {
    margin-top: 46px;
  }

  .project-nav {
    flex-direction: column;
    gap: 14px;
  }
}

/* 11. Motion ============================================================= */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Mosaic tiles come up from below and fade into place. Further than anything
   else on the page travels, and slower, because a tile is a big object and a
   short hop would read as a twitch. Nothing else moves: no scale, so what you
   see is the picture arriving at its cell. */
.tile.reveal {
  transform: translateY(64px);
  transition-duration: 1s;
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Three classes, and it has to be. .reveal.is-in is two, and so is
   .tile.reveal, which is declared later and was therefore winning even once
   the tile had arrived: the grid sat 64px low for good and only the opacity
   ever moved. */
.tile.reveal.is-in {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* No drift, no sliding cards. The columns and the carousel simply sit. */
  .marquee.is-live .marquee__track,
  .marquee--down.is-live .marquee__track {
    animation: none;
  }

  .tc.is-live .tc__track,
  .tc.is-live .tc__card {
    transition: none;
  }

  /* The gallery still changes photograph, it just does it at once. */
  .viewer__item {
    transition: none;
  }

  .viewer__thumbs {
    scroll-behavior: auto;
  }
}

/* 12. Project covers ======================================================
   The cover is whatever the photographer tagged -cover. A video cover shows
   its first frame at rest and plays, muted, while the card is hovered.
   ========================================================================= */

.cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 416 / 340;
  background: var(--white-10);
}

.cover__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.work-card:hover .cover__media,
.work-card:focus-visible .cover__media {
  transform: scale(1.03);
}

.cover__badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 5px 9px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--white);
  background: rgba(13, 13, 13, 0.55);
  backdrop-filter: blur(3px);
  transition: opacity 0.3s ease;
}

.work-card:hover .cover__badge {
  opacity: 0;
}

/* 13. Project mosaic ======================================================
   Four columns of square cells. Dense auto flow lets the big tile sit in the
   middle of a block while the small ones pack around it. Labels sit on the
   photograph over a scrim, so the images carry the section.

     tile--big     2 col  2 row      the projects with film in them
     tile--wide    2 col  1 row
     tile--tall    1 col  2 row
     (none)        1 col  1 row

   Row height is set here rather than by the tiles. A row used to take its
   height from whichever square tile happened to land in it, which meant a row
   of nothing but big tiles collapsed to zero. Now the row is exactly one
   column tall, worked out from the container's own width, so the grid holds
   its shape whatever lands in it. A grid cannot query itself, which is what
   .mosaic-wrap is for, and the first grid-auto-rows line is the fallback for
   browsers without container query units.
   ========================================================================= */

.mosaic-wrap {
  container-type: inline-size;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: row dense;
  gap: var(--gutter);
  grid-auto-rows: 240px;
  grid-auto-rows: calc((100cqw - var(--gutter) * 3) / 4);
}

/* A link to the project page that main.js turns into a modal opener. The
   first six lines are a reset left from when it was a button; they are
   harmless on a link and keep the tile identical if it ever goes back. */
.tile {
  width: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  text-align: inherit;
  cursor: pointer;

  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--cream-deep);
  text-decoration: none;
  color: var(--white);
}

.tile--big {
  grid-column: span 2;
  grid-row: span 2;
}

.tile--wide {
  grid-column: span 2;
}

.tile--tall {
  grid-row: span 2;
}

.tile__media {
  position: absolute;
  inset: 0;
}

.tile .cover__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.tile:hover .cover__media,
.tile:focus-visible .cover__media {
  transform: scale(1.04);
}

/* Scrim. Dark enough for white Cinzel to hold on a bright kitchen shot. */
.tile__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 13, 13, 0) 28%,
    rgba(13, 13, 13, 0.28) 52%,
    rgba(13, 13, 13, 0.62) 74%,
    rgba(13, 13, 13, 0.86) 100%
  );
  transition: opacity 0.4s ease;
}

.tile:hover .tile__media::after {
  opacity: 0.88;
}

.tile__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(18px, 2vw, 30px);
  padding-bottom: clamp(10px, 1vw, 14px);
}

.tile__eyebrow {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 16px);
  letter-spacing: 1.8px;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  text-shadow: 0 1px 10px rgba(13, 13, 13, 0.8);
}

.tile__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.9vw, 30px);
  line-height: 1.18;
  color: var(--white);
  text-shadow: 0 1px 16px rgba(13, 13, 13, 0.7);
}

.tile--big .tile__title {
  font-size: clamp(24px, 2.6vw, 40px);
}

@media (max-width: 1100px) {
  .mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
    grid-auto-rows: calc((100cqw - var(--gutter)) / 2);
  }

  /* Two columns by two rows is the whole screen here, so a big tile becomes a
     full width band one row deep instead. Note the films are portrait 9:16,
     not landscape: a band crops them hard through the middle, which is worth
     a look if the mosaic ever gets revisited. */
  .tile--big,
  .tile--wide {
    grid-column: span 2;
    grid-row: span 1;
  }

  .tile--tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 700px) {
  /* On a phone the mosaic stops being a mosaic and becomes a swipe.

     Stacked in one column, nine projects were a very long scroll and each one
     was cropped to a 4:3 letterbox, which throws away most of a portrait
     photograph and all of a 9:16 film. As a row of upright cards the crop
     matches what was shot, the whole set is a thumb's reach away, and the
     section takes one screen instead of nine.

     Scroll snapping does all of it. No script, no buttons, and it is the
     gesture the phone already has. */
  .mosaic {
    display: flex;
    grid-template-columns: none;
    grid-auto-rows: auto;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    /* Out past the shell's padding so the strip runs edge to edge, then the
       same amount back as the scroller's own padding, so the first and last
       cards still line up with everything else on the page. */
    margin-inline: calc(var(--pad-x) * -1);
    padding-inline: var(--pad-x);
    scroll-padding-inline: var(--pad-x);
    /* The peeking card is the only affordance needed; a scrollbar under it on
       a touch screen is just a line. */
    scrollbar-width: none;
  }

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

  /* Every tile is the same upright card here. The mosaic's big/wide/tall
     sizes are a desktop idea and have nothing to sit in once the grid is
     gone. */
  .tile,
  .tile--big,
  .tile--wide,
  .tile--tall {
    grid-column: auto;
    grid-row: auto;
    flex: 0 0 78%;
    aspect-ratio: 3 / 4;
    scroll-snap-align: start;
  }

  /* No arrival animation on the carousel. The reveal is tied to coming into
     view, and in a horizontal scroller that means every card you swipe to
     fades up from below as it lands, which reads as the page struggling
     rather than as motion. */
  .tile.reveal,
  .tile.reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-rule {
  border: none;
  border-top: 1px solid rgba(25, 26, 28, 0.15);
  margin: 20px 0 24px;
}
