/*
Theme Name: Andstones FSE
Theme URI: https://andstones.ca
Author: Sticks & Stones Creative
Description: Full site editing theme for Sticks & Stones Creative. Front page powered by a scroll-driven Three.js / GSAP canvas animation built with Vite.
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Version: 0.1.0
License: Proprietary
Text Domain: andstones-fse
*/

/* ── Page gutter ──────────────────────────────────────────────────────────
   The side margin of full-width media and page bands. From tablets up it's
   exactly the width of the corner box the & logo sits in (#logo-home-link,
   src/css/style.css: 58px + its 2px rule), so nothing scrolls under the logo;
   on phones, where there's no box, it narrows with the screen. */
:root {
  --page-gutter: clamp(1.5rem, 4vw, 60px);
}
@media (min-width: 769px) {
  :root { --page-gutter: 60px; }
}

/* ── Header navigation ─────────────────────────────────────────────────── */

header.wp-block-template-part > .wp-block-group {
  padding: 1.25rem 1.5rem;
}

/* "MENU +" open button. The padding (cancelled by the margin) is the tap
   area: the word alone was 39 × 10, under WCAG's 24px minimum. */
.wp-block-navigation__responsive-container-open {
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  margin: -12px;
  line-height: 1;
  transition: opacity 0.3s, visibility 0s;
}
/* Gone while the cube spins between home and an inner page (src/js/main.js):
   a page change can't start mid-spin, so its menu links would do nothing. */
.is-cube-spinning .wp-block-navigation__responsive-container-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0s 0.2s;
}

.wp-block-navigation__responsive-container-open svg {
  display: none;
}

