/* ==========================================================================
   Fonts
   ========================================================================== */

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

@font-face {
  font-family: "Iosevka";
  src: url("../font/Iosevka-MediumExtended.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-stretch: expanded;
  font-display: swap;
}

@font-face {
  font-family: "Iosevka";
  src: url("../font/Iosevka-ExtraboldExtendedItalic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-stretch: expanded;
  font-display: swap;
}

@font-face {
  font-family: "RUNES";
  src: url("../font/RUNES.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  overflow-x: hidden;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

h1, h2, h3, h4, h5, h6,
p {
  margin: 0;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  /* How far the page content (sections, console, footer) is indented from the column's left edge. It used to be 8vw, which put the content
     right of the window's centre on wide windows (the right-hand ornaments hang off the same column and stay where they were: they keep
     using 8vw). Capped at 96px, i.e. (60rem content column in a 75rem frame) -> centred; below 1200px it is the old 8vw. */
  --indent: min(8vw, 96px);
  --font-body: "Iosevka", ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --font-display: "RUNES", var(--font-body);

  --color-bg: #ffffff;
  /* --color-bg:  #cbc1d1; */
  --color-fg: #000000;
  --color-bg-dark: #272727;
  --color-muted: #8a8a85;
  --color-accent: #d8ff3e;
  /* --color-accent-pink: #E90075; */
  --color-accent-pink: #D00069;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;
  --max-width: 75rem;
  --header-height: calc(100vw/25);
  --header-min-height: 45px;
  /* The sticky header's actual rendered height (--header-height can be
     smaller than the min-height on narrow screens). */
  --header-h: max(var(--header-height), var(--header-min-height));

  --service-media-brightness: .7;
  --service-media-contrast:1;

  --project-ornament-width: 300px;
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.5;

  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-main {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

/* Full-bleed background (like .site-header/.hero-connector), with
   .footer-inner as the actual centered/width-capped content column --
   same "outer bleeds, inner caps at --max-width" split .site-header uses
   for .site-nav. */
.footer-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-bg-dark);
  height: var(--header-height);
  min-height: var(--header-min-height);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-inline: var(--space-3);
}

.site-nav {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color:var(--color-accent-pink);
}

.site-link-hl {
  color: var(--color-bg);
}

/* Class on the <a> itself, like .site-link below -- ".site-link-hl a:hover"
   alone would only match a link *inside* a .site-link-hl. */
.site-link-hl:hover,
.site-link-hl a:hover {
  text-decoration: underline;
  color: var(--color-accent-pink);
}

/* The class is on the <a> itself (class="site-link"), so the selector has to
   be .site-link:hover -- ".site-link a:hover" means "an <a> *inside* a
   .site-link" and never matches here. The second selector keeps the old
   form working too, in case the class ever goes on the <li> instead. */
.site-link:hover,
.site-link a:hover {
  text-decoration: underline;
  color:var(--color-bg);
}

.nav-toggle {
  display: none;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-left: 25px;
}

#btn_contact {
  color: #ffffff;
  background: var(--color-accent-pink);
  margin-right: 25px;
}


.site-footer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-color: var(--color-fg);
  padding-block: var(--space-4);
  /* Was var(--color-fg) -- black text on this black background, which is
     why the copyright line was invisible. */
  color: #ffffff;
  font-size: 0.875rem;
}

/* Copyright on the left, legal links on the right; wraps (links drop to
   their own line) when there isn't room for both. Indented by the same
   8vw as the console above so its left edge lines up with the console's
   text; the phone layout drops the indent along with the console's. */
.site-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-5);
  margin-left: var(--indent);
  margin-right: var(--indent);
}

/* Closing mark, centred under the console with plenty of air around it
   (centred on the page, not on the console's indented column). */
.site-footer-logo {
  display: block;
  width: 6.5rem;
  height: auto;
  margin: var(--space-6) auto 0;
  margin-bottom: 10%;
  /* Centred under the console *box*, not the page: the console is indented
     8vw on the left and its drawn border sits (1px + --space-3) further
     left again (see .console / .console-screen), so its centre is
     4vw - (1px + --space-3)/2 right of the page's. */
  transform: translateX(calc(4vw - (1px + var(--space-3)) / 2));
}

.site-footer-copy {
  color: rgba(255, 255, 255, 0.75);
}

.site-footer-links {
  display: flex;
  gap: var(--space-3);
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
  color: var(--color-accent-pink);
  text-decoration: underline;
}

@media (max-width: 48rem) {
  .site-footer-bar {
    margin-left: 0;
    margin-right: 0;
  }

  /* The phone console drops its indent and border and spans the full
     width, so the page centre is the console's centre again. */
  .site-footer-logo {
    transform: none;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100vw;
  /* Never taller than the viewport, and never taller than what's needed
     to show the hero image at its native aspect ratio (so it's never cropped). */
  height: min(calc(100vh - var(--header-height)), calc(100vw * 0.24 * 841 / 426));
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
}

.hero-image {
  width: 24%;
  height: 100%;
  background: var(--color-accent-pink);
}

.hero-video {
  width: 76%;
  height: 100%;
  background-color: #272727;
}

.video-embed {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  cursor: pointer;
}

.video-embed .play-button {
  position: absolute;
  top: 0;
  left: 0;
  width: 250px;
  aspect-ratio: 312 / 46;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;
  will-change: transform;
}

.video-embed .play-button img {
  width: 100%;
  height: auto;
}

.video-embed .play-button.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-connector {
  position: relative;
  z-index: 10;
  background-color: var(--color-bg-dark);
  height: var(--header-height);
  min-height: var(--header-min-height);
  overflow: visible;
}

.section-divider {
  max-width: var(--max-width);
  margin-inline: auto;
  height:inherit;
}

.section-divider img {
  width: 3vw;
  height:auto;
  transform: translateY(-12%);
  z-index: 10;
  max-width: 80px;
  min-width: 40px;
  margin-left: calc(31px - (8vw - var(--indent)));   /* moves left with the content (see --indent) */
}

@media (max-width: 768px) {
  .hero {
    height: calc(100vh - var(--header-height));
  }

  .hero-image {
    display: none;
  }

  .hero-video {
    width: 100%;
  }
}

/* ==========================================================================
   Intro (template)
   ========================================================================== */

.intro {
  position: relative;
  scroll-margin-top: calc(100vw/18);
}

.about {
  position: relative;
  scroll-margin-top: calc(100vw / 18);
}

.projects {
  position:relative;
  scroll-margin-top: calc(100vw / 18);
}

.testimonials,
.how-we-work,
.studio,
.cta {
  position: relative;
  scroll-margin-top: calc(100vw / 18);
}

/* .section-content / .section-heading are shared hooks reused across
   page sections (e.g. #intro, #about). Section-specific tuning lives
   under each section's own ID below. */
.section-heading .hl {
  font-weight: 800;
}

.section-heading {
  text-transform: uppercase;
  font-size: clamp(6vh, 8vh, 3.7vw);
  line-height: 1.3;
  letter-spacing: 0.4rem;
  font-weight: 500;
  max-width: 40rem;
  margin-bottom: var(--space-5);
}

.section-content {
  margin-left: var(--indent);
  margin-right: var(--indent);                 /* same on both sides: centred also on windows too narrow for the 60rem column */
  margin-top: 9vh;
}

.section-body {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: 2.5vh;
  line-height: 1.4;
  letter-spacing: 0.07rem;
  word-spacing: 0.5rem;
}

.project-text {
  width: 70%;
}

#intro .section-content {
  margin-top: 7vh;
}

#intro .section-body {
  max-width: 38rem;
  margin-top:3vh;
}



#about .section-body {
  max-width: 50rem;
}

#projects .section-content {
  margin-top: 10vh;
  /* Positioned so the cases ornament can be placed relative to it, and
     the case dimensions live here so the list and the ornament share them. */
  position: relative;
  --project-gap: var(--space-5);
  --project-height: 360px;
}

#projects .section-heading {
  max-width: 50rem;
  margin-bottom: var(--space-2);
}
#projects .section-body {
  max-width: 50rem;
}

#projects .section-divider {
  position: absolute;
  left: 0px;
  top: 4vh;
}

#projects .ornament-left {
  /* Hangs from the bottom of the section, so it would slide down by one card pitch for every extra case. --project-count (set on
     #projects, the number of cases) cancels that: the ornament stays beside the first cards however long the list grows. */
  top: calc(100% - 60px - (var(--project-count, 3) - 3) * (var(--project-height) + var(--project-gap)));
  bottom: auto;
  left: -36px;
  width: 260px;
  height: 150px;
  aspect-ratio: auto;
  color: #ffffff;
  /* This ornament belongs to the case cards, so it is placed purely by the
     CSS in this block and never slides to the window edge like the other
     left ornaments (intro-ornament.js sets inline margins on every
     .ornament-left to do that; !important here wins over them). Position
     the pieces below with left / margin / etc. and they stay where you put them. */
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#projects .ornament-left .orn-b {
  /* The L (this bar, .pink-bg and the white hazard layer below) sits BELOW the case traces -- the white layer is opaque and used to
     hide the start of the traces -- but, being later in the page than the cards' pink bars (z -1), still above those: bar < pink
     block < white stripes by DOM order. The traces themselves are z auto (see .case-trace), so they paint above all of this. */
  z-index: -1;
  width: 100%;
  padding-right: 0px;
  padding-top: 1px;
}

/* these three belong beside the LAST case, so they take the card-pitch compensation back (see --project-count on the box above) */
#projects .ornament-left .orn-dots {
  top: calc(-1.3em + (var(--project-count, 3) - 3) * (var(--project-height) + var(--project-gap)));
  left: -3em;
  right: auto;
  font-size: 3rem;
}

#projects .ornament-left .orn-digits {
  top: calc(-60px + (var(--project-count, 3) - 3) * (var(--project-height) + var(--project-gap)));
  left: -50px;
  z-index: auto;
  transform: none;
}

#projects .orn-digits-box {
  position: absolute;
  inset: .2em .27em -.5em -3em;
  background: var(--color-accent-pink);
  z-index: -1;
}

#projects .orn-digits-row {
  position: relative;
  z-index: 5;
}

#projects .ornament-left .orn-measure {
  top: calc(1.5em + (var(--project-count, 3) - 3) * (var(--project-height) + var(--project-gap)));
  left: -14em;
  width: 22px;
  height: 130px;
}

/* Text blocks below the cases are as wide as the case cards (60rem). */
#testimonials .section-heading,
#how-we-work .section-heading,
#studio .section-heading {
  max-width: 60rem;
  margin-bottom: var(--space-2);
}

#testimonials .section-body,
#how-we-work .section-body,
#studio .section-body {
  max-width: 60rem;
}

#testimonials .ornament-right .orn-digits {
  top: 10vh;
  left: 10vw;
}

#testimonials .ornament-right .orn-digits-box {
  position: absolute;
  inset: 0em 0em 0em 0em;
  background: var(--color-accent-pink);
  z-index: -1;
  right: -85%;
  left: -8px;
  top: 0px;
  top: -8px;
  bottom: 3%;
  bottom: 1%;
  bottom: -90%;
}

#testimonials .ornament-right .orn-digits-row {
  color: var(--color-bg)
}

#testimonials .ornament-right .hazard-landscape {

  height: 427px;
  width: 323px;
  padding: 0px;
  margin-top: 0vh;
  margin-right: 0vw;
  margin-left: 0vw;
  min-width: 0px;
  padding-top: 0px;
  transform: rotate(90deg);
  filter: invert(1);
}

#testimonials .ornament-right .pink-bg {

    width: 380px;
  width: 381px;
  margin: 0%;
  margin-top: 49vh;
  margin-right: 1%;
  margin-right: 0%;
  margin-left: 1vw;
}

/* Testimonial stage: [arrow] [gray box] [arrow]. Quotes crossfade in the
   box (stacked in one grid cell so it's always as tall as the longest
   quote and nothing jumps). Rotation is driven by static/js/testimonials.js.
   The arrows hang outside the box like the site's other ornaments. */
.testimonial-stage {
  --t-arrow-w: 4.5rem;
  --t-arrow-gap: var(--space-2);
  position: relative;
  margin-top: var(--space-5);
  margin-bottom: var(--space-5);
  /* Same outer width as .project-list / the case cards. */
  width: 60rem;
  max-width: 100%;
}

.testimonial-box {
  position: relative;
  color: var(--color-fg);
}

.testimonial-slides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* Each column is its own slot: its cards stack in one grid cell and
   crossfade, on a timer independent of the other slot (see
   static/js/testimonials.js, which staggers them). Both slots share a row,
   so the cards always end up the same height. */
.testimonial-slot {
  position: relative;
  display: grid;
}

/* Lighter than .case-card's gray so black *and* white text both read. */
.testimonial-card {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  background: #bdbdbd;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.testimonial-card.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}

/* Portrait runs edge to edge across the top of the card. Greyscale photo
   multiplied over a pink base = pink duotone; the brightness lift keeps
   the highlights from going muddy. */
.testimonial-portrait {
  position: relative;
  /* 3:1 strip -- crop source images to this (card is ~468px wide at 60rem). */
  aspect-ratio: 3 / 1;
  flex: none;
  background: var(--color-accent-pink);
}

.testimonial-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(1.25);
  mix-blend-mode: multiply;
}

/* Logo variant (e.g. a title card: light mark on a dark field). Multiply
   would turn that near-black, so screen it over the pink instead -- dark
   field -> pink, light mark -> pale pink. Crop is biased left so the
   emblem lands in the box rather than the middle of the wordmark. */
.testimonial-image.is-logo {
  filter: grayscale(1) contrast(2.2);
  mix-blend-mode: screen;
  object-position: 15% 50%;
}

.testimonial-text {
  min-width: 0;
  padding: var(--space-2) var(--space-3) var(--space-3);
}

/* Headline matches the "what people say" intro copy (.section-body). */
.testimonial-teaser {
  color: #ffffff;
  font-weight: 800;
  font-size: 2.5vh;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.07rem;
  margin-bottom: var(--space-1);
}

/* Body text matches the case cards' tags (.case-tags). */
.testimonial-quote {
  margin: 0 0 var(--space-2);
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
  /* Clamped so both columns fit on one laptop screen together with the
     intro copy; the full quote shows while the card is hovered/focused
     (see below), which also pauses the rotation. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}

/* An expanded card lifts out of the slot and grows to show the full quote,
   overlaying whatever is below instead of pushing the page around. It
   expands on hover (mouse only) and stays open once clicked/tapped/Enter
   ("locked", .is-locked, set in testimonials.js). Hover is gated on
   (hover: hover) so touch screens don't get a sticky half-open card. */
.testimonial-card {
  cursor: pointer;
}

.testimonial-card:focus-visible {
  outline: 2px solid var(--color-fg);
  outline-offset: -4px;
}

.testimonial-card.is-active.is-locked {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.testimonial-card.is-active.is-locked .testimonial-quote {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

@media (hover: hover) {
  .testimonial-card.is-active:hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }

  .testimonial-card.is-active:hover .testimonial-quote {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
  }
}

.testimonial-name {
  color: var(--color-fg);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.testimonial-role {
  color: var(--color-fg);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* Per-slot auto-advance timer: a thin line along the very bottom of each
   card, restarted by testimonials.js whenever that slot changes. */
.testimonial-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  background: var(--color-fg);
  transform-origin: left center;
  transform: scaleX(0);
}

.testimonial-progress.is-running {
  animation: testimonial-fill var(--testimonial-hold, 9s) linear forwards;
}

.testimonial-stage.is-held .testimonial-progress {
  animation-play-state: paused;
}

@keyframes testimonial-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Chevron arrows, hanging outside the box either side, vertically centred. */
.testimonial-arrow {
  position: absolute;
  top: 50%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
  transform: translateY(-50%);
  transition: transform 0.15s ease;
}

.testimonial-arrow img {
  display: block;
  width: var(--t-arrow-w);
  height: auto;
}

.testimonial-prev { right: calc(100% + var(--t-arrow-gap)); }
.testimonial-next { left: calc(100% + var(--t-arrow-gap)); }

.testimonial-prev:hover { transform: translate(-6px, -50%); }
.testimonial-next:hover { transform: translate(6px, -50%); }

.testimonial-arrow:focus-visible {
  outline: 2px solid var(--color-fg);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .testimonial-progress.is-running { animation: none; }
}

/* Not enough room beside the box: tuck the arrows inside its edges. */
@media (max-width: 75rem) {
  .testimonial-stage { --t-arrow-w: 2.5rem; }
  .testimonial-prev { right: auto; left: var(--space-1); }
  .testimonial-next { left: auto; right: var(--space-1); }
  .testimonial-arrow { top: 5.5rem; }
}

@media (max-width: 40rem) {
  .testimonial-slides { grid-template-columns: 1fr; }
}

/* Same frame_b reticule every other media box on the site uses (see
   .service-frame) -- was missing here, leaving testimonials as the one
   flat, unframed gray box. */
.testimonial-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.testimonial-frame .frame-b-corner {
  width: 22px;
}

.testimonial-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-fg);
  border-radius: 50%;
}

.testimonial-name {
  color: var(--color-accent-pink);
  font-weight: 800;
  font-size: 0.85rem;
}

.testimonial-role,
.testimonial-company {
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Studio points: same card language as the testimonials -- lighter gray
   card, white uppercase headline, small black body text. Same 60rem width as the case
   cards. */
.studio-points {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  /* Breathing room before the footer. */
  margin-bottom: var(--space-6);
  width: 60rem;
  max-width: 100%;
}

.studio-point {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #bdbdbd;
  color: var(--color-fg);
}

.studio-point-text {
  padding: var(--space-3);
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
}

/* Headline matches the testimonial cards' (and the section intro copy). */
.studio-point-title {
  color: #ffffff;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 2.5vh;
  line-height: 1.2;
  letter-spacing: 0.07rem;
  margin-bottom: var(--space-1);
}

@media (max-width: 40rem) {
  .studio-points { flex-direction: column; }
}

/* ==========================================================================
   Footer console
   ========================================================================== */

.console {
  background: #000000;
  color: var(--color-accent-pink);
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
  /* Horizontal padding removed (kept only block/vertical) -- .footer-inner
     already has the same padding-inline as .site-main, so with none added
     here .console's own left edge already lines up with the body text
     above. .console-screen compensates for its own border+padding below,
     so its *text* (not its drawn border) is what lands on that line. */
  padding-block: var(--space-3);
  padding-inline: 0;
  /* Fills .footer-inner's full (body-matching) width instead of its own
     narrower cap -- that old max-width had no margin-inline:auto either,
     so at wider viewports it also sat flush left instead of centered.
     Every other section's text sits at .site-main's edge *plus* this
     same 8vw (see .section-content) -- without it the console read as
     flush left of "THE STUDIO" etc. above it instead of lining up with
     that same text column. Width trimmed by the same amount so the
     right edge lands where plain 100% would have put it, rather than
     overflowing past .footer-inner. */
  width: calc(100% - 2 * var(--indent));
  margin-left: var(--indent);
  /* Fixed size, whatever screen/state the game is in: as tall as the
     window under the sticky header (min 26rem on very short windows),
     with the status line staying inside it, below the screen. The screen
     flexes to fill what's left, so nothing the game does can change the
     console's size -- or move the page when it changes screens. */
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  min-height: 26rem;
}

@supports (height: 100svh) {
  .console {
    height: calc(100svh - var(--header-h));
  }
}

.console-screen {
  flex: 1 1 auto;
  min-height: 0;
  /* Scrolling to the console (a "#console" link, the share link) puts
     the console block right under the sticky header: header + the
     console's own top padding. */
  scroll-margin-top: calc(var(--header-h) + var(--space-3));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-accent-pink);
  padding: var(--space-3);
  /* Pulls the box left by exactly its own border+padding, so the text
     inside starts at .console's edge (= the body text's left edge)
     instead of an extra ~25px past it. Right edge is intentionally left
     alone -- that side was already correct. */
  margin-left: calc(-1px - var(--space-3));
  outline: none;
  overflow: hidden;
}

.console-screen:focus-visible {
  /* box-shadow: 0 0 0 2px #ffffff inset; */
}

.console-line {
  margin: 0;
  white-space: pre-wrap;
}

.console-line.is-signature {
  background: var(--color-accent-pink);
  color: #ffffff;
  padding-inline: 0.2em;
}

/* Section titles and outcome lines (VICTORY / SQUAD DEFEATED / screen
   headers) -- plain white, no background, so they read as a step in the
   flow without the heavier pink-block treatment reserved for signatures. */
.console-line.is-highlight {
  color: #ffffff;
  font-weight: 800;
}

/* Fixed (not max-) height: the log always occupies the same space and
   scrolls internally as lines are typed in, instead of growing taller
   line by line and pushing the cards panel above / menu below down the
   page with it. Scrollbar hidden -- ArrowUp/Down (see the keydown
   handler) scroll it instead, keeping the console's TUI look clean of
   a browser-drawn scrollbar. */
.console-output {
  order: 1;
  flex: 1 1 40vh;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.console-output::-webkit-scrollbar {
  display: none;
}

/* Live HP/charge card panel, redrawn in lockstep with the battle log as
   each line types out. Collapsed (0 height) by default -- the intro/main
   menu screen stays small, like before this existed -- and only takes up
   room once it actually has cards to show (battle/position). Between
   battles (no card data yet), it stays at 0 height -- .console-screen's
   own min-height (see above) is what keeps the console a consistent
   size then, not this panel reserving space for itself, so the log text
   still starts at the top of the console instead of being pushed down
   by an empty reserved block. */
.console-cards {
  order: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.console-screen.is-playing .console-cards:not(.is-empty) {
  height: 24rem;
  /* The console no longer grows to fit, so on a short window the panel
     gives way (and the log shrinks/scrolls) instead of pushing the menu out. */
  max-height: 52%;
}

.console-cards:not(.is-empty) {
  visibility: visible;
  overflow-y: auto;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--color-accent-pink);
}

/* Your backline/frontline, a VS divider, their frontline/backline --
   used identically on the position screen (enemy columns just sit
   empty) and the battle screen, so the columns are always in the same
   place and never jump around when enemy data appears.
   Five EQUAL columns, including VS -- "VS" itself is short, so most of
   its column is empty space either side of it, and since it's sized
   the same as every other column, that empty space (i.e. the visual
   gap between "your side" and "their side") grows right along with the
   console's own width instead of staying a fixed size. The gap value
   itself stays small and uniform, so your two columns (and their two)
   still read as a tight, closely-grouped pair. */
.console-cards-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2) 0.6em;
}

.console-cards-col-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.console-cards-col .console-line {
  white-space: pre-wrap;
}

/* One unit's card within a column -- its own element (not just loose
   lines) so a damage flash can target just that unit. */
.console-card {
  margin-bottom: 0.4em;
}

/* Damage flash: the card's text briefly goes white, then fades back to
   the normal pink -- just the text color, no background flip (that
   read as the whole card flashing a jarring white block). */
.console-card.is-hit {
  animation: card-hit-flash 0.4s ease-out;
}

@keyframes card-hit-flash {
  0%, 35% {
    color: #ffffff;
  }
  100% {
    color: inherit;
  }
}

/* Between the log and the menu (not after the menu) -- otherwise the
   invisible filler (kept at 0 height now, see .console-screen.is-playing
   .console-cards:not(.is-empty) above -- no longer reserves space of its
   own) would otherwise sit below the menu for no visual reason. */
.console-cards.is-empty {
  order: 2;
}

.console-output .console-line.is-dim {
  color: var(--color-muted);
}

.console-blink {
  background: var(--color-accent-pink);
  color: #000000;
  animation: console-blink 1s step-end infinite;
}

@keyframes console-blink {
  50% { opacity: 0; }
}

/* Appended into .console-output itself, right after the typed intro
   (see showMenuScreen's typeLines onDone) -- not a separate flex child,
   so it reads as the next line directly below the intro text instead of
   sitting apart from it with whatever gap the log box's own height
   leaves. Cleared for free whenever another screen's typeLines/setLines
   clears the output, same as every other console line. */
.console-seedline {
  margin-top: 0.6em;
}

/* margin-top:auto pushes the menu down to soak up whatever's left of
   .console-screen's min-height, so DEPLOY/ENGAGE/CONFIRM/etc. always
   sit flush at the console's bottom edge regardless of how little
   content (log lines, cards) came before it on that screen. */
.console-menu {
  order: 3;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.6em;
}

/* Upgrade-choice screen: options read as centered "cards" ([ +10% ATK ])
   instead of a left-aligned inline list, with more breathing room
   between them so each choice stands on its own. */
.console-menu.is-cards {
  justify-content: center;
  gap: 0.6em 1.4em;
}

/* True vertical centering for the upgrade screen -- margin:auto on just
   the menu (like the default bottom-pinning above) only centers it
   within whatever's left AFTER the log's own fixed 40vh height, which
   sits pinned at the top eating most of the box, so the "centered"
   result actually landed well below the console's real middle. Instead,
   on this screen specifically: let the log shrink to its own two lines
   of text instead of holding the full 40vh, and center the whole
   remaining group (that text + the cards) as one unit in the console. */
.console-screen.is-upgrade {
  justify-content: center;
}

.console-screen.is-upgrade .console-output {
  flex: 0 1 auto;
}

.console-screen.is-upgrade .console-menu {
  margin-top: 0;
}

/* Roster: one option per row instead of a wrapped inline row. */
.console-menu.is-list {
  flex-direction: column;
  gap: 0;
}

/* Barks: the heroes' (and the Overdrive's) spoken lines -- slightly
   dimmer than combat lines; ones aimed at the player a little brighter
   and italic. Colour/style only, no layout change. */
.console-line.is-dialogue {
  color: #ffffff;
  opacity: 0.72;
}

.console-line.is-dialogue.is-to-player {
  opacity: 1;
  font-style: italic;
}

.console-help-note {
  margin-top: 0.4em;
  opacity: 0.8;
}

.console-menu-item.is-card {
  border: 1px solid var(--color-accent-pink);
  padding: 0.35em 0.9em;
}

.console-menu-item {
  cursor: pointer;
}

.console-menu-item.is-active {
  background: var(--color-accent-pink);
  color: #ffffff;
}

/* The "next step" action (DEPLOY, ENGAGE, CONFIRM SQUAD, CONTINUE...) --
   its text is plain white instead of the console's normal pink, so it
   reads as the obvious next move next to a row of pink toggles/choices.
   Selection itself still looks the same everywhere -- the pink block
   from .is-active above, not a white one -- this only overrides the
   text color, and only while NOT selected (.is-active's black text
   still wins once it is, via source order below). Ordered last among
   its siblings (see .console-menu-item.is-next below) so it always
   lands at the end of the row/wrap, in the same spot screen to screen,
   instead of wherever it happens to fall in that screen's option list. */
.console-menu-item.is-next {
  color: #ffffff;
  order: 1;
}

.console-grid {
  margin: var(--space-2) 0;
  font-family: var(--font-body);
  white-space: pre;
}

.console-caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.2em;
  background: var(--color-accent-pink);
  vertical-align: text-bottom;
  animation: console-blink 1s step-end infinite;
}

.console-status {
  flex: none;
  margin: var(--space-2) 0 0;
  font-size: 0.75rem;
  color: var(--color-accent-pink);
}

/* Overlay centred over the console (it used to sit below the status line
   and push the console taller whenever H was pressed). */
.console-help {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(32rem, 90%);
  background: #000000;
  border: 1px solid var(--color-accent-pink);
  padding: var(--space-2);
}

.console-help[hidden] {
  display: none;
}

.console-help-title {
  margin: 0 0 var(--space-1);
  font-weight: 800;
}

.console-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.console-key {
  display: inline-block;
  min-width: 2.5em;
  margin-right: 0.5em;
  padding-inline: 0.3em;
  text-align: center;
  border: 1px solid var(--color-accent-pink);
}

/* Mobile: the 8vw alignment indent (see .console above) makes sense
   next to a wide page of text, but on a narrow screen it's exactly what
   was squeezing the console into a strip down the middle -- undone
   here, along with the border, so the console instead bleeds past
   .footer-inner's own padding-inline and uses the full screen width.
   Placed last in this section (source order, not just specificity) so
   it actually wins over the plain .console/.console-screen rules above
   at this width -- an identical-specificity rule earlier in the file
   does NOT lose to one later just because the later one is only
   reached via a media query. .console-screen keeps its own
   padding-inline, though, so text still isn't flush against the
   physical screen edge. */
@media (max-width: 768px) {
  .console {
    width: calc(100% + 2 * var(--space-3));
    margin-left: calc(-1 * var(--space-3));
  }

  .console-screen {
    border: none;
    margin-left: 0;
    padding-inline: var(--space-3);
  }
}

/* ==========================================================================
   Project placeholders
   ========================================================================== */

/* Horizontal counterpart to .services: full-width bars stacked in a
   column instead of columns stacked side by side. Unlike .service,
   there's no closed/open accordion state here -- label, circle and
   tags are always visible. */
.project-list {
  /* Matches .services' own outer width exactly (60rem), rather than a
     width:100% that would get capped at #projects .section-body's
     max-width:50rem. .services isn't capped either: as a flex item in
     .section-body's row layout (align-items:flex-start, no stretch),
     it sizes from its own explicit max-width and is allowed to overflow
     .section-body's max-width rather than shrink to fit it -- setting
     an explicit width here (not just width:100%) reproduces the same
     overflow instead of being constrained by it. */
  width: 60rem;
  /* Without this, the row-flex .section-body still shrinks
     .project-list below its explicit width to fit its own max-width --
     .project's children are all position:absolute so they contribute
     no min-content floor to resist that shrink, unlike .services
     (whose flex-basis:0% children happen not to need one either, but
     whose own overflow already isn't shrunk in practice). Pinning
     flex-shrink:0 is the direct fix regardless of that asymmetry. */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  /* Shared by .project, .project-ornament and the connector below, so
     they stay in sync with each other. */
  --project-ornament-h: calc(var(--project-ornament-width) * 199 / 638);
  --project-ornament-top: -20px;
  --pink-extra: 100px;
  gap: var(--project-gap);
  margin-top: var(--space-5);
}

/* ==========================================================================
   Case card (real case study, dummy data -- see the HTML comment above
   .case-card for where it comes from). Same closed/open language as
   .service (big bold title closed, shrinks + reveals detail on hover),
   but shaped like .project (a full-width horizontal bar) since this is a
   #projects card, and clickable through to the case's own sub-site
   instead of expanding in place. */
.case-card {
  position: relative;
  display: block;
  height: var(--project-height);
  background: #9a9a9a;
  /* No overflow:hidden (unlike a plain image card) -- .project-ornament
     hangs off the left edge by design and needs to stay visible there,
     same as on .project. The media images inside are already sized to
     inset:0 with object-fit:cover, so nothing here needs clipping. */
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.case-media {
  position: absolute;
  inset: 0;
}

.case-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  /* Same dimming as .service-media (same vars, same reasoning: the big
     title needs to read clearly over the image) -- was hardcoded to its
     own brightness/contrast before, which is why the two didn't match. */
  filter: grayscale(1)
    brightness(var(--service-media-brightness, 0.7))
    contrast(var(--service-media-contrast, 0.8));
  transition: opacity 0.5s ease, filter 0.4s ease;
}

.case-frame.is-active {
  opacity: 1;
}

.case-card:hover .case-frame {
  filter: grayscale(0) brightness(1) contrast(1);
}

.case-media-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-accent-pink);
  mix-blend-mode: screen;
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.case-card:hover .case-media-tint {
  opacity: 0;
}

/* Above .case-media/.case-media-tint but below the corner frame
   (.service-frame is z-index:2 too, and it comes first in the DOM, so
   without this override the title's later DOM position would win the
   z-index tie and cover the corners). */
.case-title {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: var(--space-3);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.45s ease;
}

.case-title-line {
  display: block;
  color: #ffffff;
  font-weight: 1000;
  font-size: 6rem;
  line-height: 0.95;
  text-transform: uppercase;
  white-space: nowrap;
}

.case-card:hover .case-title {
  opacity: 0;
  transform: translateX(40px);
}

.case-label {
  position: absolute;
  top: var(--space-2);
  left: var(--space-3);
  z-index: 3;
  padding-inline: 0.3em;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #ffffff;
  background: var(--color-accent-pink);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.case-card:hover .case-label {
  opacity: 1;
}

.case-client {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-2);
  z-index: 2;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  /* Full-color footage sits behind this on hover (the dimming filter
     lifts), so a plain white fill can wash out -- the shadow keeps it
     legible regardless of what's underneath. */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.case-card:hover .case-client {
  opacity: 1;
}

/* Always visible, closed or open -- unlike .case-client, which is still
   hover-only detail. */
.case-tags {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-2);
  z-index: 2;
  display: flex;
  gap: var(--space-2);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.case-tag::before {
  content: "[ ";
}

.case-tag::after {
  content: " ]";
}

.project {
  position: relative;
  /* Matches .service's own rendered height (.services' explicit
     height: 360px, which every .service stretches to fill). */
  height: var(--project-height);
  background: #9a9a9a;
}

.project-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #9a9a9a;
}