.wp-block-navigation__responsive-container-open::after {
  content: 'MENU';
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.wp-block-navigation__responsive-container-open:hover::after {
  color: #fff;
}

/* Mobile: the MENU / CLOSE wordmarks become a hamburger / X icon. */
@media (max-width: 768px) {
  .wp-block-navigation__responsive-container-open {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0; /* the 44px box is the tap area here */
    margin: 0;
  }
  /* Hamburger: the ::after bar plus two box-shadow bars (3 lines). */
  .wp-block-navigation__responsive-container-open::after {
    content: '';
    width: 28px;
    height: 2px;
    letter-spacing: 0;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 -8px 0 rgba(255, 255, 255, 0.85), 0 8px 0 rgba(255, 255, 255, 0.85);
  }
  .wp-block-navigation__responsive-container-open:hover::after {
    background: #fff;
    box-shadow: 0 -8px 0 #fff, 0 8px 0 #fff;
  }
  /* Figma "Mobile home": the hamburger's 36px box 16px in from the corner */
  header.wp-block-template-part > .wp-block-group { padding: 12px; }
  /* WP-native overlay fallback: show its X icon instead of the CLOSE word. */
  .wp-block-navigation-overlay-close::after { content: none; }
  .wp-block-navigation-overlay-close svg { display: block; }
}

/* ── Navigation overlay (WP-native fallback; the JS cube menu is the live UI,
   but this keeps the no-JS / editor render in line with the same design) ─── */

.nav-overlay {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 36px;
  box-sizing: border-box;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Header: centred logo (site logo is black → invert to white) with CLOSE right */
.nav-overlay__bar {
  position: relative;
  align-items: center;
  min-height: 45px;
  margin-bottom: 2.75rem;
}
.nav-overlay__bar .wp-block-site-logo img { filter: invert(1); }

/* "CLOSE" close button */
.wp-block-navigation-overlay-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.wp-block-navigation-overlay-close svg {
  display: none;
}

.wp-block-navigation-overlay-close::after {
  content: 'CLOSE';
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #d9d9d9;
}

.wp-block-navigation-overlay-close:hover::after {
  color: #fff;
}

/* Overlay nav links — 60px uppercase items with full-width hairline rules */
.nav-overlay .wp-block-navigation__container {
  flex-direction: column !important;
  gap: 0 !important;
  align-items: stretch !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.nav-overlay .wp-block-navigation-item__content {
  display: block;
  font-family: inherit;
  font-size: clamp(2rem, 5.2vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none !important;
  padding: 0.55em 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  transition: padding-left 0.2s;
}

.nav-overlay .wp-block-navigation-item__content:hover {
  padding-left: 0.5rem;
}

/* Footer — address (left) · copyright (centre) · socials (right) */
.nav-overlay__foot {
  margin-top: auto;
  padding-top: 2rem;
  font-weight: 300;
  font-size: 12px;
  line-height: 16px;
  color: #fff;
}
.nav-overlay__foot p { margin: 0; }
.nav-overlay__foot a { color: inherit; text-decoration: none; }
.nav-overlay__foot a:hover { text-decoration: underline; }
.nav-overlay__copy { letter-spacing: 0.1em; text-transform: uppercase; }

/* ── Non-home pages: override the animation canvas black ──────────────── */
/* The Vite bundle sets html,body { background: #000 } for the front-page
   animation. Inner pages use the design system's off-black charcoal. */
body:not(.home) {
  background-color: var(--wp--preset--color--black);
}

/* ── Single project ───────────────────────────────────────────────────── */

/* Hero: title + client (left) and an optional excerpt (right), sitting above a
   near-full-width feature image with rounded corners and a clean cut (no
   gradient overlay, no text overlaid on the image). */
.project-hero {
  background: #000;
  padding: 8rem var(--page-gutter) 0;   /* top clears the fixed header; sides = outer media gutter */
}

/* Dev-notes grid: media sits at the outer edge; the title, meta row and excerpt
   are indented 20px from that edge (and 20px is the column gutter). */
.project-hero .wp-block-post-title,
.project-hero__head {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.project-hero .wp-block-post-title {
  margin-bottom: 1.75rem;
}
.project-hero__head {
  margin-bottom: 2.5rem;
  gap: 20px;
}

/* Optional excerpt, top-right */
.project-hero__excerpt {
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.125rem;      /* 18px */
  line-height: 1.55;        /* ~28px */
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}
.project-hero__excerpt a { color: inherit; }

/* Feature image: near full-width, rounded, clean-edged */
.project-hero__media {
  max-width: 1400px;
  margin: 0 auto;
}
.project-hero__media img,
.project-hero__media video {
  width: 100%;
  aspect-ratio: 5 / 2;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}
/* A video hero lies over the featured image and fades in once it's really
   playing (src/js/hero-video.js) — never a blank or undecoded frame. */
.project-hero__media.has-hero-video {
  position: relative;
}
.project-hero__media.has-hero-video video {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.project-hero__media.has-hero-video video.is-live {
  opacity: 1;
}

/* Case-study split: the blurb as a long heading (left) beside The Challenge /
   Insight / Idea stacked (right). Full-bleed so it can sit on the hero grid —
   same outer gutter, 1400px measure, 20px inset and gutter — which lines its
   columns up with the meta row and excerpt above. */
.project-split.alignfull {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
.project-split > .wp-block-columns {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.project-split .is-style-long-heading {
  max-width: 32rem;          /* ~516px measure, as in the design */
  margin: 0;
}
/* Labels in the split bands are the Figma "H3 Case Studies Title": 18/20 bold
   uppercase white, 0.1em. */
.project-split .is-style-section-label {
  font-size: 18px;
  line-height: 20px;
  letter-spacing: 0.1em;
  color: #fff;
}
/* Stacked sections: label → copy 10px, copy → copy 1rem, section → section 3rem */
.project-split .wp-block-column > * {
  margin-top: 0;
  margin-bottom: 0;
}
.project-split .wp-block-column > * + * {
  margin-top: 1rem;
}
.project-split .wp-block-column > .is-style-section-label + * {
  margin-top: 10px;
}
.project-split .wp-block-column > * + .is-style-section-label {
  margin-top: 3rem;
}

/* Lists in case-study copy: the bundle's global reset (*, ::before, ::after
   { margin: 0; padding: 0 }) leaves bullets hanging outside the text column.
   Put the indent back, with a little air between items. */
.single-project .wp-block-post-content .wp-block-list {
  padding-left: 1.5em;
}
.single-project .wp-block-post-content .wp-block-list li + li {
  margin-top: 0.5em;
}
.single-project .wp-block-post-content .wp-block-list .wp-block-list {
  margin-top: 0.5em;
}

/* Key Features (web case studies): each feature a bold lead-in over body
   copy, 36px apart (Figma: "Case study - web specific"). */
.project-split .wp-block-column > .project-feature + .project-feature {
  margin-top: 36px;
}

/* Full-width media band (web case studies): screens at the hero image's width
   — same outer gutter and 1400px measure — 36px apart. */
.project-media.alignfull {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
.project-media > * {
  max-width: 1400px;
  margin: 0 auto;
}
.project-media > * + * {
  margin-top: 36px;
}
/* Phones: media after media sits closer. The editor spaces media sections
   6rem apart (the block's own margin), which reads as a section break beside
   desktop's side-by-side layouts; stacked in one column it reads as a hole —
   24px between a pair of images, then 96px to the gallery. Here a 6rem gap
   between two pieces of media becomes 48px: 24px within a group (1.5rem,
   untouched), 48px between groups, 6rem still around the text sections.
   Media: a gallery (and its ← count → bar), an image, an embed or video, or a
   group or columns holding images and no text.
   Only the lower block is set, since "the block before is media" would need a
   :has() inside :has(), which CSS doesn't allow. Their margins collapse into
   one gap: a 6rem margin above meets -48px here, leaving 48px. */
@media (max-width: 781px) {
  .single-project .wp-block-post-content > :is(:is(.wp-block-gallery, .project-media, .wp-block-image, .wp-block-embed, .wp-block-video, :is(.wp-block-group, .wp-block-columns):has(img, video, iframe):not(:has(p, h1, h2, h3, h4, li))), .carousel-nav) + :is(.wp-block-gallery, .project-media, .wp-block-image, .wp-block-embed, .wp-block-video, :is(.wp-block-group, .wp-block-columns):has(img, video, iframe):not(:has(p, h1, h2, h3, h4, li)))[style*="margin-top:6rem"] {
    margin-top: 48px !important;
  }
  .single-project .wp-block-post-content > :is(:is(.wp-block-gallery, .project-media, .wp-block-image, .wp-block-embed, .wp-block-video, :is(.wp-block-group, .wp-block-columns):has(img, video, iframe):not(:has(p, h1, h2, h3, h4, li)))[style*="margin-bottom:6rem"], .carousel-nav) + :is(.wp-block-gallery, .project-media, .wp-block-image, .wp-block-embed, .wp-block-video, :is(.wp-block-group, .wp-block-columns):has(img, video, iframe):not(:has(p, h1, h2, h3, h4, li))) {
    margin-top: -48px !important;
  }
}
.project-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Narrow centred band (The Impact, a client testimonial): an 874px column in
   the middle of the page, labelled like the split bands (Figma: CPLEA). */
.project-narrow .is-style-section-label {
  font-size: 18px;
  line-height: 20px;
  letter-spacing: 0.1em;
  color: #fff;
}
.project-narrow > * {
  margin-top: 0;
  margin-bottom: 0;
}
.project-narrow > * + * {
  margin-top: 1rem;
}
.project-narrow > .is-style-section-label + * {
  margin-top: 10px;
}
.project-narrow > * + .wp-block-quote {
  margin-top: 50px;
}

/* Quote, "Testimonial" style (styles/testimonial.json): the client's words in
   Libre Caslon behind a 2px red rule, then the name in small caps. */
.wp-block-quote.is-style-testimonial {
  border-left: 2px solid var(--wp--preset--color--red);
  padding-left: 46px;
  margin-left: 0;
  margin-right: 0;
}
.wp-block-quote.is-style-testimonial > p + p {
  margin-top: 28px;
}
.wp-block-quote.is-style-testimonial cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--wp--preset--font-family--aktiv-grotesk);
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}
.wp-block-quote.is-style-testimonial cite::before {
  content: "\2014\00a0";
}
@media (max-width: 781px) {
  .wp-block-quote.is-style-testimonial {
    padding-left: 24px;
  }
}

/* The laurel's animation (src/js/award-mark.js), over its still. The canvas
   is the animation's 500px stage; the finished mark sits on it at (63, 99),
   370 wide, so the canvas is 500/370 of the image's width, set 63/370 of it
   left and 99/370 of it up (margins: their % is of the width). */
.award-mark {
  position: relative;
  display: inline-block;
  flex: none;
  line-height: 0;
  vertical-align: top;
}
.award-mark__anim {
  position: absolute;
  top: 0;
  left: -17.027%;
  width: 135.135%;
  aspect-ratio: 1;
  margin-top: -26.757%;
  pointer-events: none;
  opacity: 0;
}
.award-mark.is-ready > img { visibility: hidden; }
.award-mark.is-ready > .award-mark__anim { opacity: 1; }

/* Gallery, "Carousel" style (styles/carousel.json, src/js/gallery-carousel.js):
   one row of images that scrolls sideways and snaps image by image, full
   width but starting at the page gutter, the next image peeking in at the
   right. 3:2, rounded like the other case-study media; ← count → beneath. */
.wp-block-gallery.is-style-carousel.has-nested-images {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--page-gutter);
  padding-inline: var(--page-gutter);
  scrollbar-width: none;
  cursor: grab;
}
.wp-block-gallery.is-style-carousel::-webkit-scrollbar { display: none; }
.wp-block-gallery.is-style-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.wp-block-gallery.is-style-carousel:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.wp-block-gallery.is-style-carousel.has-nested-images figure.wp-block-image {
  flex: 0 0 min(72vw, 960px);
  width: auto;
  margin: 0;
  scroll-snap-align: start;
}
.wp-block-gallery.is-style-carousel.has-nested-images figure.wp-block-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 5px;
  -webkit-user-drag: none;
  user-select: none;
}
/* The controls sit right under the strip, and take over its bottom margin
   (the block's, set inline — hence !important). */
.wp-block-gallery.is-style-carousel:has(+ .carousel-nav) { margin-bottom: 0 !important; }
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 1400px;
  margin: 16px auto 6rem;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: #a0a0a0;
}
.carousel-nav button {
  padding: 8px 12px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.carousel-nav button:disabled { opacity: 0.3; cursor: default; }
.carousel-nav button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (max-width: 781px) {
  .wp-block-gallery.is-style-carousel.has-nested-images { gap: 12px; }
  .wp-block-gallery.is-style-carousel.has-nested-images figure.wp-block-image { flex-basis: 84vw; }
}

/* Recognition band (patterns/case-study-recognition.php) — at the top of a
   case study, under the hero: the project-split grid, then a 2px #6B6B6B rule
   across the full content width, 100px below See More (the band's bottom
   margin gives the 100px under it). */
.project-recognition .project-recognition__mark {
  margin-top: 1rem;
}
.project-recognition > .project-recognition__rule {
  max-width: none;
  height: 0;
  margin: 100px 0 0;
  border: 0;
  border-top: 2px solid #6b6b6b;
  background: none;
  opacity: 1;
}

/* About / metadata block — meta only (Client / Category / Services) */
.project-about {
  background: transparent;
  padding: 0;
}
.project-about__inner {
  margin: 0;
}

/* On the hero's 12-column grid: Client in columns 1–3, Category from column 4
   (the excerpt beside them starts at column 7). The meta row is the left half
   of .project-hero__head, so halving it lands on column 4 at any width:
   (W − 60) / 4 from the title's edge, W being the 1400px-max head. Services,
   when a project has them, go under Category. */
.project-about__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: dense;
  gap: 1.5rem 0;
  margin: 0;
}
.project-about__meta-item { padding-right: 20px; }
.project-about__meta-item:nth-child(n + 3) { grid-column: 2; }

.project-about__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-about__meta-item dt {
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6); /* ≥ 4.5:1 on black at this size (was 0.4: 3.65:1) */
  margin: 0;
}

.project-about__meta-item dd {
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  letter-spacing: 0.01em;
}

/* All project media carry a 5px rounded corner (dev notes) */
.single-project .wp-block-image img,
.single-project .wp-block-video video,
.single-project .wp-block-embed iframe,
.single-project .wp-block-cover {
  border-radius: 5px;
}
.single-project .wp-block-cover { overflow: hidden; }
.project-next-up__thumb {
  border-radius: 5px;
  overflow: hidden;
}

/* The body's text and inset images keep the page gutter from the screen's
   edges (on phones they'd otherwise touch them); full-width bands reach the
   edges and set their own gutter. */
.single-project .wp-block-post-content {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
.single-project .wp-block-post-content > .alignfull {
  margin-left: calc(-1 * var(--page-gutter));
  margin-right: calc(-1 * var(--page-gutter));
}

/* Project body intro — the opening summary on older case studies. Reads as
   body copy, laid out like the newer case studies' labelled sections
   (patterns/case-study-section.php): an 800px measure, 6rem above and below. */
.single-project .project-intro {
  margin-top: 6rem;
  margin-bottom: 6rem;
}
.single-project .project-intro.is-layout-constrained > * {
  max-width: 800px;
}

/* Big-bold style: large bold intro paragraph on a dark background */
.wp-block-group.is-style-big-bold {
  padding: 3.75rem 1.5rem;
}

.wp-block-group.is-style-big-bold p {
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 44ch;
  margin: 0 auto;
}

@media (min-width: 64em) {
  .wp-block-group.is-style-big-bold {
    padding-top: 7.5rem;
    padding-bottom: 7.5rem;
  }
  .wp-block-group.is-style-big-bold p {
    font-size: 2.375rem;
    letter-spacing: 0.6px;
    line-height: 1.5;
  }
}

/* ── Team archive ──────────────────────────────────────────────────────── */
.team-archive {
  padding: 4rem 2rem;
  background: #000;
  min-height: 100vh;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 1100px) {
  .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Team card (blocks/staff/grid, src/js/team.js). The portrait is a button
   that opens the card to 2 × 2. Open, its foot shows the name and role, and
   Read Bio turns the card over (Figma "TEAM - expanded team member with
   button") to the bio on its back. */
.team-card {
  position: relative;
  aspect-ratio: 1 / 1;
}
.team-card.is-expanded {
  grid-row: span 2;
  z-index: 1; /* above its neighbours while it turns */
}
/* The 3D only exists while the card is turned or turning (.is-3d, team.js).
   A card at rest is flat: mobile browsers could lose a resting front face to
   backface culling after it was resized, leaving a black hole in the grid. */
.team-card.is-3d {
  perspective: 1800px;
}
.team-card__flip {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: transform 0.7s cubic-bezier(0.45, 0, 0.2, 1);
}
.team-card.is-3d .team-card__flip {
  transform-style: preserve-3d;
}
.team-card.is-flipped .team-card__flip {
  transform: rotateY(180deg);
}
.team-card__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: #111;
}
.team-card.is-3d .team-card__face {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.team-card__back {
  transform: rotateY(180deg);
  visibility: hidden;
}
.team-card.is-3d .team-card__back {
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .team-card__flip { transition: none; }
}

/* The portrait: a full-card button */
.team-card__open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.team-card__open:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.team-card__media {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}
.team-card__still,
.team-card__moving {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}
.team-card__moving {
  opacity: 0;
}
/* A moving image swaps in under a mouse only: on a phone, a finger resting
   on a card while the page scrolls counts as :hover (and can stay that way
   after a tap), which hid the portrait and left a blank. */
@media (hover: hover) and (pointer: fine) {
  .team-card:not(.is-expanded) .team-card__media[data-moving]:hover .team-card__moving {
    opacity: 1;
  }
  .team-card:not(.is-expanded) .team-card__media[data-moving]:hover .team-card__still {
    opacity: 0;
  }
}
/* The wiggle (src/js/wiggle.js) hides the portrait only once its canvas has
   drawn a frame over it — not before, while the frames load. */
.team-card__media.is-wiggling .team-card__still {
  opacity: 0;
}

/* Open front: name and role over a black fade at the foot, Read Bio at the
   right (Figma: 24/28 black caps, a 12px role, a 14px bold link with the red
   arrow). Shown by team.js once the card has grown. */
.team-card__caption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  column-gap: 1rem;
  padding: 4.5rem 16px 16px 24px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), #000 86%);
  color: #fff;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.team-card.is-expanded .team-card__caption { visibility: visible; }
.team-card__caption > * { margin: 0; }
.team-card__caption-name {
  grid-column: 1;
  font-size: 24px;
  font-weight: 900;
  line-height: 28px;
  text-transform: uppercase;
}
.team-card__caption-role {
  grid-column: 1;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.team-card__read,
.team-card__unflip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #fff;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 24px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}
.team-card__read {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
}
.team-card__read svg,
.team-card__unflip svg { color: #e33010; transition: transform 0.25s ease; }
.team-card__read:hover svg { transform: translateX(3px); }
.team-card__unflip:hover svg { transform: translateX(-3px); }
.team-card__read:focus-visible,
.team-card__unflip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Back: the bio on black inside a 1px #6B6B6B rule (Figma: 32px in, the name
   36/42, the role in 12px grey caps, the bio 16/24). A long bio scrolls. */
.team-card__back {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.3vw, 32px);
  background: #000;
  border: 1px solid #6b6b6b;
  color: #fff;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}
/* Focus moves here when the card turns, for screen readers; the Back button
   keeps its own ring. */
.team-card__back:focus { outline: none; }
.team-card__back-name {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 500;
  line-height: 1.17;
  color: #fff;
}
.team-card__back-role {
  margin: 12px 0 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #a0a0a0;
}
.team-card__back-bio {
  flex: 1;
  min-height: 0;
  margin-top: clamp(20px, 3vw, 42px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6b6b6b transparent;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.5;
}
.team-card__back-bio p { margin: 0; }
.team-card__back-bio p + p { margin-top: 1em; }
.team-card__unflip {
  align-self: flex-end;
  margin-top: 12px;
}

/* ── Portfolio archive ─────────────────────────────────────────────────── */
.portfolio-archive {
  padding: 7rem 2rem 5rem;
  background: #000;
  min-height: 100vh;
}

.portfolio-archive__header {
  max-width: 1400px;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: baseline;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.portfolio-archive__heading {
  font-family: 'Libre Caslon Text', serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #fff;
  margin: 0;
  line-height: 1;
}

.portfolio-filter {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.portfolio-filter__btn {
  background: none;
  border: none;
  /* A 24px+ tap area round 11px of text; the margin keeps the layout. */
  padding: 7px 0;
  margin: -7px 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6); /* ≥ 4.5:1 on black (was 0.3: 2.5:1) */
  cursor: pointer;
  transition: color 0.2s;
}

.portfolio-filter__btn:hover,
.portfolio-filter__btn.is-active {
  color: #fff;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: 1400px;
  margin: 0 auto;
  background: #111;
}

@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}

.portfolio-card {
  display: block;
  text-decoration: none;
  background: #000;
  overflow: hidden;
}

.portfolio-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0d0d0d;
}

.portfolio-card__img,
.portfolio-card__placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0, 0, 1);
}

.portfolio-card__placeholder {
  background: #0d0d0d;
}

.portfolio-card:hover .portfolio-card__img {
  transform: scale(1.04);
}

.portfolio-card__meta {
  padding: 0.75rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.portfolio-card__client {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  display: block;
}

.portfolio-card__title {
  font-family: 'Libre Caslon Text', serif;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02em;
  line-height: 1.3;
  display: block;
  transition: color 0.2s;
}

.portfolio-card:hover .portfolio-card__title {
  color: #fff;
}

/* ── About page ────────────────────────────────────────────────────────────── */

/* Motion reel: a Vimeo background player cropped to the design's 1320×670 frame.
   The 16:9 player is sized to the frame's width and centred, so the overflow
   trims top and bottom. Decorative — no controls, no pointer. */
.about-reel {
  position: relative;
  aspect-ratio: 1320 / 670;
  overflow: hidden;
  border-radius: 5px;
  background: #111;
}
.about-reel iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* Phones (Figma "Mobile menu" inner page): a 16px gutter, like the header and
   menu, and the reel as a portrait crop. The pages set their gutter in content
   (clamp(1.5rem, …)), hence !important. */
@media (max-width: 600px) {
  .about-page,
  .awards-page {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .about-reel { aspect-ratio: 398 / 520; }
  .about-reel iframe {
    width: auto;
    height: 100%;
  }
}

/* ── Contact (templates/page-contact.html; Figma "Contact") ─────────────────
   One screen: the About reel playing behind a 75% black scrim, the page's own
   copy as a 40/48 lead, and the contact details along the bottom with the
   wordmark at the right. The details stand in for the site footer here. */
.contact-page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  padding: max(8rem, 27.8vh) 60px 59px; /* lead at y 231 of 830 */
  color: #fff;
  overflow: hidden;
}
.contact-page__reel {
  position: absolute;
  inset: 0;
  container-type: size;
  overflow: hidden;
  background: #000;
  pointer-events: none;
}
.contact-page__reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
/* 16:9, covering the screen whatever its shape */
.contact-page__reel iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%);
  border: 0;
}
.contact-page__lead,
.contact-page__foot {
  position: relative;
}
.contact-page__lead p,
.contact-page__lead h1 {
  max-width: 650px;
  margin: 0;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 500;
  line-height: 1.2;
}
.contact-page__foot {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem 100px;
  margin-top: auto;
  padding-top: 4rem;
  font-family: aktiv-grotesk, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px; /* each stacked link a 24px target (WCAG 2.5.8; was 21px) */
  letter-spacing: 0.02em;
}
.contact-page__foot > * { margin: 0; }
.contact-page__foot a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.contact-page__foot a:hover { color: #e33010; }
.contact-page__logo {
  margin-left: auto !important;
  flex: none;
}
.contact-page__logo img {
  display: block;
  width: min(306px, 30vw) !important;
  height: auto;
}
/* The details above are the footer on this page */
body:has(.contact-page) footer.wp-block-template-part {
  display: none;
}

/* The portfolio's grid view is a fixed artboard with nothing below it; the
   page itself is short, so the footer would sit just under the header and show
   through (Firefox). The index view is a long list, and keeps it. */
body:has(#portfolio-grid-2d):not(.portfolio-index-on) footer.wp-block-template-part {
  display: none;
}

@media (max-width: 900px) {
  .contact-page { padding: 9rem 1.5rem 2rem; }
  .contact-page__foot { flex-wrap: wrap; gap: 1.25rem 2.5rem; }
  .contact-page__logo { flex-basis: 100%; margin-left: 0 !important; margin-top: 1rem !important; }
  .contact-page__logo img { width: 220px !important; }
}
/* Phones: the details stacked one group under another, as in the footer */
@media (max-width: 781px) {
  .contact-page__foot { flex-direction: column; flex-wrap: nowrap; gap: 1.5rem; }
  .contact-page__logo { flex-basis: auto; }
}

/* Services: the 12 icons spread across the full measure, six to a row, with
   the design's vertical rhythm (≈296px row pitch, label ≈2rem under the icon). */
.about-services .services-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  justify-items: center;
  gap: 5.25rem 0;
  padding: 0 0 2.25rem;
}
.about-services .service-card {
  gap: 2rem;
}
@media (max-width: 960px) {
  .about-services .services-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
  .about-services .services-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem 0; }
  .about-services .service-card,
  .about-services .service-card__icon { width: 96px; }
  .about-services .service-card__icon { height: 96px; }
}

/* People: four to a row, 20px gutter, rounded portraits. */
.about-team .team-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  max-width: none;
}
.about-team .team-card {
  border-radius: 5px;
}
@media (max-width: 960px) {
  .about-team .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .about-team .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ── Awards page ───────────────────────────────────────────────────────────── */

/* The 3D award holds its top-right spot (300 × 437 at 1440, 34px below the
   headline's top, 68px in from the edge) while the page scrolls under it, and
   eases down to 80% while the awards list is beneath it (src/js/awards-pin.js).
   It's the same #awards-3d mount as the About panel's, so a page transition
   between the two hands the live award across (src/js/awards-3d.js).

   Pinned with sticky, not fixed: the page scrolls inside the cube menu's 3D-
   transformed container, where fixed positioning isn't reliable. The pin rides
   an absolutely-positioned track spanning the page group's content box, so it
   takes no space; it sticks at exactly its natural top (no jump), and lets go
   when its bottom meets the end of the content — the awards list — so it never
   drifts over the footer. */
.awards-page {
  position: relative;
}
.awards-page > .awards-track {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: none;
  margin: 0;
  padding: inherit; /* the group's gutters → the track's content box is the page's */
  pointer-events: none;
}
.awards-pin {
  --trophy-w: clamp(180px, 20.8vw, 300px);
  --trophy-h: calc(var(--trophy-w) * 437 / 300);
  position: sticky;
  top: calc(var(--wp--preset--spacing--80) + clamp(3rem, 8.125vw, 117px));
  max-width: 1400px;
  height: calc(34px + var(--trophy-h));
  margin: 0 auto;
}
.awards-hero__object {
  position: absolute;
  top: 34px;
  right: clamp(0px, 4.7vw, 68px);
  width: var(--trophy-w);
  aspect-ratio: 300 / 437;
  margin: 0;
  pointer-events: auto;
  transform-origin: 100% 0;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.awards-hero__object.is-over-list {
  transform: scale(0.8);
}
@media (prefers-reduced-motion: reduce) {
  .awards-hero__object { transition: none; }
}
/* The award's canvas overhangs its mount (see awards-3d.js) — clip that at the
   page's edges so it can't add a horizontal scroll. clip, not hidden: hidden
   would make these scroll containers and break the sticky pin. */
.about-page,
.awards-page {
  overflow-x: clip;
}
/* Their side padding is set in the content (clamp(1.5rem, 4.17vw, 60px)): from
   tablets up, the page gutter instead, clear of the logo. */
@media (min-width: 769px) {
  .about-page,
  .awards-page {
    padding-left: var(--page-gutter) !important;
    padding-right: var(--page-gutter) !important;
  }
}
@media (max-width: 781px) {
  .awards-page > .awards-track { display: none; }
}

/* The shelf photo holds just under the header while the awards panel slides up
   over it. The stage ends at the panel's bottom, so the photo is fully covered
   by the time it's released. */
.awards-stage__photo {
  position: sticky;
  top: 75px;
  z-index: 1;
  margin: 0;
}
.awards-stage__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1320 / 693;
  object-fit: cover;
  object-position: 50% 100%;
  border-radius: 5px;
}
.awards-stage .awards-hl {
  z-index: 2;
}

/* ── Site footer ───────────────────────────────────────────────────────────── */

.site-footer a {
  text-decoration: none;
}
/* Stacked contact links (email / phone, LinkedIn / Instagram): each a 24px
   target — the whole line, not just the 21px of text (WCAG 2.5.8). Same on
   Contact (.contact-page__foot). */
.site-footer p:has(> a[href^="mailto:"]),
.site-footer p:has(> a[href*="linkedin"]) {
  line-height: 24px;
}
.site-footer p:has(> a[href^="mailto:"]) > a,
.site-footer p:has(> a[href*="linkedin"]) > a,
.contact-page__foot a {
  display: inline-block;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ── Single project pagination ─────────────────────────────────────────────── */

.single-project .wp-site-blocks > * + .project-pagination,
.single-project .wp-site-blocks > .project-pagination + footer.wp-block-template-part {
  margin-block-start: 0px;
}

.project-pagination {
  padding: 1.5rem;
}

.single-project .project-pagination > .wp-block-group {
  flex-direction: row-reverse;
}

.single-project .wp-block-post-navigation-link a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  line-height: 1;
  text-decoration: none;
  color: #fff;
}

.single-project .wp-block-post-navigation-link a:hover {
  color: rgba(255, 255, 255, 0.7);
}

.single-project .wp-block-post-navigation-link .post-navigation-link__label {
  text-transform: uppercase;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.single-project .wp-block-post-navigation-link .post-navigation-link__title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.25rem;
}

/* Footer nav on phones (the columns stack below 782px): a touch larger, with
   taller links so each is an easier tap. */
@media (max-width: 781px) {
  .site-footer__nav { font-size: 1.125rem !important; }
  .site-footer__nav .wp-block-navigation__container { gap: 0 !important; }
  .site-footer__nav .wp-block-navigation-item__content { display: block; padding: 7px 0; }
}

/* Read by screen readers, not shown (headings and text that only make sense
   without the visuals, e.g. the homepage story). */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Showreel pause/play (src/js/reels.js): the reel plays on its own, so it
   needs a way to stop it. 44px, bottom right of the About reel; on Contact,
   where the reel is the page's backdrop, top right below the menu. */
.reel-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.reel-toggle:hover { border-color: #fff; background: rgba(0, 0, 0, 0.75); }
.reel-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.reel-toggle--backdrop {
  position: fixed;
  top: 96px;
  right: 24px;
  bottom: auto;
}
@media (max-width: 768px) {
  .reel-toggle--backdrop { top: 76px; right: 12px; }
}

/* Shown when it has keyboard focus (e.g. the homepage's "Skip the story"),
   styled like WordPress's "Skip to content". */
.sr-only-focusable:focus {
  position: fixed !important;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  top: 6px;
  left: 6px;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 15px 23px 14px;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  background: #eee;
  color: #444;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  text-decoration: none;
}