.project-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-fg);
  border-radius: 50%;
  pointer-events: none;
}

.project-label {
  position: absolute;
  top: var(--space-2);
  left: var(--space-3);
  padding-inline: 0.3em;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #ffffff;
  background: var(--color-accent-pink);
}

.project-tags {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-2);
  display: flex;
  gap: var(--space-2);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.project-tag {
  white-space: nowrap;
}

.project-tag::before {
  content: "[ ";
}

.project-tag::after {
  content: " ]";
}

/* Hazard side arrow, one element per case (so a looped case template
   gets it automatically). Three layers, back to front, matching
   hazard_side_arrow.png (638x199) as percentages of its own box:
   1. landscape hazard stripes (top-right)  -- element background
   2. pink rect (bottom-left), drawn in CSS -- element background, above 1
   3. white right arrows straddling both    -- ::after
   Sits off the case's left edge (pink + arrows outside, stripes running
   in under the case's top-left), so .project must not clip. */
.project-ornament {
  /* --w is the scale of the original 638x199 artwork (stripes, arrows and
     the pink rect's original size all derive from it). --pink-extra
     widens only the pink rect, growing it to the left: the box grows by
     that amount and shifts left by the same, so the stripes and arrows
     (anchored to the box's right end) don't move or rescale. */
  --w: var(--project-ornament-width, 300px);
  --h: var(--project-ornament-h);
  position: absolute;
  top: var(--project-ornament-top);
  left: calc(-210px - var(--pink-extra));
  z-index: -1;
  width: calc(var(--w) + var(--pink-extra));
  height: var(--h);
  pointer-events: none;
  background:
    linear-gradient(var(--color-accent-pink), var(--color-accent-pink)) 0 100% / calc(var(--w) * 0.5596 + var(--pink-extra)) calc(var(--h) * 0.6734) no-repeat,
    url("../img/templates/tetsuo/assets/hazard_stripes_small_landscape.png") 100% 0 / calc(var(--w) * 0.6238) calc(var(--h) * 0.4673) no-repeat;
}

.project-ornament::after {
  content: "";
  position: absolute;
  left: calc(var(--pink-extra) + var(--w) * 0.4154);
  top: calc(var(--h) * 0.3166);
  width: calc(var(--w) * 0.1755);
  aspect-ratio: 112 / 80;
  background: #ffffff;
  -webkit-mask: url("../img/templates/tetsuo/assets/arrows_right_bold.png") center / 100% 100% no-repeat;
  mask: url("../img/templates/tetsuo/assets/arrows_right_bold.png") center / 100% 100% no-repeat;
}

/* Large hazard pattern connecting the pink box of one case down to the
   pink box of the next, on every second case, starting at the second
   (2->3, 4->5, ...). A pseudo-element, so a looped case template gets
   it with no extra markup; :nth-child(even):not(:last-child) also skips
   a trailing even case that has no next case to connect to.
   Targets any direct child of .project-list (.project or .case-card),
   not just .project, so it still applies now that cards can be either.
   Runs from the bottom of this case's pink rect to the top of the next
   case's pink rect: one case pitch (height + gap) minus the pink rect's
   own height (67.34% of the ornament, see .project-ornament). Left edge
   lines up with the pink rect's left edge. */
.project-list > :nth-child(even):not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--project-ornament-top) + var(--project-ornament-h));
  left: calc(-210px - var(--pink-extra));
  width: 15%;
  height: calc(var(--project-height) + var(--project-gap) - var(--project-ornament-h) * 0.6734);
  background: url("../img/templates/tetsuo/assets/hazard_stripes_big.png") center / cover no-repeat;
  pointer-events: none;
}

/* ==========================================================================
   Cases ornament (#projects .ornament-right)
   ========================================================================== */

#projects .ornament-right {
  /* hangs off .section-content, which moved left by (8vw - --indent): the right ornament stays where it was */
  margin-left: calc(8vw - var(--indent));
  --projects-orn-width: 909px;
  --u: calc(var(--projects-orn-width) / 1212);
  width: var(--projects-orn-width);
  aspect-ratio: 1212 / 1774;
  left: calc(52.3rem - var(--u) * 510);
  top: calc(
    clamp(6vh, 8vh, 3.7vw) * 1.3 + var(--space-2) + var(--space-5) - 7vh
    + var(--project-height) + var(--project-gap) / 2
    - var(--u) * 1037 + 220px);
  z-index: -1;
  pointer-events: none;
}

.pj-bg { left: calc(var(--u) * 510); top: calc(var(--u) * 557); width: calc(var(--u) * 616); }
.pj-xx { left: calc(var(--u) * 870); top: calc(var(--u) *-100); width: calc(var(--u) * 370); }
.pj-numbers {
  right: calc(var(--u) *33);
  top: calc(var(--u)*-100);
  width: calc(var(--u) * 370);
  filter: invert(1); /* source art is black; blueprint has it white */
}
.pj-hazard-landscape { left: 0; top: calc(var(--u) * 803); width: calc(var(--u) * 724); }
.pj-hazard-portrait { left: calc(var(--u) * 672); top: calc(var(--u) * 678); width: calc(var(--u) * 540); }
.pj-runes { 
  right: calc(var(--u) *-530); 
  top: calc(var(--u) * 1250); 
  width: calc(var(--u) * 950); 
}
.pj-arrow { 
  left: calc(var(--u) * 727); 
  top: calc(var(--u) * 1430); 
  width: calc(var(--u) * 103); 
}

/* The two pixel-art tiles stack and must move together, so they share
   one parallax wrapper. Bottom edge sits exactly on .pj-hazard-landscape's
   top edge (grid y 
   803): this stack's own height at width 413 is two
   413x310 images stacked = width * (2 * 310/413) = 413 * 620/413 = 620
   grid units, so top = 803 - 620 = 183. */
.pj-pixels { left: calc(var(--u) * 745); top: calc(var(--u) * -25); width: calc(var(--u) * 470); }
.pj-pixels img { width: 100%; height: auto; }

/* Pink and black rects are plain divs, drawn vertical (the 434x92
   landscape rect art turned 90 degrees). */
.pj-pink-rect { 
  background: var(--color-accent-pink); 
  top: calc(var(--u)*365); 
  width: calc(var(--u) * 98); 
  height: calc(var(--u) * 400); 
}
.pj-pink-rect-l { left: calc(var(--u) * 950); }
.pj-pink-rect-r { left: calc(var(--u) * 1125); top: calc(var(--u)*1200)}
.pj-black-rect {
  background: #000;
  left: calc(var(--u) * 890);
  top: calc(var(--u)*365);
  width: calc(var(--u) * 98);
  height: calc(var(--u) * 400); 
}
/* Logo plus the pink box under its top (kanji) part only -- one wrapper,
   so the box travels with the logo. */
.pj-logo {
  left: calc(var(--u) * 811);
  top: calc(var(--u) * 774);
  width: calc(var(--u) * 316);
  height: calc(var(--u) * 356);
}
.pj-logo-box {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--u) * 272);
  background: var(--color-accent-pink);
}
.pj-logo img {
  position: absolute;
  left: calc(var(--u) * 44);
  top: calc(var(--u) * 49);
  width: calc(var(--u) * 199);
  height: auto;
}

/* Horizontal frame: four corner brackets + center circle, drawn with
   gradients so it scales with --u (the 4 corner PNGs are portrait art). */
.pj-frame {
  --t: calc(var(--u) * 3);
  --ax: calc(var(--u) * 46);
  --ay: calc(var(--u) * 24);
  left: calc(var(--u) * 795);
  top: calc(var(--u) * 1580);
  width: calc(var(--u) * 190);
  height: calc(var(--u) * 77);
  background:
    linear-gradient(#000, #000) 0 0 / var(--ax) var(--t) no-repeat,
    linear-gradient(#000, #000) 0 0 / var(--t) var(--ay) no-repeat,
    linear-gradient(#000, #000) 100% 0 / var(--ax) var(--t) no-repeat,
    linear-gradient(#000, #000) 100% 0 / var(--t) var(--ay) no-repeat,
    linear-gradient(#000, #000) 0 100% / var(--ax) var(--t) no-repeat,
    linear-gradient(#000, #000) 0 100% / var(--t) var(--ay) no-repeat,
    linear-gradient(#000, #000) 100% 100% / var(--ax) var(--t) no-repeat,
    linear-gradient(#000, #000) 100% 100% / var(--t) var(--ay) no-repeat;
}
.pj-frame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--u) * 24);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: var(--t) solid #000;
  border-radius: 50%;
}

/* measure_b, mirrored so its bracket measures what is to its left. Only
   the artwork is flipped; the digit labels stay readable. */
.pj-measure {
  display: flex;
  flex-direction: column;
  align-items: center;
  left: calc(var(--u) * 1015);
  top: calc(var(--u) * 1400);
  width: calc(var(--u) * 35);
  height: calc(var(--u) * 230);
}
.pj-measure img,
.pj-measure .orn-measure-line {
  transform: scaleX(-1);
}
.pj-measure .orn-measure-digit {
  left: 50%;
}

/* ==========================================================================
   Services accordion
   ========================================================================== */

.services {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-5);
  /* height: 260px; */
  height: 360px;
  max-width: 60rem;
}

.service {
  position: relative;
  container-type: inline-size;
  flex: 1 1 0%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: #9a9a9a;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: flex-grow 0.45s ease;
}

/* Clicking a card keeps it open (persists via .is-active); hover
   previews the same expansion without needing to click. */
.service.is-active,
.service:hover,
.service:focus-visible {
  flex-grow: 5;
}

.service-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #9a9a9a;
  /* Closed-state preview is deliberately darker and lower-contrast than
     the real footage, so the big white .service-title overlay doesn't
     fight with bright highlights in the image. Tweak
     --service-media-brightness / --service-media-contrast on .services,
     .service, or :root to taste (1 = unchanged). The open/hovered state
     below reverts to full brightness and contrast, since the title is
     gone by then and legibility isn't a concern anymore. */
  filter: grayscale(1)
    brightness(var(--service-media-brightness, 1))
    contrast(var(--service-media-contrast, 1));
  transition: filter 0.4s ease;
}

.service-media-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-accent-pink);
  mix-blend-mode: screen;
  opacity: .1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.service.is-active .service-media,
.service:hover .service-media,
.service:focus-visible .service-media {
  filter: grayscale(0) brightness(1) contrast(1);
}

.service.is-active .service-media-tint,
.service:hover .service-media-tint,
.service:focus-visible .service-media-tint {
  opacity: 0;
}

.service-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.service-frame .frame-b-corner {
  width: 22px;
}

img.service-frame-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  width: 18px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Reticule fades away on hover/focus, same as when clicked/pinned open. */
.service.is-active .service-frame-center,
.service:hover .service-frame-center,
.service:focus-visible .service-frame-center {
  opacity: 0;
}

/* Big overlay title, closed-state only: a large white word split across
   lines (no hyphen) filling the collapsed card. Fades and slides out
   toward whichever edge the card actually expands into on hover/click --
   every card but the last grows to the right (pushing siblings right),
   so their title exits right; the last card's own left edge is what
   moves as it grows, so its title exits left instead. */
.service-title {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: var(--space-3);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.service-title-line {
  color: #ffffff;
  font-weight: 1000;
  /* Scales with the card's own width (container query units), not just
     the viewport -- so it stays proportional whether this card is one
     of four equal columns on a wide screen or a cramped narrow one.
     (There was a stray fixed "font-size: 6rem" here overriding this
     entirely, which is why big text overflowed on narrow cards.) */
  font-size: 40cqw;
  line-height: 0.95;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Squeezed-narrow closed cards (a sibling is expanded) center the title
   block as a whole instead of each line individually -- individually
   centering made ragged lines (e.g. a short last chunk) visibly jump
   sideways relative to the lines above it. Shrinking .service-title to
   max-content and centering *that* keeps every line's left edge shared
   with the others, while the shared block sits centered in the card.
   Matches the JS chunk-size breakpoint that drops to 2-3 letters/line. */
@container (max-width: 160px) {
  .service-title {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: max-content;
    padding-inline: 0;
  }
}

.service.is-active .service-title,
.service:hover .service-title,
.service:focus-visible .service-title {
  opacity: 0;
  transform: translateX(50px);
}

.service:last-child.is-active .service-title,
.service:last-child:hover .service-title,
.service:last-child:focus-visible .service-title {
  transform: translateX(-50px);
}

.service-label {
  position: absolute;
  top: var(--space-2);
  left: var(--space-3);
  z-index: 3;
  padding-inline: 0.3em;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #ffffff;
  background: var(--color-accent-pink);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Only visible while the card is open (hovered or clicked) -- the big
   .service-title covers the closed state instead. */
.service.is-active .service-label,
.service:hover .service-label,
.service:focus-visible .service-label {
  opacity: 1;
}

.service-info {
  position: absolute;
  width: 200px;
  right: var(--space-3);
  bottom: var(--space-2);
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-fg);
  opacity: 0;
  transition: opacity 0.3s ease 0.15s;
}

.service-info-text {
  highlight: var(--color-accent-pink)
}

.service.is-active .service-info,
.service:hover .service-info,
.service:focus-visible .service-info {
  opacity: 1;
}

.service-info-dot {
  flex-shrink: 0;
}

.hl {
  background: var(--color-accent-pink);
  color: #ffffff;
  padding-inline: 0.15em;
  font-weight: regular;
}

/* A highlighted phrase that is also a link (e.g. "more work in our gallery")
   flips to black on hover. */
a.hl:hover,
a.hl:focus-visible {
  background: var(--color-fg);
}

.hl-italic {
  font-style: italic;
}
/* ==========================================================================
   Ornaments
   ========================================================================== */

/* .ornament-left / .ornament-right are shared hooks reused across page
   sections (e.g. #intro, #about) -- same pattern as .section-content /
   .section-heading above. They only carry the general positioning
   mechanics (absolute, size, aspect-ratio); each section supplies its
   own specific placement below, under its own ID, since "aligned to
   the hero-connector arrow" (intro) or wherever #about's ornament
   should sit are section-specific landmarks, not general defaults. */
.ornament-right,
.ornament-left {
  position: absolute;
  top: var(--space-1);
  width: clamp(220px, 24vw, 380px);
  aspect-ratio: 424 / 540;
}

#intro .ornament-right {
  left: clamp(70%, 60vw, 38rem);
}

#intro .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

#about .ornament-right {
  left: clamp(70%, 60vw, 38rem);
}

#about .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

.orn-a {
  width: 60%;
  right:0;
  top:-40%;
}

#about .ornament-left .orn-a {
  height: auto;
  width: 74%;
  margin-right: 4.5vw;
}

#about .ornament-left .orn-bg {
  margin-right: 0vw;
  margin-left: -20vw;
  margin-top: -11vh;
}

#about .ornament-left .image-stack-wrapper {
  z-index: 3;
  display: block;
  top: -7vh;
}

#about .ornament-left .image-stack-wrapper .orn-stripes {
    transform: rotate(-90);
}

#about #orn-a-b {
  top:78%;
}

/* Dynamic measuring stick: end caps + a tiled line filling whatever
   space is left, with a center chip whose "11 / 6A" digits used to be
   baked into the image (measure_a_center.png) -- measure_a_center_blank.png
   is the same graphic with that text pixels erased, leaving just the
   continuous ruler line, so real text can be layered on top instead. */
.orn-measure {
  display: flex;
  flex-direction: column;
  align-items: center;
  top: 45%;
  right:-10%;
  height: 25%;
  width: 5%;
}

#about #measure_b {
  top: 68%;
  height: 70%;
}

.orn-measure-end {
  width: 100%;
  height: auto;
  flex-shrink: 0;
}

.orn-measure-line {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  background-image: url("../img/templates/tetsuo/assets/measure_a_line.png");
  background-repeat: repeat-y;
  background-size: 100% auto;
}

.orn-measure-center {
  position: relative;
  width: 100%;
  aspect-ratio: 35 / 78;
  flex-shrink: 0;
  container-type: inline-size;
}

.orn-measure-center img {
  width: 100%;
  height: 100%;
}

.orn-measure-digit {
  position: absolute;
  right: 10px;
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 55cqw;
  line-height: 1;
}

.orn-measure-digit-a {
  top: 12%;
  color: var(--color-bg);
  background-color: var(--color-accent-pink);
  padding:2px;
}

.orn-measure-digit-b {
  top: 43%;
  color: var(--color-fg);
}

#about #measure_b .orn-measure-digit-a {
  color: var(--color-fg);
  background:none;
}

.orn-b {
  width: 65%;
}
#about .orn-b {
  left: 145%;
  top: 23%
}

.orn-logo {
  width: 38%;
}

#about .orn-logo {
  left: 107%;
  top: 43%;
}

.orn-dots {
  right:-5px;
  letter-spacing: 0em;
  color: var(--color-fg);
  font-size: 3vw;
  top:61%;
}

#intro .orn-dots {
  right: -74vw !important;
  top: 51%;
  position: absolute !important;
}

#about .orn-dots {
  top: 127%;
  left: 110%;
}

.orn-layer {
  position: absolute;
  /* --parallax-bias is a static per-element offset (not touched by JS)
     used to reverse a layer's scroll direction (negative data-depth)
     while keeping it pinned to its original spot at one specific
     scroll position -- see the comment on the reversed layers in
     #about .ornament-left for the math. */
  transform: translate(var(--spread-x, 0px), calc(var(--parallax-y, 0px) + var(--spread-y, 0px) + var(--parallax-bias, 0px)));
}

.orn-numbers {
  top: 0;
  left: 0;
  width: 74%;
  z-index: 1;
}

.orn-bg {
  top: 27%;
  left: 76%;
  width: 70%;
  z-index: 2;
}

.orn-stripes {
  top: 3vh;
  left: clamp(90%, 17vw, 17vw);
  width: 85%;
  z-index: 3;
}

#about .orn-stripes {
  left:22%;
  top:86%;
  z-index: 0;
  transform: rotate(90deg);
}

.orn-arrow-left {
  top: 110%;
  left: 8%;
  width: 20%;
  z-index: 4;
}

.orn-digits {
  top: 108%;
  left: 55%;
  z-index: 4;
  font-family: var(--font-body);
  font-weight: bolder;
  font-size: 300%;
  line-height: 1.3;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

#about .orn-digits {
  left:135%;
  top: 95%;
}

#about .ornament-left .orn-digits {
  color: #ffffff;
  left: 68%;
  top: 113%
}

.orn-digits-row {
  display: block;
  width: max-content;
  font-variant-numeric: tabular-nums;
  padding-inline: 0.2em;
}

.orn-digits-row + .orn-digits-row {
  margin-top: 0.2em;
}

.orn-chevron {
  top: 123%;
  left: 127%;
  width: 17%;
  z-index: 4;
}

.orn-circle {
  top: 23%;
  width: 28%;
}

#about .orn-circle{
  left: 58%;
}

#about #circle_black {
  left: 70%
}

.orn-frame {
  top:100%;
  left: 139%;
  width: 17%;
  aspect-ratio: 80 / 191;
  z-index: 4;
  --corner-open: calc(
    (1 - clamp(0, var(--intro-progress, 0) + var(--progress-offset, 0), 1)) * 28px
  );
}

/* Lock-in order: top-left first, bottom-right second, then top-right,
   then bottom-left last (locks exactly at --intro-progress: 1, i.e. the
   #intro position itself). */
.orn-frame-tl {
  --progress-offset: 0.2;
}

/* 2x2 grid: .orn-frame-tl keeps the original anchor position above;
   the other three are offset by one cell-width/height + a gap, which
   widens further as --scroll-progress (set by JS) increases. */
.orn-frame-tr {
  left: 155%;
  --progress-offset: 0.06;
  --spread-x: calc(var(--scroll-progress, 0) * 20px);
}

.orn-frame-bl {
  top: 125%;
  --progress-offset: 0;
  --spread-y: calc(var(--scroll-progress, 0) * 26px);
}

.orn-frame-br {
  top: 125%;
  left: 155%;
  --progress-offset: 0.12;
  --spread-x: calc(var(--scroll-progress, 0) * 20px);
  --spread-y: calc(var(--scroll-progress, 0) * 26px);
}

.frame-b-corner {
  position: absolute;
  width: 36%;
  height: auto;
}

/* --frame-rotate spins each corner glyph in place (about its own center,
   after the splay translate) without touching the splay math above --
   lets .orn-frame-h reuse the exact same corners/center rotated 90deg
   for a landscape frame instead of redrawing new corner art. */
.frame-b-tl { top: 0; left: 0; transform: translate(calc(-1 * var(--corner-open, 0px)), calc(-1 * var(--corner-open, 0px))) rotate(var(--frame-rotate, 0deg)); }
.frame-b-tr { top: 0; right: 0; transform: translate(var(--corner-open, 0px), calc(-1 * var(--corner-open, 0px))) rotate(var(--frame-rotate, 0deg)); }
.frame-b-bl { bottom: 0; left: 0; transform: translate(calc(-1 * var(--corner-open, 0px)), var(--corner-open, 0px)) rotate(var(--frame-rotate, 0deg)); }
.frame-b-br { bottom: 0; right: 0; transform: translate(var(--corner-open, 0px), var(--corner-open, 0px)) rotate(var(--frame-rotate, 0deg)); }

.frame-b-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30%;
  transform: translate(-50%, -50%);
}

/* .orn-frame-h-grp is the positioned box within .ornament-left; the 3
   .orn-frame-h frames inside it are laid out with a normal flex column
   + gap instead of each guessing its own hardcoded top offset. */
.orn-frame-h-grp {
  top: 60%;
  right: calc(11%/80*100);
  height: 100%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4%;
}

.orn-frame-h-grp .orn-frame-h {
  position: relative;
  top: auto;
  left: auto;
  height: 11%;
  aspect-ratio: 100 / 80;
  --corner-open: 28px;
  --frame-rotate: 90deg;
}

/* Corner/center art are sized as a % of their own .orn-frame box
   elsewhere, which is fine when every box is proportioned the same --
   but .orn-frame-h's box is a different shape (landscape vs portrait),
   so that same % would render noticeably thicker/heavier strokes here.
   Pinning both to the same absolute px .orn-frame renders at (~23px /
   ~19px, at .ornament-left's typical width) keeps the line weight and
   "feel" identical between the vertical and horizontal frames. */
.orn-frame-h .frame-b-corner {
  width: 23px;
}

.orn-frame-h .frame-b-center {
  width: 19px;
}

/* ---- #testimonials, left ---- (rearranged to follow the Photoshop mockup) */
#testimonials .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

#testimonials .orn-measure {
  top: 25%;
  right: -9vw;
  height: 36.4%;
}

#testimonials #measure_b {
  top: 62.2%;
  height: 27.7%;
}

#testimonials #measure_b .orn-measure-digit-a {
  color: var(--color-fg);
  background: none;
}

/* Frames are sized natively (their box), never with transform:scale --
   scaling resamples their 1px strokes into a blur. */
#testimonials .orn-frame-h-grp {
  right: 2vw;
  left:auto;
  top: 20%;
  gap: 7%;
}

#testimonials .orn-frame-h {
  height: 9.3%;
  aspect-ratio: 1.02 / 1;
}

#testimonials .orn-stripes {
  left: 22%;
  top: 52.8%;
  z-index: 0;
}

#testimonials #orn-a-b {
  top: 51%;
  width: 54%;
}

#testimonials .ornament-left .orn-digits {
  color: #ffffff;
  left: 68%;
  top: 85.5%;
}

/* ---- #testimonials, right: the big layered ornament ---- */
#testimonials .ornament-right {
  top: 0;
  left: calc(8vw + 61.5rem);
}

/* One big layered ornament, built from the existing assets, following the
   Photoshop layout (2026-10-06). Every number below is a pixel position in
   that layout (the reference image), and --u converts them to real pixels:
   1.4px per unit (0.0875rem, so it follows the root font size like the text).
   Layers, bottom to top: XX, the big pink block with runes, the arrow strip
   (cropped), two stacked pixel patterns, the pink rect, the date digits
   (live text, so they scramble like the other ornaments), then the white
   stripe block twice (over the rect, and over the pixels/XX at the bottom). */
#testimonials .mega-orn {
  --u: 0.0875rem;   /* 1.4px at the default 16px root */
  position: absolute;
  /* Left edge sits just right of the text column (your layout puts the
     pixel pattern about 8px off the card edge); the pink rect starts
     25vh below the heading, which is where it is in the layout (the heading
     is vh-sized, so this tracks it). */
  left: -16px;
  top: calc(25vh - var(--u));
  width: calc(var(--u) * 388);
  height: calc(var(--u) * 870);
  pointer-events: none;
}

.mega-orn > * {
  position: absolute;
}

.mega-orn img {
  display: block;
  max-width: none;
}

.mg-xx   { left: calc(var(--u) * 47);  top: calc(var(--u) * 549); width: calc(var(--u) * 251); height: calc(var(--u) * 310); }
.mg-bg   { left: calc(var(--u) * 82);  top: calc(var(--u) * 206); width: calc(var(--u) * 259); height: calc(var(--u) * 387); }
.mg-arrow { left: calc(var(--u) * 169); top: calc(var(--u) * 377); width: calc(var(--u) * 40); height: calc(var(--u) * 85); overflow: hidden; }
.mg-arrow img { position: absolute; left: 0; top: 0; width: calc(var(--u) * 40); height: calc(var(--u) * 168); }
.mg-pix1 { left: calc(var(--u) * 2);   top: calc(var(--u) * 606); width: calc(var(--u) * 173); height: calc(var(--u) * 130); }
.mg-pix2 { left: calc(var(--u) * 2);   top: calc(var(--u) * 739); width: calc(var(--u) * 173); height: calc(var(--u) * 130); }
.mg-rect { left: calc(var(--u) * 144); top: calc(var(--u) * 1);   width: calc(var(--u) * 241.5); height: calc(var(--u) * 133); background: var(--color-accent-pink); }
.mg-stripes-a { left: calc(var(--u) * 102); top: calc(var(--u) * 1);   width: calc(var(--u) * 284); height: calc(var(--u) * 234); }
.mg-stripes-b { left: calc(var(--u) * 61);  top: calc(var(--u) * 526); width: calc(var(--u) * 284); height: calc(var(--u) * 234); }

.mega-orn .mg-digits {
  left: calc(var(--u) * 148);
  top: calc(var(--u) * 6);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: bolder;
  font-size: calc(var(--u) * 25.5);
  line-height: 1.3;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.mega-orn .mg-digits .orn-digits-row {
  display: block;
  width: max-content;
  font-variant-numeric: tabular-nums;
}

.mega-orn .mg-digits .orn-digits-row + .orn-digits-row {
  margin-top: 0.2em;
}

/* ---- #studio ---- (boxes are empty for now: add pieces here, the same way as above) */
#studio .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

#studio .ornament-right {
  top: 0;
  left: calc(8vw + 61.5rem);
}

/* ---- the call to action (#start) ---- (empty for now, same as #studio) */
#start .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

#start .ornament-right {
  top: 0;
  left: calc(8vw + 61.5rem);
}

/* ----- Pink traces: circuit lines that run from the ornaments down the margins into the CTA button -----
   All SVG: every straight run is a small inline <svg> holding one <line> (percent
   coordinates, so it stretches to any length), every 45-degree corner is a fixed-size
   <svg class="trace-corner"> (so the angle is always exact). CSS only decides where each
   svg sits and how long it is. Everything is aria-hidden, sits behind the ornaments
   (z-index -1) and needs the margin beside the column, so it is hidden below 75rem.
   - rails run just outside the 60rem content column (1.5rem out, same on both sides);
   - #testimonials: a "turn" leaves the left ornament (a horizontal run from the window edge,
     a corner, then down);  #studio / #start: the rail continues down;
   - the .cta-trace pieces inside the CTA button finish each route with a corner and a short
     horizontal run into the side of the button.
   Restyle all of it in one place (.trace line / .trace-corner path below: colour, weight,
   dashes, a draw-on animation...). To move a route: change `left` / `top` / `bottom` here.
   To add a branch: copy a .trace element into any <section>. */
:root {
  --trace-corner: 1.5rem;
  --trace-x: 1.5rem;                  /* rail distance from the column edge */
  /* --trace-color: var(--color-accent-pink); */
    --trace-color: var(--color-accent-pink);
}

.trace,
.cta-trace {
  position: absolute;
  pointer-events: none;
  color: var(--trace-color);
}

.trace {
  z-index: -1;
}

.trace svg,
.cta-trace svg {
  position: absolute;
  overflow: visible;
}

/* one stroke style for every line and corner */
.trace line,
.cta-trace line,
.trace-corner path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.trace-corner {
  width: var(--trace-corner);
  height: var(--trace-corner);
}

.trace-corner path {
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}

.tr-v { width: 1px; }
.tr-h { height: 1px; }

/* a vertical rail that overshoots into the gaps between sections (identical
   overlapping lines are invisible), so the line is continuous down the page.
   NB: an <svg> is a replaced element, so top+bottom do NOT stretch it (it would
   fall back to 150px): the wrapper div is stretched by top/bottom and the svg
   inside takes height:100%. Same for every stretching svg below. */
.trace-rail {
  top: -8rem;
  bottom: -8rem;
  width: 1px;
}

.trace-rail .tr-v {
  left: 0;
  top: 0;
  height: 100%;
}

.trace-l { left: calc(var(--indent) - var(--trace-x)); }
.trace-r { left: calc(var(--indent) + 60rem + var(--trace-x)); }

/* the last rail stops inside the button's own vertical piece (see .cta-trace) */
.trace-rail.trace-end {
  bottom: 13rem;
}

.trace-rail.trace-r.trace-end {
  top: -1rem;
}

/* a turn: horizontal run in from the window edge, corner, rail down */
.trace-turn {
  top: calc(100% - 3rem);
  bottom: -8rem;
  width: 1px;
}

.trace-turn .tr-h {                   /* the run, from the window edge to the corner */
  top: 0;
  right: var(--trace-corner);
  width: calc((100vw - 75rem) / 2 + 24px + var(--indent) - var(--trace-x) - var(--trace-corner));
}

.trace-turn .tr-v {                   /* the rail below the corner */
  left: 0;
  top: var(--trace-corner);
  height: calc(100% - var(--trace-corner));
}

.trace-turn .trace-corner {
  left: calc(-1 * var(--trace-corner));
  top: 0;
}

/* the entry into the button: vertical piece, corner, horizontal run to the button's edge.
   Children of .cta-button, so they fade in with it and stay attached at any width:
   from the column-side rail (1.5rem outside the 60rem column) to the button is
   (60rem - button width) / 2 + 1.5rem, and 50% here is half the button's width. */
.cta-trace {
  bottom: 50%;
  height: 12rem;
  width: calc(30rem - 50% + var(--trace-x));
}

.cta-trace-l { right: 100%; }
.cta-trace-r { left: 100%; }

.cta-trace .tr-v {
  top: 0;
  height: calc(100% - var(--trace-corner));
}

.cta-trace .tr-h {
  bottom: 0;
  left: var(--trace-corner);
  width: calc(100% - var(--trace-corner));
}

.cta-trace-l .tr-v { left: 0; }
.cta-trace-l .trace-corner { left: 0; bottom: 0; }

.cta-trace-r .tr-v { right: 0; }
.cta-trace-r .tr-h { left: 0; }
.cta-trace-r .trace-corner { right: 0; bottom: 0; transform: scaleX(-1); }

/* ----- Section-by-section traces, drawn from the design sketches -----
   Each .trace-art is one <svg> whose viewBox uses the SKETCH's own pixel coordinates
   (sketch = a 1864px-wide window, 1:1), so the numbers inside the svg can be read straight
   off the drawing; CSS only pins the svg to the right place on the page.
   Anchors: left traces hang off the window's left edge (--trace-win-left, where the hugging
   left ornaments sit); right traces hang off the section's left edge (the right ornaments are
   placed from there); vertical y comes from the section's top (intro: 7vh below the connector)
   or, for the lower pieces, from the About section's top. The "-down" pieces are plain
   stretching verticals that join two groups across the gap between sections
   (the About section starts 9vh below the intro). Pink, same weight as the ornament lines. */
:root {
  --trace-weight: 1px;
  --trace-win-left: calc(-1 * (max(0px, (100vw - 75rem) / 2) + 24px) - var(--trace-shift));
  /* The left traces must not run into the text. Where the text column starts (window frame), how far the traces reach to the
     right (the upper strands end at x 213), and the distance to keep (150px: the distance in the 1622px-wide design screenshot).
     When the window narrows and the text gets closer than that, the whole left trace is pushed left by the difference
     (off the window's edge, like the ornaments); at 1622px and wider it doesn't move. Change --trace-text-gap to taste. */
  --trace-sec-left: calc(max(0px, (100vw - 75rem) / 2) + 24px);   /* the page column's left edge, in window coordinates */
  --trace-text-left: calc(var(--trace-sec-left) + var(--indent));
  --trace-text-gap: 150px;
  --trace-reach: 213px;
  --trace-shift: max(0px, calc(var(--trace-reach) - var(--trace-text-left) + var(--trace-text-gap)));
}

.trace-art {
  overflow: visible;
}

.trace-art path {
  fill: none;
  stroke: currentColor;
  stroke-width: var(--trace-weight);
  stroke-linejoin: miter;
  stroke-linecap: butt;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}

.trace-art .trace-pad {
  fill: currentColor;
  stroke: none;
}

.trace-intro-r-down .tr-v {
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
}

.trace-intro-r-down line {
  stroke: currentColor;
  stroke-width: var(--trace-weight);
}

/* intro, left, lower part: one fixed-size group, anchored to the About ornament's pink bar (126px above the
   About section's top, which starts 9vh below the intro). Window-left frame. */
.trace-intro-l {
  left: var(--trace-win-left);
  bottom: calc(126px - 9vh);
  width: 260px;
  height: 484px;
}

/* intro, left, upper part: the two strands under the header; the only stretching piece, from the connector's
   bottom edge (7vh above the intro) to the top of the group above. */
.trace-intro-l-top {
  left: calc(var(--trace-win-left) + 183px);
  width: 30px;
  top: -7vh;
  bottom: calc(607px - 9vh);          /* 3px of overlap into the group below: no seam */
}

/* The line that follows the About ornament's pink bar. The bar (ornament_a) sits at -186px (relative to the About section's top)
   and is 532px tall, so its centre is at +80px; this layer's svg has its centre at the same height (top -120, height 400) and the
   same parallax depth (.08), which makes the parallax script move it exactly like the bar. The wrapper, in the window-left frame,
   starts where the fixed trace ends (sketch y 671 = -257px) and clips everything above that. The line inside runs from far above
   to 40px inside the bar's top edge (-146px), at x 77. */
.trace-intro-l-link {
  /* Pushed left together with the rest of the left trace (--trace-win-left includes --trace-shift): the pink bar it ends in runs off the
     window's left edge at the widths where the trace is pushed, so it is always still under the line. Sketch: line at x 77 (wrapper + 17). */
  left: calc(var(--trace-win-left) + 60px);
  top: -257px;
  width: 40px;
  height: 300px;
  overflow: hidden;
}

.trace-intro-l-link > svg {
  left: 0;
  top: 137px;                           /* -120px (svg top) - -257px (wrapper top) */
  width: 40px;
  height: 400px;
}

.trace-intro-l-top .tr-v2 {
  left: 0;
  top: 0;
  width: 30px;
  height: 100%;
}

.trace-intro-l-top line {
  stroke: currentColor;
  stroke-width: var(--trace-weight);
}

.trace-intro-r-down {
  width: 3px;
}

/* intro, right: from the pink block (section frame: sketch x - 356, y - 229) */
.trace-intro-r {
  left: 1344px;
  top: 411px;
  width: 110px;
  height: 200px;
}

.trace-intro-r-down {
  left: calc(1613px - 356px - 1.5px);
  top: calc(800px - 229px);
  bottom: calc(-9vh + 10px);       /* ends 10px above the About section = sketch y 918, where the 45deg diagonal starts */
}

/* the layers below copy the box (in section coordinates) of the ornament piece they hang from: stripes 1148/38 323x408, pink block 1095/139 266x454 */
.trace-intro-r-up {
  left: 1148px;
  top: 250px;
  width: 323px;
  height: 202px;
  overflow: hidden;                 /* bottom = sketch y 681 (where the diagonals leave the verticals) */
}

.trace-intro-r-up > svg {
  left: 0;
  top: -212px;                      /* 38 - 250 */
  width: 323px;
  height: 408px;
}

.trace-intro-r-bg {
  left: 1200px;
  top: 400px;
  width: 100px;
  bottom: calc(-9vh + 10px);        /* same end as the fixed vertical: 10px above the About section, where the diagonal starts */
  overflow: hidden;
}

.trace-intro-r-bg > svg,
.trace-about-r-circle > svg,
.trace-about-r-bar > svg,
.trace-about-r-logo > svg {
  max-width: none;                  /* the wrappers are 0 wide */
}

.trace-intro-r-bg > svg {
  left: calc(1095px - 1200px);
  top: calc(139px - 400px);
  width: 266px;
  height: 454px;
}

/* About, right: the lower half, around the circles (sketch y - 928 from the About section's top) */
.trace-about-r {
  left: calc(1490px - 356px);
  top: calc(950px - 928px);
  width: 250px;
  height: 195px;
}

/* About, right: the black circle's box in About coordinates */
.trace-about-r-circle {
  left: calc(1428px - 356px);
  top: 106px;                       /* sketch y 1034: where the diagonal ends */
  width: 107px;
  height: 30px;
  overflow: hidden;
}

.trace-about-r-circle > svg {
  left: 0;
  top: 14px;                        /* 120 - 106 */
  width: 107px;
  height: 106px;
}

/* the dark pink bar (box 1357/120, 247x424): the diagonal ends at x 1366 (the 9px gap between logo and bar), y 171; wrapper starts there */
.trace-about-r-bar {
  left: calc(1366px - 20px);
  top: 171px;
  width: 60px;
  height: 200px;
  overflow: hidden;
}

.trace-about-r-bar > svg {
  left: calc(1357px - 1346px);
  top: calc(120px - 171px);
  width: 247px;
  height: 424px;
}

/* the logo (box 1213/216, 144x219): wrapper starts at the end of the fixed diagonal (sketch y 1098 = 170) */
.trace-about-r-logo {
  left: calc(1609px - 356px - 20px);
  top: 170px;
  width: 40px;
  height: 260px;
  overflow: hidden;
}

.trace-about-r-logo > svg {
  left: calc(1213px - 1233px);
  top: 46px;                        /* 216 - 170 */
  width: 144px;
  height: 219px;
}


/* ----- Project-card traces (see the comment in the HTML above the symbols) -----
   Coordinates are the sketch's: x 513 = the cards' left edge, card top = y 351 (card 1) / 759 (card 2), so every svg is placed
   relative to ITS card and the pattern simply repeats down the list (card pitch 408 = --project-height 360 + gap 48). */
.case-trace-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.case-trace {
  max-width: none;                  /* the global svg { max-width: 100% } would squeeze the long lead line */
  left: -513px;
  width: 520px;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--trace-weight);
  stroke-linejoin: miter;
  overflow: visible;
  shape-rendering: geometricPrecision;
  z-index: auto;                    /* above the L's opaque white layer and the pink bars (both z -1), but still under the hazard-stripe connector of the even cards (its ::after comes later in the same card) */
}

.case-trace-a { top: -211px; height: 790px; }     /* viewBox y 140, card top 351 */
.case-trace-b { top: 61px; height: 200px; }       /* viewBox y 820, card top 759 */


/* odd cards draw A, even cards draw B; the last card has no next card to run to (the end piece is still to come) */
.case-trace-end,
.case-trace-lead,
.case-trace-ext,
.case-card:nth-child(odd) .case-trace-b,
.case-card:nth-child(even) .case-trace-a,
.case-card:last-child .case-trace {
  display: none;
}

/* the last card shows the end piece instead (sketch: card left x 501, card top y 355, viewBox y 100) */
.case-trace-end {
  left: -501px;
  top: -255px;
  width: 360px;
  height: 800px;
}

.case-card:last-child .case-trace-end {
  display: block;
}

/* lead: the first A is fed from the window's left edge (a 45deg line from far off to the left); ext: an A that is followed by another A
   (so not by the end piece) carries its outer line on down to it */
.case-card:first-child .case-trace-lead {
  display: block;
  left: -2013px;
  top: -1515px;
  width: 1510px;
  height: 1500px;
}

.case-card:nth-child(odd):nth-last-child(n+4) .case-trace-ext {
  display: block;
  left: -513px;
  top: 549px;
  width: 40px;
  height: 260px;
}

.case-trace-defs symbol {
  overflow: visible;
}

/* joins the cases ornament's pillars to the pink digits box of the next section; the paths are written by trace-link.js */
.trace-pj-link,
.trace-about-link,
.trace-cta-link {
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--trace-weight);
  stroke-linejoin: miter;
  shape-rendering: geometricPrecision;
}

.trace-about-link {
  z-index: auto;                    /* above the L's opaque white layer */
}

@media (max-width: 75rem) {
  .trace,
  .cta-trace {
    display: none;
  }
}

/* Right-hand ornaments need the margin to the right of the 60rem column, which
   is gone below 75rem. */
@media (max-width: 75rem) {
  #testimonials .ornament-right,
  #studio .ornament-right,
  #start .ornament-right {
    display: none;
  }
}

@media (max-width: 900px) {
  .ornament-right,
  .ornament-left {
    display: none;
  }
}


#testimonials .section-content {
  margin-top: 10vh;
}

/* ==========================================================================
   Call to action ("Let's make your project")
   Big pink bar -> /contact, with the double-chevron arrow from the design
   set nudging forward on a loop. The bar wipes in from the left when the
   section first scrolls into view (cta.js adds .is-in). Contact line below
   uses the same [ bracketed ] style as the case-card tags.
   ========================================================================== */
.cta .section-heading {
  max-width: 60rem;
  margin-bottom: var(--space-2);
}

.cta .section-body {
  max-width: 60rem;
}

.cta .section-content {
  margin-bottom: var(--space-6);
}

/* Centred in the same 60rem column as the case cards, with extra air
   around the button. */
.cta-row {
  margin-top: var(--space-6);
  width: 60rem;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* The button is built from the site's own ornaments instead of a solid
   block: frame_b corner brackets that start open and close in around it
   when the section scrolls into view (cta.js adds .is-in) and a pink tab
   with the double chevron. On hover
   the pink floods the label side and the brackets breathe outward. */
.cta-button {
  --corner-open: 28px;
  --cta-pad: var(--space-4);
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: var(--space-4);
  padding: var(--cta-pad) 0 var(--cta-pad) var(--space-5);
  max-width: 100%;
  color: var(--color-fg);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.cta.is-in .cta-button {
  --corner-open: 0px;
  opacity: 1;
}

.cta-button .frame-b-corner {
  width: 22px;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cta-button:hover,
.cta-button:focus-visible {
  --corner-open: 8px;
}

.cta-button:focus-visible {
  outline: none;
}

.cta-frame {
  position: absolute;
  inset: 0;
  /* Above the pink tab so its corner brackets stay visible. */
  z-index: 2;
  pointer-events: none;
}

.cta-button-label {
  position: relative;
  z-index: 1;
  align-self: center;
  font-weight: 800;
  font-size: clamp(1.4rem, 3.6vh, 2.2rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.25s ease;
}

/* Pink tab: floods leftward over the label on hover. */
.cta-button-go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(4.5rem, 10vh, 6rem);
  background: var(--color-accent-pink);
  margin-block: calc(-1 * var(--cta-pad));
}

/* Hover flood: the whole button's body fills pink from the tab leftward. */
.cta-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-accent-pink);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cta-button:hover::before,
.cta-button:focus-visible::before {
  transform: scaleX(1);
}

.cta-button:hover .cta-button-label,
.cta-button:focus-visible .cta-button-label {
  color: #ffffff;
}

.cta-button-arrows {
  position: relative;
  width: 55%;
  height: auto;
  animation: cta-nudge 1.6s ease-in-out infinite;
}

.cta-button:hover .cta-button-arrows,
.cta-button:focus-visible .cta-button-arrows {
  animation-duration: 0.7s;
}

@keyframes cta-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

.cta-line {
  margin-top: var(--space-5);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.cta-line a {
  color: var(--color-fg);
  font-weight: 800;
}

.cta-line a:hover {
  background: var(--color-accent-pink);
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .cta-button, .cta-button::before, .cta-button .frame-b-corner { transition: none; }
  .cta-button-arrows { animation: none; }
}

@media (max-width: 40rem) {
  .cta-button { padding-left: var(--space-3); gap: var(--space-3); }
}

/* ===== MOBILE START ===== */
/* Mobile / small-screen pass (2026-10-02). Everything below only applies
   at narrow widths; desktop (> 75rem) is untouched. To undo, delete this
   block (or restore _backup/2026-10-02_before-mobile). Two tiers:
   - up to 75rem: nothing may push the page wider than the screen -- the
     decorative ornaments that bleed off the edge are clipped, and the
     fixed 60rem columns are allowed to shrink;
   - up to 48rem: phone layout (stacked columns, rem-based type instead of
     vh units, header that fits, services as a vertical accordion). */
/* Ornaments bleed off the screen edge by design -- clip them at the
   viewport so they can never make the page scrollable sideways (a
   tablet in landscape is wider than 75rem but still a touch device, so
   this part isn't limited to the narrow-screen tiers below). Same result
   as the old body-only overflow-x:hidden on a desktop browser. */
html,
body {
  overflow-x: clip;
}

@media (max-width: 75rem) {
  .site-main {
    overflow-x: clip;
  }

  #projects .section-body {
    display: block;
    max-width: none;
  }

  .project-list {
    width: 100%;
    max-width: 60rem;
  }
}

/* Up to 56.25rem (900px, where the big margin ornaments already disappear):
   with nothing hanging in the margins any more, the 8vw left indent only
   makes the left edge wider than the right -- drop it, and drop the case
   cards' own margin ornaments (pink tab, hazard stripes) with it. */
@media (max-width: 56.25rem) {
  .section-content,
  #projects .section-content,
  #testimonials .section-content,
  #studio .section-content,
  .cta .section-content {
    margin-left: 0;
    margin-right: 0;
  }

  #projects .section-divider,
  .project-ornament,
  .project-list > :nth-child(even):not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 48rem) {
  /* ---- header ---- */
  .site-header {
    padding-inline: var(--space-2);
  }

  /* Hamburger on the left, "let's talk!" stays on the right as it was; the
     links move into a fullscreen overlay. */
  .nav-toggle {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: -0.5rem;
    padding: 0 0.6rem;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .nav-toggle-bar {
    display: block;
    height: 2px;
    background: var(--color-accent-pink);
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .site-header.is-menu-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.is-menu-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-menu-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  #btn_contact {
    position: relative;
    z-index: 3;
    margin-right: 0;
    white-space: nowrap;
  }

  .site-nav ul {
    position: fixed;
    inset: 0;
    z-index: 2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-6) var(--space-4) var(--space-4);
    background: #101010;
    counter-reset: nav;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }

  .site-header.is-menu-open .site-nav ul {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
  }

  .site-nav li {
    counter-increment: nav;
  }

  .site-nav li a {
    display: block;
    /* sized so the longest entry ("CASE STUDIES": 8.4em wide with its letter-spacing) fits on one line between the menu's side padding (2 x 2rem)
       and the number in front of it (~1.9rem); 3rem at most */
    font-size: min(3rem, calc((100vw - 5.9rem) / 8.6));
    white-space: nowrap;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent-pink);
  }

  .site-nav li a::before {
    content: "0" counter(nav);
    margin-right: 0.8em;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #ffffff;
    vertical-align: top;
  }

  html.is-menu-locked {
    overflow: hidden;
  }

  /* ---- hero: svh so the browser's collapsing address bar doesn't push it
     past the first screen ---- */
  @supports (height: 100svh) {
    .hero {
      height: calc(100svh - var(--header-height));
    }
  }

  .video-embed .play-button {
    width: min(250px, 60vw);
  }

  /* Portrait crop of the landscape reel/poster: nudged left of centre so the
     whole TETSUO logo sits in frame instead of being clipped at the edge. */
  .video-embed video {
    object-position: 46% 50%;
  }

  /* ---- sections: type and spacing in rem/vw instead of vh ---- */
  .intro,
  .about,
  .projects,
  .testimonials,
  .studio,
  .cta {
    scroll-margin-top: 3.5rem;
  }

  .section-content,
  #projects .section-content,
  #testimonials .section-content,
  #studio .section-content,
  .cta .section-content {
    margin-top: var(--space-5);
  }

  /* The hero-connector arrow hangs down into the start of the intro. */
  #intro .section-content {
    margin-top: 7rem;
  }

  .section-heading {
    font-size: clamp(1.6rem, 9vw, 2.4rem);
    letter-spacing: 0.2rem;
    line-height: 1.2;
    margin-bottom: var(--space-3);
  }

  .section-body {
    flex-direction: column;
    font-size: 1rem;
    word-spacing: 0.2rem;
  }

  #intro .section-body,
  #about .section-body,
  #projects .section-body,
  #testimonials .section-body,
  #studio .section-body,
  .cta .section-body {
    max-width: none;
  }

  /* ---- services: vertical accordion instead of four skinny columns ---- */
  .services {
    flex-direction: column;
    gap: 0.5rem;
    height: 26rem;
    max-width: none;
    margin-top: var(--space-4);
  }

  .service-title {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding-inline: var(--space-2);
  }

  .service-title-line {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  .service-info {
    width: auto;
    left: var(--space-2);
    right: var(--space-2);
  }

  .service-label {
    left: var(--space-2);
  }

  /* ---- cases ---- */
  /* The footage is the point: cards run edge to edge of the screen
     (cancelling .site-main's side padding), 16:9 so the whole frame shows,
     stacked with the same small gap as the services. */
  .project-list {
    margin-top: var(--space-4);
    margin-inline: calc(-1 * var(--space-3));
    width: calc(100% + 2 * var(--space-3));
    max-width: none;
    gap: var(--space-1);  /* same as .services */
  }

  .case-card {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .case-title {
    padding-inline: var(--space-2);
  }

  .case-title-line {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
  }

  .case-label,
  .case-client {
    left: var(--space-2);
  }

  .case-tags {
    left: var(--space-2);
    right: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0 var(--space-1);
  }

  /* ---- testimonials ---- */
  .testimonial-stage {
    width: 100%;
    margin-top: var(--space-4);
    margin-bottom: var(--space-5);
  }

  .testimonial-slides {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .testimonial-teaser,
  .studio-point-title {
    font-size: 1.1rem;
  }

  /* No arrows on phones: the cards rotate on their own, and tap-to-expand
     still works. */
  .testimonial-arrow {
    display: none;
  }

  /* ---- studio ---- */
  .studio-points {
    width: 100%;
    margin-bottom: var(--space-5);
  }

  /* ---- call to action ---- */
  .cta-row {
    width: 100%;
    margin-top: var(--space-5);
  }

  .cta-button {
    --cta-pad: var(--space-3);
    padding-left: var(--space-4);
    gap: var(--space-3);
  }

  .cta-button-label {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
  }

  .cta-button-go {
    width: 4rem;
  }

  .cta-line {
    margin-top: var(--space-4);
    overflow-wrap: anywhere;
  }
}
/* ===== MOBILE END ===== */





.hazard-landscape-white {
  position: absolute;
  z-index: 4;
  right: 0%;
  right: 0rem;
  right: -7vw;
  top: 16vh;
  height: 0%;
  height: 100%;
  margin-top: -1vh;
  left: 454px;
  left: auto;
  width: 100%;
  margin-right: 0px;
  bottom: auto;
}

.intro-dots-placer {
  height: 100%;
  width: 100%;
  margin-right: 0px;
  position: absolute;
  right: -6px;
  right: -18vw;
  left: 335px;
  top: 5vh;
}

.image-stack-wrapper {
}

#projects .ornament-left .pink-bg {
  height: auto;
  width: 91%;
  /* Tied to the dark pink bar (.orn-b: margin-left -17vw, margin-top -573% = -1490px) with fixed offsets, not vh/vw of its own:
     the pieces used to be placed in different units, so they drifted apart when the window size changed. */
  margin-top: -1580px;
  margin-left: calc(-17vw - 209px - 6px);
  padding-top: 10px;
  z-index: -1;
}

#projects .ornament-left .hazard-landscape-white {
  height: 100%;
  /* fixed position relative to the dark pink bar (see .pink-bg above), not to the window height */
  top: -1315px;
  left: calc(-17vw - 209px);
  right: auto;
  margin: 0;
  filter: invert(1);
  z-index: -1;
}

.hazard-down-arrow {
  width: 16%;
  height: auto;
}

#testimonials .ornament-right .hazard-down-arrow {
  z-index: 5;
  margin-top: 41vh;
  margin-left: 16vw;
}

#testimonials .ornament-right #orn-digits-b {
  top: 57vh;
  left: 7vw;
  z-index: 5;
  right: 50px;
}

.pink-rect-v {
  display: block;
  position: absolute;
  aspect-ratio: 92/434;
  background-color: var(--color-accent-pink);
  height: auto !important;
  width: 4vw !important;
  left: 13vw !important;
  top: 6vh !important;
}
.black-rect-v {
  display: block;
  position: absolute;
  aspect-ratio: 92/434;
  background-color:  var(--color-fg);
  height: 27vh;
  height: auto !important;
  width: 4vw !important;
}

#studio .ornament-left .black-rect-v{
  left: 0vw; 
  top: 0px; 
  height: 27vh; 
  width: auto; 
  left: 4vw;
  right: 5px;
}

#studio .ornament-left .pink-rect-v{
  left: 0vw !important; 
  top: 0px; 
  height: 27vh; 
  width: auto; 
  bottom: 0px;
}

#studio .ornament-left .rect-logo-block {
  width: 8vw;
  height: 39vh;
  position: absolute;
  margin-right: 0px;
  left: 13vw;
}

#studio .ornament-left .orn-logo {
  width: 60%;
  margin-left: 20%;
  margin-top: 10vh;
}

.orn-cases {
  width:auto;
  height:auto;
}

#studio .ornament-left .orn-cases {
  top: 2vh;
}

/* ----- intro dots (•••): stay clear of the text -----
   They sit 335px from the window's left edge (as in the design sketch, 1864px wide), but the text column moves left as the window
   narrows, so they would run into it. The left edge is now capped so the dots end at least 24px before the text
   (the text column starts at the window's left + 24px + 8vw, plus (window - 75rem)/2 when wider than 75rem; the dots are about 4.9vw wide). */
.intro-dots-placer {
  left: min(335px, calc(max(0px, (100vw - 75rem) / 2) + 24px + var(--indent) - 24px - 4.9vw));
}


/* ----- Energy packets on the traces (trace-packets.js) -----
   Each trace path has two overlay copies: .packet-glow (a soft pink halo) and .packet (the white dot, as wide as the trace). The dash
   pattern is one (almost zero-length, round-capped) dash followed by a gap of "cycle" = path length + a quiet stretch, and the dash offset
   runs from 0 to -cycle, so the dot travels along the path in its drawn direction and then rests before the next run. */
/* tune the look here: --packet-len (length of the dot), and the glow width above */
:root { --packet-len: 5px; }

.packet,
.packet-glow {
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--packet-len, 5px) var(--cycle, 1000);
  animation: tracePacket var(--dur, 6s) linear var(--delay, 0s) infinite;
}

/* !important: the generic ".trace-art path" / ".case-trace" stroke rules would otherwise paint the overlays like the traces themselves */
.packet {
  stroke: #ffffff !important;
  stroke-width: var(--trace-weight) !important;
  opacity: 1;
}

.packet-glow {
  stroke: #ff6fb5 !important;
  stroke-width: calc(var(--trace-weight) + 3px) !important;
  opacity: 0.4;
}

@keyframes tracePacket {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: calc((var(--cycle, 1000) + var(--packet-len, 5px)) * -1); }
}

/* only the sections near the viewport animate */
section:not(.tp-live) .packet,
section:not(.tp-live) .packet-glow {
  animation-play-state: paused;
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .packet,
  .packet-glow {
    display: none;
  }
}


/* ----- Burst of packets towards the call-to-action button on hover (trace-packets.js: initBurst) -----
   .burst is a third overlay per path of .trace-cta-link: a train of short dashes (set inline), invisible until .burst-on is put on the svg,
   then the dash offset runs the train from the far end of the line to the button while it fades out. */
.burst {
  fill: none;
  stroke: #ffffff !important;
  stroke-width: calc(var(--trace-weight) + 1px) !important;
  stroke-linecap: round;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.burst-on .burst {
  animation: traceBurst var(--bdur, 0.8s) cubic-bezier(0.3, 0, 0.7, 1) var(--bdelay, 0s) 1 both;
}

@keyframes traceBurst {
  0%   { opacity: 1; stroke-dashoffset: var(--bfrom, 0px); }
  85%  { opacity: 1; }
  100% { opacity: 0; stroke-dashoffset: var(--bto, 0px); }
}

@media (prefers-reduced-motion: reduce) {
  .burst { display: none; }
}


/* ----- Page texture: generative noise + fine grain behind everything -----
   Two tiled svg images on one fixed layer behind the page (below the traces and ornaments, above the white body):
   noise_bg.svg = the fffuel "nnnoise" look (feTurbulence + feSpecularLighting, in the accent pink, seamless 700px tile),
   grain_bg.svg = a fine dark grain. Tune the look with the three variables, or turn a layer off with 0. */
:root {
  --texture-noise-opacity: .1;
  --texture-noise-color: #ffffff;      /* any colour or variable, e.g. var(--color-accent-pink) */
  --texture-grain-color: #777777;
  --texture-grain-opacity: .02;
  --scanline-opacity: .01;
  --scanline-gap: 3px;
  --scanline-color: #c5e2eb;          /* any colour or variable, e.g. var(--color-accent-pink) */
  --bg-far-opacity: 1;
  --bg-mid-opacity: .5;
  --bg-near-opacity: .7;
  --bg-far-blur: 3px;
  --bg-mid-blur: 1px;
  --bg-near-blur: 0.5px;

}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

body::before {
  /* the svg is only a mask (its alpha); the colour comes from --texture-noise-color */
  background: var(--texture-noise-color);
  -webkit-mask: url("../img/texture/noise_mask.svg") 0 0 / 700px 700px repeat;
  mask: url("../img/texture/noise_mask.svg") 0 0 / 700px 700px repeat;
  opacity: var(--texture-noise-opacity);
}

body::after {
  background: var(--texture-grain-color);
  -webkit-mask: url("../img/texture/grain_bg.svg") 0 0 / 300px 300px repeat;
  mask: url("../img/texture/grain_bg.svg") 0 0 / 300px 300px repeat;
  opacity: var(--texture-grain-opacity);
}

@media (max-width: 40rem) {
  body::before { -webkit-mask-size: 500px 500px; mask-size: 500px 500px; }
  body::after { -webkit-mask-size: 200px 200px; mask-size: 200px 200px; }
}


/* ==========================================================================
   Sub-pages (templates/site_base.html): case detail, work gallery, contact, legal pages, blog
   Same header / footer console / tokens / texture as the homepage; the content sits in .section-content (so it is centred the same way)
   inside <main class="site-main subpage">. Ornaments are plain decoration (.page-orn), the closing call to action is the homepage's
   .cta block (templates/_cta_section.html).
   ========================================================================== */

.subpage {
  padding-bottom: var(--space-4);
}

.subpage .section-content {
  margin-top: var(--space-5);
}

/* ----- page head ----- */
.page-head {
  position: relative;
  margin-bottom: var(--space-5);
}

.page-crumbs {
  margin: 0 0 var(--space-2);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.page-crumbs a {
  color: var(--color-accent-pink);
  text-decoration: none;
}

.page-crumbs a:hover,
.page-crumbs a:focus-visible {
  text-decoration: underline;
}

.page-crumbs span {
  color: var(--color-fg);
}

.page-title {
  margin: 0;
  max-width: 52rem;
  text-transform: uppercase;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1.25;
  letter-spacing: 0.3rem;
  font-weight: 500;
}

.page-title .hl {
  font-weight: 800;
}

.page-lead {
  max-width: 44rem;
  margin: var(--space-3) 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: 0.04rem;
  word-spacing: 0.2rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.block-title {
  margin: var(--space-6) 0 var(--space-3);
  text-transform: uppercase;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  letter-spacing: 0.3rem;
  font-weight: 500;
}

.page-back {
  margin: var(--space-5) 0 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.page-back a {
  text-decoration: none;
}

/* the ornaments are the homepage's own (_page_ornaments.html, inside #about); keep the section from adding spacing or clipping them */
.sp-wrap,
.sp-top {
  position: relative;
}

/* ----- text blocks ----- */
.prose {
  max-width: 46rem;
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: 0.04rem;
  word-spacing: 0.2rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose blockquote,
.prose figure,
.prose address {
  margin: 0 0 1.3em;
}

.prose-lead {
  font-size: 1.28em;
  line-height: 1.55;
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  text-transform: uppercase;
  font-size: 1.4rem;
  letter-spacing: 0.2rem;
  line-height: 1.3;
}

.prose h2::before {
  content: ">_ ";
  color: var(--color-accent-pink);
}

.prose h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.1rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  line-height: 1.3;
}

.prose h4 {
  margin: 1.5em 0 0.4em;
  font-size: 1rem;
  letter-spacing: 0.08rem;
}

.prose a {
  color: var(--color-accent-pink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--color-fg);
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li::marker {
  color: var(--color-accent-pink);
}

.prose blockquote {
  padding: 0.2em 0 0.2em 1.2em;
  border-left: 3px solid var(--color-accent-pink);
  font-style: italic;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 0.05em 0.35em;
  background: rgba(0, 0, 0, 0.07);
  font-size: 0.92em;
}

.prose pre {
  overflow-x: auto;
  padding: var(--space-3);
  background: var(--color-bg-dark);
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.5;
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em 0;
}

.prose hr {
  height: 2px;
  margin: 2.4em 0;
  border: 0;
  background: var(--color-fg);
}

.prose strong {
  font-weight: 800;
}

.prose-legal {
  max-width: 52rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

.prose-legal h2 {
  font-size: 1.25rem;
}

.prose-legal address {
  font-style: normal;
}

/* ----- brackets: the same corner brackets as the console and the cta button ----- */
.bracket-box {
  position: relative;
  padding: var(--space-3) var(--space-4);
  background:
    linear-gradient(var(--color-fg), var(--color-fg)) top left / 16px 2px no-repeat,
    linear-gradient(var(--color-fg), var(--color-fg)) top right / 16px 2px no-repeat,
    linear-gradient(var(--color-fg), var(--color-fg)) bottom left / 16px 2px no-repeat,
    linear-gradient(var(--color-fg), var(--color-fg)) bottom right / 16px 2px no-repeat,
    linear-gradient(var(--color-fg), var(--color-fg)) left top / 2px 100% no-repeat,
    linear-gradient(var(--color-fg), var(--color-fg)) right top / 2px 100% no-repeat;
}

.bracket-title {
  margin: 0 0 var(--space-2);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent-pink);
}

.bracket-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-5) 0 0;
}

.arrow-list {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.5;
  letter-spacing: 0.03rem;
}

.arrow-list li {
  position: relative;
  margin-bottom: 0.7rem;
  padding-left: 1.9rem;
}

.arrow-list li::before {
  content: ">>";
  position: absolute;
  left: 0;
  font-weight: 800;
  color: var(--color-accent-pink);
}

.notice-box p {
  margin-bottom: 0.8em;
}

.notice-box p:last-child {
  margin-bottom: 0;
}

.notice-en {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ----- case detail ----- */
.media-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: var(--space-5) 0;
  background: var(--color-bg-dark);
}

.media-frame .service-frame {
  z-index: 3;
}

.media-frame:hover,
.media-frame:focus-within {
  --corner-open: 8px;
}

.media-frame-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
}

.media-frame iframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-frame-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 0;
  color: var(--color-fg);
  font: inherit;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.media-frame-play-label {
  align-self: center;
  padding: 0 var(--space-3);
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.media-frame-play-go {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(3.4rem, 6vw, 4.8rem);
  aspect-ratio: 1;
  background: var(--color-accent-pink);
}

.media-frame-play-go img {
  width: 55%;
  height: auto;
  animation: cta-nudge 1.6s ease-in-out infinite;
}

.media-frame-play:hover,
.media-frame-play:focus-visible {
  background: var(--color-accent-pink);
  color: #ffffff;
}

.media-frame-play:hover .media-frame-play-go,
.media-frame-play:focus-visible .media-frame-play-go {
  background: var(--color-fg);
}

.media-frame-fallback {
  position: absolute;
  inset: auto 1rem 1rem auto;
  z-index: 2;
  color: #ffffff;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.fact {
  min-height: 11rem;
  padding: var(--space-3);
  background: #bbbbbb;
  color: var(--color-fg);
}

.fact-title {
  margin: 0 0 var(--space-2);
  color: #ffffff;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.fact p,
.fact li {
  font-size: 0.95rem;
  line-height: 1.45;
  letter-spacing: 0.02rem;
}

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

.fact li::before {
  content: ">_ ";
  color: var(--color-accent-pink);
  font-weight: 800;
}

.story {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.story-label {
  position: sticky;
  top: calc(var(--header-h) + var(--space-3));
  align-self: start;
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent-pink);
}

.stills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.still {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-dark);
}

.still img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(var(--service-media-brightness));
  transition: filter 0.4s ease;
}

.still .service-frame {
  z-index: 2;
}

.still:hover,
.still:focus-visible {
  --corner-open: 8px;
}

.still:hover img,
.still:focus-visible img {
  filter: none;
}

.quote-block {
  position: relative;
  max-width: 52rem;
  margin: var(--space-6) 0 0;
  padding-left: 5rem;
}

.quote-block::before {
  content: "\201C";
  position: absolute;
  top: -0.3em;
  left: 0;
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-accent-pink);
}

.quote-block blockquote {
  margin: 0;
  font-size: 1.05rem;               /* same as the story text (.prose) */
  line-height: 1.7;
}

.quote-block blockquote p {
  margin: 0;
}

.quote-block figcaption {
  display: inline-block;
  margin-top: var(--space-3);
  padding-inline: 0.4em;
  background: var(--color-accent-pink);
  color: #ffffff;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

/* ----- the closing call to action (the homepage's .cta block) ----- */
.subpage-cta-wrap .cta .section-content {
  margin-top: var(--space-6);
}

/* ----- lightbox ----- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.93);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 84vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  padding: 0.5rem 0.9rem;
  background: none;
  border: 0;
  color: #ffffff;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  color: var(--color-accent-pink);
}

.lightbox-close {
  top: 1rem;
  right: 1.2rem;
  font-size: 2.2rem !important;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-count {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}

/* ----- work gallery ----- */
.work-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0 0 var(--space-4);
}

.work-chip {
  padding: 0.25rem 0.7rem;
  background: transparent;
  border: 0;
  color: var(--color-fg);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  cursor: pointer;
}

.work-chip::before {
  content: "[ ";
}

.work-chip::after {
  content: " ]";
}

.work-chip:hover,
.work-chip:focus-visible {
  color: var(--color-accent-pink);
}

.work-chip.is-active {
  background: var(--color-accent-pink);
  color: #ffffff;
}

.work-count {
  margin-left: auto;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.work-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #9a9a9a;
  color: #ffffff;
  text-decoration: none;
}

.work-card[hidden] {
  display: none;
}

.work-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(var(--service-media-brightness)) contrast(var(--service-media-contrast));
  transition: filter 0.4s ease;
}

.work-card-tint {
  position: absolute;
  inset: 0;
  background: var(--color-accent-pink);
  mix-blend-mode: screen;
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.work-card .service-frame {
  z-index: 3;
}

.work-card:hover,
.work-card:focus-visible {
  --corner-open: 8px;
}

.work-card:hover .work-card-media,
.work-card:focus-visible .work-card-media {
  filter: none;
}

.work-card:hover .work-card-tint,
.work-card:focus-visible .work-card-tint {
  opacity: 0;
}

.work-card:focus-visible {
  outline: none;
}

.work-card-cat {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
  padding-inline: 0.35em;
  background: var(--color-accent-pink);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.work-card-info {
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: var(--space-2);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.work-card-title {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 1000;
  line-height: 0.98;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.work-card-client {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* client and tags only on hover / keyboard focus (always shown where there is no hover, e.g. touch screens) */
.work-card-client,
.work-card-tags {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.work-card:hover .work-card-client,
.work-card:hover .work-card-tags,
.work-card:focus-visible .work-card-client,
.work-card:focus-visible .work-card-tags {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .work-card-client,
  .work-card-tags {
    opacity: 1;
    transform: none;
  }
}

.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.work-empty {
  margin: var(--space-4) 0 0;
  letter-spacing: 0.1em;
}

.work-empty[hidden] {
  display: none;
}

/* ----- contact ----- */
.contact-layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.contact-details address {
  margin: 0 0 var(--space-2);
  font-style: normal;
  line-height: 1.6;
}

.contact-line {
  margin: 0 0 0.4rem;
  word-break: break-word;
}

.contact-line a {
  color: var(--color-fg);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.contact-line a:hover,
.contact-line a:focus-visible {
  color: var(--color-accent-pink);
}

.contact-form-wrap {
  max-width: 40rem;
}

.field {
  display: block;
  margin-bottom: var(--space-3);
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.06);
  border: 0;
  border-bottom: 2px solid var(--color-fg);
  border-radius: 0;
  color: var(--color-fg);
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.04rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.field textarea {
  min-height: 11rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  background: #ffffff;
  border-bottom-color: var(--color-accent-pink);
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: var(--space-3) 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.field-check input {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--color-accent-pink);
}

.field-check a {
  color: var(--color-accent-pink);
  text-decoration: underline;
}

/* spam trap: not display:none (bots skip those), just out of sight */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .cta-button {
  --corner-open: 0px;
  margin-top: var(--space-2);
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  opacity: 1;
}

.contact-form .cta-button:hover,
.contact-form .cta-button:focus-visible {
  --corner-open: 8px;
}

.form-status {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  color: #ffffff;
  line-height: 1.45;
}

.form-status[hidden] {
  display: none;
}

.form-status-success {
  background: var(--color-accent-pink);
}

.form-status-error {
  background: var(--color-bg-dark);
}

.form-status a {
  color: #ffffff;
  text-decoration: underline;
}

/* ----- blog ----- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem var(--space-3);
  margin: var(--space-2) 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.post-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: #bbbbbb;
  color: var(--color-fg);
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.post-card:not(:has(.post-card-cover)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.post-card .service-frame {
  z-index: 2;
}

.post-card:hover,
.post-card:focus-visible {
  --corner-open: 8px;
  background: var(--color-accent-pink);
  color: #ffffff;
}

.post-card:hover .post-meta,
.post-card:focus-visible .post-meta {
  color: #ffffff;
}

.post-card-cover {
  width: 12rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: grayscale(1);
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card-title {
  color: #ffffff;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card-summary {
  font-size: 0.95rem;
  line-height: 1.45;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.8rem;
  font-size: 0.8rem;
}

.post-card-go {
  display: flex;
  width: 3.2rem;
  padding: 0.8rem;
  background: var(--color-accent-pink);
}

.post-card:hover .post-card-go {
  background: var(--color-fg);
}

.post-card-go img {
  width: 100%;
  height: auto;
}

.post-cover {
  display: block;
  width: 100%;
  max-height: 32rem;
  margin: 0 0 var(--space-5);
  object-fit: cover;
}

.prose-post {
  max-width: 44rem;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--space-2) var(--space-3);
  color: var(--color-fg);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.06);
}

.post-nav-link span {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--color-accent-pink);
}

.post-nav-next {
  text-align: right;
  grid-column: 2;
}

.post-nav-link:hover,
.post-nav-link:focus-visible {
  background: var(--color-accent-pink);
  color: #ffffff;
}

.post-nav-link:hover span,
.post-nav-link:focus-visible span {
  color: #ffffff;
}

/* ----- responsive ----- */
@media (max-width: 62rem) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .facts {
    grid-template-columns: 1fr;
  }

  .fact {
    min-height: 0;
  }

  .story {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .story-label {
    position: static;
  }

  .bracket-pair,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 40rem) {
  .work-grid,
  .stills {
    grid-template-columns: 1fr;
  }

  .page-title {
    letter-spacing: 0.15rem;
  }

  .quote-block {
    padding-left: 0;
    padding-top: 3.5rem;
  }

  .quote-block::before {
    top: -0.1em;
    font-size: 5rem;
  }

  .post-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-card-go,
  .post-card-cover {
    display: none;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    grid-column: 1;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .media-frame-play,
  .work-card-media,
  .still img {
    transition: none;
  }
}

/* ===== sp-copies: the homepage ornament rules, copied for the sub-pages (.sp-top = #about, .sp-cta = #studio left + #testimonials right) ===== */
.sp-cta .ornament-right .orn-digits {
  top: 10vh;
  left: 10vw;
}

.sp-cta .ornament-right .orn-digits-box {
  position: absolute;
  inset: 0em 0em 0em 0em;
  background: var(--color-accent-pink);
  z-index: -1;
  right: -85%;
  left: -8px;
  top: 0px;
  top: -8px;
  bottom: 3%;
  bottom: 1%;
  bottom: -90%;
}

.sp-cta .ornament-right .orn-digits-row {
  color: var(--color-bg)
}

.sp-cta .ornament-right .hazard-landscape {

  height: 427px;
  width: 323px;
  padding: 0px;
  margin-top: 0vh;
  margin-right: 0vw;
  margin-left: 0vw;
  min-width: 0px;
  padding-top: 0px;
  transform: rotate(90deg);
  filter: invert(1);
}

.sp-cta .ornament-right .pink-bg {

    width: 380px;
  width: 381px;
  margin: 0%;
  margin-top: 49vh;
  margin-right: 1%;
  margin-right: 0%;
  margin-left: 1vw;
}

.sp-top .ornament-right {
  left: clamp(70%, 60vw, 38rem);
}

.sp-top .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

.sp-top .ornament-left .orn-a {
  height: auto;
  width: 74%;
  margin-right: 4.5vw;
}

.sp-top .ornament-left .orn-bg {
  margin-right: 0vw;
  margin-left: -20vw;
  margin-top: -11vh;
}

.sp-top .ornament-left .image-stack-wrapper {
  z-index: 3;
  display: block;
  top: -7vh;
}

.sp-top .ornament-left .image-stack-wrapper .orn-stripes {
    transform: rotate(-90);
}

.sp-top #orn-a-b {
  top:78%;
}

.sp-top #measure_b {
  top: 68%;
  height: 70%;
}

.sp-top #measure_b .orn-measure-digit-a {
  color: var(--color-fg);
  background:none;
}

.sp-top .orn-b {
  left: 145%;
  top: 23%
}

.sp-top .orn-logo {
  left: 107%;
  top: 43%;
}

.sp-top .orn-dots {
  top: 127%;
  left: 110%;
}

.sp-top .orn-stripes {
  left:22%;
  top:86%;
  z-index: 0;
  transform: rotate(90deg);
}

.sp-top .orn-digits {
  left:135%;
  top: 95%;
}

.sp-top .ornament-left .orn-digits {
  color: #ffffff;
  left: 68%;
  top: 113%
}

.sp-top .orn-circle {
  left: 58%;
}

.sp-top #circle_black {
  left: 70%
}

.sp-cta .ornament-right {
  top: 0;
  left: calc(8vw + 61.5rem);
}

.sp-cta .ornament-left {
  right: calc(100% - 1px - clamp(40px, 4vw, 80px));
}

@media (max-width: 75rem) {
.sp-cta .ornament-right {
    display: none;
  }
}

.sp-cta .ornament-right .hazard-down-arrow {
  z-index: 5;
  margin-top: 41vh;
  margin-left: 16vw;
}

.sp-cta .ornament-right #orn-digits-b {
  top: 57vh;
  left: 7vw;
  z-index: 5;
  right: 50px;
}

.sp-cta .ornament-left .black-rect-v {
  left: 0vw; 
  top: 0px; 
  height: 27vh; 
  width: auto; 
  left: 4vw;
  right: 5px;
}

.sp-cta .ornament-left .pink-rect-v {
  left: 0vw !important; 
  top: 0px; 
  height: 27vh; 
  width: auto; 
  bottom: 0px;
}

.sp-cta .ornament-left .rect-logo-block {
  width: 8vw;
  height: 39vh;
  position: absolute;
  margin-right: 0px;
  left: 13vw;
}

.sp-cta .ornament-left .orn-logo {
  width: 60%;
  margin-left: 20%;
  margin-top: 10vh;
}

.sp-cta .ornament-left .orn-cases {
  top: 2vh;
}

/* ----- sub-page ornament frame: .sp-top = top ornaments, .sp-cta = closing call to action with its own ornaments, .sp-link = generated traces between them (sp-traces.js) ----- */
.sp-cta {
  padding-top: 12rem;
}

/* the ornaments keep their old position relative to the content (they used to start 34rem above the heading, now 12rem): shifted up by the difference */
.sp-cta .ornament-left {
  margin-top: -22rem;
}

/* the big right element sits higher still, so its bottom edge (where the traces into the button start) is above the heading */
.sp-cta .ornament-right {
  margin-top: -57rem;
}

/* stacking on the left: the runes piece sits below the logo and its two boxes */
.sp-cta .ornament-left .orn-runes {
  z-index: 0;
}

.sp-cta .ornament-left .rect-logo-block {
  z-index: 3;
}

.sp-cta .section-content {
  margin-top: 0;
}

.sp-link {
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--trace-weight);
  stroke-linejoin: miter;
}


/* ----- case detail: the hero video, as big as the homepage's (full width, up to the viewport height) ----- */
.case-hero {
  position: relative;
  width: 100vw;
  height: min(calc(100vh - var(--header-h)), 56.25vw);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  background: var(--color-bg-dark);
}

.case-hero .video-embed iframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
}

.case-hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.case-hero .media-frame-fallback {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  color: #ffffff;
}


/* ----- case detail: smaller hero so the page below shows at the bottom, with the title and key facts on the cover ----- */
.case-hero {
  height: min(calc(100vh - var(--header-h) - 130px), 52vw);
}

.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 38%, rgba(0, 0, 0, 0) 62%);
  pointer-events: none;
}

.case-hero-info {
  position: absolute;
  left: calc(50% - 30rem);
  right: calc(50% - 30rem);
  bottom: var(--space-4);
  z-index: 2;
  color: #ffffff;
  pointer-events: none;
}

@media (max-width: 75rem) {
  .case-hero-info {
    left: var(--space-3);
    right: var(--space-3);
  }
}

.case-hero-info a {
  pointer-events: auto;
}

.case-hero-crumbs {
  margin: 0 0 var(--space-1);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}

.case-hero-crumbs a {
  color: var(--color-accent-pink);
  text-decoration: none;
}

.case-hero-title {
  margin: 0;
  text-transform: uppercase;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1.15;
  letter-spacing: 0.3rem;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.case-hero-title .hl {
  font-weight: 800;
  text-shadow: none;
}

.case-hero-type {
  margin: var(--space-1) 0 0;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  letter-spacing: 0.06em;
}

.case-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.case-hero-client {
  padding-inline: 0.4em;
  background: var(--color-accent-pink);
  font-weight: 800;
}

/* the floating "play movie >>" button, built from html/css (replaces the showreel image) */
.video-embed .play-button.play-button-css,
.case-hero .play-button {
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 250px;
  height: 38px;
  aspect-ratio: auto;
  padding: 0 0.9rem;
  border: 2px solid var(--color-accent-pink);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-accent-pink);
  font: inherit;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.case-hero .play-button .play-button-arrows {
  font-weight: 800;
}

.case-hero {
  z-index: 2;                       /* above the ornaments that start at the top of the page below */
}

.case-hero .play-button {
  background: rgba(0, 0, 0, 0.6);
  font-weight: 800;
}

.case-hero .play-button {
  color: #ff5fae;                   /* a lighter pink than the accent so the label reads on the photo */
}

/* ----- work gallery: 16:9 cards, frame always closed at the image edge, title at the bottom, details unfold above it on hover ----- */
.work-card {
  aspect-ratio: 16 / 9;
}

.work-card,
.work-card:hover,
.work-card:focus-visible {
  --corner-open: 0px;
}

.work-card-info {
  flex-direction: column-reverse;   /* title (first in the markup) stays at the bottom, client and tags stack above it */
  bottom: var(--space-1);
  left: var(--space-2);
  gap: 0;
}

.work-card-client,
.work-card-tags {
  max-height: 0;
  overflow: hidden;
  transform: none;
  transition: opacity 0.25s ease, max-height 0.3s ease, margin 0.3s ease;
}

.work-card:hover .work-card-client,
.work-card:hover .work-card-tags,
.work-card:focus-visible .work-card-client,
.work-card:focus-visible .work-card-tags {
  max-height: 4rem;
  margin-bottom: 0.35rem;
}

@media (hover: none) {
  .work-card-client,
  .work-card-tags {
    max-height: 4rem;
    margin-bottom: 0.35rem;
  }
}


/* ----- case detail: the title block lives below the cover again; hazard arrow band under the cover; play button without background ----- */
.case-hero::after {
  display: none;
}

.case-hero .play-button {
  background: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}


/* ----- work gallery: 2 wide by default, 3 wide on request (buttons next to the filter) ----- */
.work-grid.is-2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.work-cols {
  display: inline-flex;
  gap: 0.2rem;
  margin-left: auto;
}

.work-cols + .work-count {
  margin-left: var(--space-2);
}

@media (max-width: 40rem) {
  .work-cols {
    display: none;
  }

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


/* ----- case detail: cover a little lower and tighter below, so the breadcrumbs show on the first screen ----- */
.case-hero {
  height: min(calc(100vh - var(--header-h) - 230px), 50vw);
}

.page-case .subpage .section-content {
  margin-top: var(--space-3);
}

.case-hero .yt-slot,
.case-hero iframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}


.case-hero iframe,
.case-hero .yt-slot {
  transition: opacity 0.6s ease;
}

.case-hero .video-embed.is-leaving iframe,
.case-hero .video-embed.is-leaving .yt-slot {
  opacity: 0;
  pointer-events: none;
}

.case-hero .play-button {
  transition: opacity 0.6s ease;
}


/* ----- case detail: "the story" as a headline above the text (same style as the other block titles), not a column on the left ----- */
.story {
  display: block;
}

.story-label {
  position: static;
  margin: 0 0 var(--space-3);
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  font-weight: 500;
  letter-spacing: 0.3rem;
  color: var(--color-fg);
}

.story-label::first-line {
  color: inherit;
}

.story-mark {
  color: var(--color-accent-pink);
}


/* ----- case detail: stills flow inside the story; sticky "all work" button ----- */
.story-flow::after {
  content: "";
  display: block;
  clear: both;
}

.story-still {
  position: relative;
  display: block;
  width: min(22rem, 46%);
  aspect-ratio: 16 / 9;
  margin: 0.3rem 0 1rem;
  background: var(--color-bg-dark);
}

.story-still.is-right {
  float: right;
  margin-left: var(--space-3);
  margin-right: -6rem;
}

.story-still.is-left {
  float: left;
  margin-right: var(--space-3);
  margin-left: -6rem;
}

.story-still img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  filter: grayscale(1) brightness(var(--service-media-brightness));
  transition: filter 0.4s ease;
}

.story-still .service-frame {
  z-index: 2;
}

.story-still:hover img,
.story-still:focus-visible img {
  filter: none;
}

@media (max-width: 62rem) {
  .story-still.is-right,
  .story-still.is-left {
    float: none;
    width: 100%;
    margin: 0 0 var(--space-2);
  }
}

.sticky-back {
  position: fixed;
  top: calc(var(--header-h) + 0.8rem);
  left: max(var(--space-3), calc(50% - 30rem));
  z-index: 90;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sticky-back.is-on {
  opacity: 1;
  pointer-events: auto;
}

.page-crumbs {
  transition: opacity 0.25s ease;
}

.page-crumbs.is-gone {
  opacity: 0;
}


.story-still {
  width: min(31rem, 62%);
}

.story-still.is-right { margin-right: -9rem; }
.story-still.is-left { margin-left: -9rem; }


/* the story uses the full 60rem content column, and the stills sit inside it (no overhang) */
.story-flow {
  max-width: none;
}

.story-still {
  width: min(28rem, 48%);
}

.story-still.is-right { margin-right: 0; }
.story-still.is-left { margin-left: 0; }


.story-still {
  aspect-ratio: 16 / 9;
}

.story-still[style*="height"] {
  aspect-ratio: auto;
}


/* story stills: full colour, the image always fills its box (no dark bars), a pink outline + slight zoom as the hover hint */
.story-still {
  background: transparent;
  overflow: hidden;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.25s ease;
}

.story-still img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  margin: 0 !important;
  object-fit: cover;
  filter: none !important;
  transition: transform 0.5s ease;
}

.story-still:hover,
.story-still:focus-visible {
  outline-color: var(--color-accent-pink);
}

.story-still:hover img,
.story-still:focus-visible img {
  transform: scale(1.04);
}

.story-still,
.story-still:hover,
.story-still:focus-visible {
  outline: none;
}


/* testimonial on the case page: portrait + name / role */
.quote-block figcaption {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: 0;
  background: none;
  color: var(--color-fg);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.quote-portrait {
  width: 4.5rem;
  height: 4.5rem;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center top;
}

.quote-by {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.quote-by strong {
  align-self: flex-start;
  padding-inline: 0.4em;
  background: var(--color-accent-pink);
  color: #ffffff;
}

.quote-by span {
  color: var(--color-muted);
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--scanline-color) 0, var(--scanline-color) 1px, transparent 1px, transparent var(--scanline-gap));
  opacity: var(--scanline-opacity);
}


/* ----- logo in the header: a simple "home" button at the left of the nav ----- */
.nav-logo {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  height: calc(var(--header-h) * 0.76);
  margin-left: 25px;
  flex-shrink: 0;
}

.nav-logo img {
  display: block;
  width: auto;
  height: 100%;
  transition: opacity 0.2s ease;
}

.nav-logo:hover img,
.nav-logo:focus-visible img {
  opacity: 0.7;
}

.site-nav ul {
  margin-right: auto;
}

@media (max-width: 48rem) {
  .nav-logo {
    margin-left: 0.4rem;
    height: calc(var(--header-h) * 0.7);
  }

  .site-nav ul {
    margin-right: 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  #btn_contact {
    margin-left: auto;
  }
}


/* ----- header logo at the far left of the window; the nav keeps its centred 75rem column and is pushed inwards when the logo needs the room ----- */
.site-header {
  --logo-h: calc(var(--header-h) * 0.76);
  --logo-col: calc(var(--logo-h) * 1.12 + var(--space-3) * 2);
  display: grid;
  grid-template-columns: minmax(var(--logo-col), 1fr) minmax(0, var(--max-width)) minmax(0, 1fr);
  align-items: center;
}

.site-header .nav-logo {
  grid-column: 1;
  justify-self: start;
  margin-left: 0;
  height: var(--logo-h);
}

.site-header .site-nav {
  grid-column: 2;
  margin-inline: 0;
}

.site-footer-logo-link {
  display: contents;               /* the link wraps the logo without changing how it is laid out */
}

@media (max-width: 48rem) {
  .site-header {
    display: flex;
    justify-content: flex-start;
  }

  .site-header .site-nav {
    display: contents;
  }

  .site-header .nav-logo {
    order: 1;
    margin-left: 0.4rem;
    height: calc(var(--header-h) * 0.7);
  }

  .site-header .nav-toggle {
    order: 0;
  }

  .site-header #btn_contact {
    order: 2;
    margin-left: auto;
    margin-right: 0;
  }
}


/* ----- phone: the logo is part of the opened hamburger menu (hidden in the bar itself) ----- */
.nav-menu-logo {
  display: none;
}

@media (max-width: 48rem) {
  .site-header .nav-logo {
    display: none;
  }

  .site-nav li.nav-menu-logo {
    display: block;
    counter-increment: none;
    margin-bottom: var(--space-3);
  }

  .site-nav li.nav-menu-logo a::before {
    content: none;
  }

  .site-nav li.nav-menu-logo img {
    display: block;
    width: auto;
    height: 4.5rem;
  }
}


/* header logo: smaller, with the same distance to the left edge as to the top and bottom of the bar (desktop) */
@media (min-width: 48.0625rem) {
  .site-header {
    --logo-h: calc(var(--header-h) * 0.58);
    --logo-gap: calc((var(--header-h) - var(--logo-h)) / 2);
    --logo-col: calc(var(--logo-h) * 1.12 + var(--logo-gap) + var(--space-3));
    padding-left: var(--logo-gap);
  }
}


/* ----- services: 2x2 grid on desktop (same layout as the /work gallery); a hovered / opened card grows into its row and column, colour and text behave as before. Phones keep the vertical accordion. ----- */
@media (min-width: 48.0625rem) {
  .services {
    --service-row: clamp(11rem, 17vw, 16.6rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.5rem;
    height: calc(var(--service-row) * 2 + 0.5rem);
    transition: none;
  }

  .services {
    transition: grid-template-columns 0.45s ease, grid-template-rows 0.45s ease;
  }

  .service {
    flex: none;
    transition: none;
  }

  .services:has(.service:nth-child(odd):is(:hover, :focus-visible, .is-active)) {
    grid-template-columns: 1.7fr 1fr;
  }

  .services:has(.service:nth-child(even):is(:hover, :focus-visible, .is-active)) {
    grid-template-columns: 1fr 1.7fr;
  }

  .services:has(.service:nth-child(-n+2):is(:hover, :focus-visible, .is-active)) {
    grid-template-rows: 1.35fr 1fr;
  }

  .services:has(.service:nth-child(n+3):is(:hover, :focus-visible, .is-active)) {
    grid-template-rows: 1fr 1.35fr;
  }

  .service.is-active,
  .service:hover,
  .service:focus-visible {
    flex-grow: 0;
  }

  .service-title-line {
    font-size: 13cqw;
  }

  /* the title leaves towards the nearest outer edge: left column to the right, right column to the left */
  .service:nth-child(odd):is(.is-active, :hover, :focus-visible) .service-title {
    transform: translateX(50px);
  }

  .service:nth-child(even):is(.is-active, :hover, :focus-visible) .service-title {
    transform: translateX(-50px);
  }
}


/* services grid: shorter cards (about the height of the phone cards); the opened row takes most of the height, the info text gets a wider box */
@media (min-width: 48.0625rem) {
  .services {
    --service-row: 6.1rem;
  }

  .services:has(.service:nth-child(-n+2):is(:hover, :focus-visible, .is-active)) {
    grid-template-rows: 2.4fr 1fr;
  }

  .services:has(.service:nth-child(n+3):is(:hover, :focus-visible, .is-active)) {
    grid-template-rows: 1fr 2.4fr;
  }

  .service-title-line {
    font-size: 9cqw;
  }

  .service-info {
    width: min(21rem, 72%);
  }
}


/* services grid, final heights: the whole grid is a fixed 20rem tall (so the page below never jumps); resting rows are equal, the opened row takes 15rem (enough for the full description), the other row shrinks to 4.5rem */
@media (min-width: 48.0625rem) {
  .services {
    height: 20rem;
  }

  .services:has(.service:nth-child(-n+2):is(:hover, :focus-visible, .is-active)) {
    grid-template-rows: 15rem 4.5rem;
  }

  .services:has(.service:nth-child(n+3):is(:hover, :focus-visible, .is-active)) {
    grid-template-rows: 4.5rem 15rem;
  }

  .service-title-line {
    font-size: 11cqw;
  }

  .service-info {
    width: min(21rem, 85%);
  }
}


/* ----- footer: tagline under the logo (like on the old site) and a simplified nav ----- */
.site-footer-tagline {
  margin: calc(-10% + 1rem) 0 0;       /* cancels the logo's 10% bottom margin */
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.5em;
  word-spacing: 0.4em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: -1px 0 rgba(80, 220, 255, 0.55), 1px 0 rgba(255, 60, 160, 0.55);
  transform: translateX(calc(4vw - (1px + var(--space-3)) / 2));
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2rem;
  margin: var(--space-4) 0 0;
  padding-inline: var(--indent);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.site-footer-nav a {
  color: #ffffff;
  text-decoration: none;
}

.site-footer-nav a:hover,
.site-footer-nav a:focus-visible {
  color: var(--color-accent-pink);
  text-decoration: underline;
}

@media (max-width: 48rem) {
  .site-footer-tagline {
    transform: none;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    padding-inline: var(--space-2);
  }

  .site-footer-nav {
    padding-inline: var(--space-2);
    gap: 0.4rem 1.2rem;
  }
}

@media (max-width: 62rem) {
  .contact-details {
    order: 2;                         /* phones / tablets: the form first, then the studio address */
  }
}


/* footer: logo and tagline centred on the page; airier tagline in a light face; more space between logo, tagline and nav */
.site-footer-logo {
  transform: none;
}

.site-footer-tagline {
  margin: calc(-10% + 2.6rem) 0 0;
  transform: none;
  font-family: "Helvetica Neue", "Segoe UI", Arial, sans-serif;   /* Iosevka has no light weight in the font files, so a light system sans */
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.75em;
  word-spacing: 1.4em;
  text-indent: 0.75em;               /* balances the trailing letter-space so the line is optically centred */
}

.site-footer-nav {
  margin-top: var(--space-6);
}

@media (max-width: 48rem) {
  .site-footer-tagline {
    letter-spacing: 0.45em;
    word-spacing: 0.9em;
    text-indent: 0.45em;
    font-size: 0.7rem;
  }
}


.site-footer-tagline {
  text-shadow: none;                 /* plain white text, no colour fringe */
}


/* console box: it was pulled left by its border+padding so the text lines up with the page text, but the right side was not, so the drawn box sat ~12px left of the page centre. Same pull on the right -> the box is centred (the text still lines up on both sides). Desktop only. */
@media (min-width: 48.0625rem) {
  .console-screen {
    margin-right: calc(-1px - var(--space-3));
  }
}


/* ----- 404 page ----- */
.error-code {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  color: var(--color-accent-pink);
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.error-links a {
  color: var(--color-fg);
  text-decoration: none;
}

.error-links a::before {
  content: ">> ";
  color: var(--color-accent-pink);
  font-weight: 800;
}

.error-links a:hover,
.error-links a:focus-visible {
  color: var(--color-accent-pink);
  text-decoration: underline;
}

.bg-stage {
  --bg-w: max(100vw, 900px);                 /* the images are 1920px wide: scaled to the window, but never narrower than 900px (phones show a crop) */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: -2;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: calc((100% - var(--bg-w)) / 2);
  width: var(--bg-w);
  will-change: transform;
}

.bg-far { opacity: var(--bg-far-opacity); }
.bg-mid { opacity: var(--bg-mid-opacity); }
.bg-near { opacity: var(--bg-near-opacity); }

/* start / end pieces: full size on tall pages; on a short page (shorter than both pieces together) they share the height 55 / 45 and only
   show the top of the start piece and the bottom of the end piece, so they never pile up on top of each other */
.bg-start-wrap,
.bg-end-wrap {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
}

.bg-start-wrap {
  top: 0;
  height: min(calc(var(--bg-w) * 1500 / 1920), 55%);
}

.bg-end-wrap {
  bottom: 0;
  height: min(calc(var(--bg-w) * 1300 / 1920), 45%);
}

.bg-layer img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.bg-layer .bg-end {
  position: absolute;
  bottom: 0;
  left: 0;
}

.bg-layer .bg-tile {
  position: absolute;
  left: 0;
  width: 100%;
  top: min(calc(var(--bg-w) * 1500 / 1920), 55%);
  bottom: min(calc(var(--bg-w) * 1300 / 1920), 45%);
  background-repeat: repeat-y;
  background-size: 100% auto;
}

.bg-far .bg-tile { background-image: url("../img/bg/bg-far-tile.png"); }
.bg-mid .bg-tile { background-image: url("../img/bg/bg-mid-tile.png"); }
.bg-near .bg-tile { background-image: url("../img/bg/bg-near-tile.png"); }

@media print {
  .bg-stage { display: none; }
}


/* ----- Grunge texture: a photo of scratches / dust / marks (inverted: dark marks on white) multiplied very lightly over the page background.
   A fixed layer above the page colour and the noise / grain / scanlines, below the grey parallax shapes. The picture is --grunge-image (now
   grunge-281-alpha.webp: a subtle wall, made by make_grunge_overlay.py: black with alpha = 1 - brightness, so a normal blend looks like multiply
   without a blend mode); to try another one run make_grunge_overlay.py with that photo. Strength: --grunge-opacity (0 = off). ----- */
:root {
  --grunge-image: url("../img/texture/grunge-281-alpha.webp");
  --grunge-opacity: .3;
}

html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: var(--grunge-image) center / cover no-repeat;
  opacity: var(--grunge-opacity);                /* the picture is black with alpha = 1 - brightness: a normal blend looks like multiply */
}

@media print {
  html::after { display: none; }
}

/* phones: freeze the running packets while the page scrolls (bg-parallax.js sets html.is-scrolling) */
@media (pointer: coarse) {
  html.is-scrolling .packet,
  html.is-scrolling .packet-glow { animation-play-state: paused; }
}

/* ---- service pages (/services/, /services/<slug>/) + the homepage service cards as links ---- */
a.service {
  display: block;
  color: inherit;
  text-decoration: none;
}
.service-work { margin: var(--space-5) 0; }
.service-work .story-label { margin-bottom: var(--space-3); }
.service-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: var(--space-5) 0 0;
  font-family: var(--font-body);
  text-transform: lowercase;
}
.service-more-label { opacity: 0.7; }
.page-service .fact ul { margin: 0; padding-left: 1.1em; }
