/* components.css: one block per component, in page order.
   Search for the banner name (for example "Site header") to jump to it. */

/* ── Page surfaces ──────────────────────── */
.page-about main { background: var(--color-accent); }
.page-case main  { background: var(--neutral-0); }

/* ── Icons ──────────────────────────────── */
.icon {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}

.icon-sm { width: 14px; height: 14px; stroke-width: 2.4; stroke-linecap: butt; }
.icon-lg { width: 32px; height: 32px; stroke-width: 3.5; stroke-linecap: butt; }
.icon-globe { stroke-width: 2.7; stroke-linecap: butt; }

/* ── Site header ────────────────────────── */
/* Pinned to the top of the window while the page scrolls. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding-inline: max(var(--grid-margin), (100% - var(--grid-content)) / 2);
  background: var(--color-surface-inverse);
  border-bottom: 1px solid var(--neutral-900);
  color: var(--neutral-0);
}

.site-logo {
  display: block;
  flex: none;
}

.site-logo img {
  width: auto;
  height: 62.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 32px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: inherit;
  transition: opacity var(--dur-fast) ease;
}

.icon-button:hover { opacity: 0.7; }

/* ── Language selector and menu ─────────── */
.lang {
  position: relative;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  color: inherit;
}

.lang-toggle .icon-sm {
  transition: rotate var(--dur-fast) ease;
}

.lang-toggle[aria-expanded="true"] .icon-sm { rotate: 180deg; }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 130px;
  padding: 4px;
  background: var(--neutral-900);
  border: 1px solid var(--neutral-800);
}

.lang-menu[hidden] { display: none; }

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  color: var(--neutral-400);
  text-align: left;
}

.lang-option[aria-current="true"] {
  background: var(--neutral-800);
  color: var(--neutral-0);
}

.lang-option[aria-current="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.lang-option:hover { color: var(--neutral-0); }

/* ── Menu overlay ───────────────────────── */
.site-menu {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  max-width: none;
  max-height: 100dvh;
  margin: 0;
  padding: 0 max(var(--grid-margin), (100% - var(--grid-content)) / 2) 40px;
  border: 0;
  background: var(--color-surface-inverse); /* same black as the header */
  color: var(--neutral-0);
  overflow-y: auto;
}

.site-menu::backdrop { background: transparent; }

.site-menu-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: var(--header-height) auto 1fr;
  grid-template-areas:
    "logo actions"
    "nav nav"
    "info info";
  align-items: center;
  min-height: calc(100dvh - 40px);
}

.site-menu .site-logo   { grid-area: logo; }
.site-menu .menu-info   { grid-area: info; }
.site-menu .header-actions { grid-area: actions; justify-self: end; }
.site-menu-nav          { grid-area: nav; }

.site-menu-inner > .site-logo,
.site-menu-inner > .header-actions {
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.menu-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: end;
}

.menu-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.menu-info a { text-decoration: underline; text-underline-offset: 0.2em; }

.site-menu-nav {
  align-self: start;
  padding-top: 72px;
}

/* Menu links sit on the right hand side. */
.site-menu-nav ul {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-transform: uppercase;
}

.site-menu-nav a {
  transition: color var(--dur-fast) ease;
}

.site-menu-nav a:hover,
.site-menu-nav a[aria-current="page"] { color: var(--color-accent); }

@media (min-width: 48em) {
  .site-menu-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: var(--header-height) auto;
    grid-template-areas:
      "logo info actions"
      "nav nav nav";
    min-height: 0;
  }

  .menu-info {
    flex-direction: row;
    gap: 48px;
    align-self: center;
    justify-self: center;
  }

  .site-menu-nav { padding-top: 48px; }

  .site-menu-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px 56px;
  }
}

/* ── Button ─────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-s);
  padding: var(--space-m) var(--space-l);
  background: var(--color-surface-inverse);
  color: var(--color-on-inverse);
  transition: background-color var(--dur-fast) ease;
}

.button .icon {
  transition: translate var(--dur-base) var(--ease-out-expo);
}

.button:hover { background: var(--neutral-800); }
.button:hover .icon { translate: 3px -3px; }
.button:active { scale: 0.98; }

/* ── Hero ───────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: 100px;
  padding-bottom: 96px;
  border-bottom: 1px solid var(--neutral-900);
}

.hero-intro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.hero-portrait {
  width: 240px;
  aspect-ratio: 420 / 736;
}

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

.hero-copy {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  color: var(--neutral-900);
}

@container (min-width: 780px) {
  .hero-statement > span { display: block; }
}

@media (min-width: 48em) {
  .hero { padding-top: 156px; }
  .hero-portrait { width: 320px; }
}

@media (min-width: 80em) {
  .hero { padding-top: 220px; }

  .hero-intro {
    flex-direction: row;
    align-items: flex-end;
  }

  .hero-portrait { flex: 0 0 420px; }
  .hero-copy { flex: 1 1 0; min-width: 0; }
}

/* ── Hero marquees ──────────────────────── */
/* Four rows of "visual designer" slide behind the intro as the page scrolls.
   Row 02 (ink) runs right to left, the three red rows run left to right. Each
   track holds four copies, so moving it by 25% equals exactly one word and
   loops seamlessly. */
.hero-marquees {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: var(--type-display);
  font-weight: 700;
  line-height: var(--leading-display);
  font-variation-settings: "SOFT" 0, "WONK" 1;
}

.marquee {
  position: absolute;
  left: 0;
  top: calc(0.153em + var(--row-offset) * 0.625em);
  white-space: nowrap;
}

.marquee-track {
  display: flex;
  width: max-content;
}

.marquee-track > span { padding-inline-end: var(--marquee-gap, 0.571em); }

.marquee--1 { --row-offset: -1; color: var(--brand-scarlet-fire-deep); }
.marquee--2 { --row-offset: 0;  color: var(--neutral-900); --marquee-gap: 0.469em; }
.marquee--3 { --row-offset: 1;  color: var(--brand-scarlet-fire-deep); }
.marquee--4 { --row-offset: 2;  color: var(--brand-scarlet-fire-faint); }

/* Paint order matches Figma: 04 at the back, ink row 02 at the front. */
.marquee--4 { z-index: 0; }
.marquee--3 { z-index: 1; }
.marquee--1 { z-index: 2; }
.marquee--2 { z-index: 3; }

/* ── Capabilities ───────────────────────── */
.capabilities {
  overflow: hidden;
  border-bottom: 1px solid var(--neutral-900);
}

.capabilities-pattern {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 480px;
  object-fit: cover;
  translate: 0 -50%;
  pointer-events: none;
}

.capabilities-content {
  position: relative;
  display: grid;
  gap: var(--space-l);
  color: var(--neutral-900);
}

.capabilities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 48em) {
  .capabilities-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-l) var(--grid-gutter);
  }

  .capabilities-content > h2 { grid-column: 1 / -1; }
}

@media (min-width: 80em) {
  .capabilities-content {
    /* The label column grows when a translated title is longer than 320px. */
    grid-template-columns: minmax(var(--label-column), max-content) 1fr 1fr;
    column-gap: var(--space-2xl);
  }

  .capabilities-content > h2 { grid-column: auto; }
}

/* ── Clients ────────────────────────────── */
.clients {
  background: var(--neutral-0);
  border-bottom: 1px solid var(--color-line);
  color: var(--neutral-900);
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gutter);
}

.logo-tile {
  display: grid;
  place-items: center;
  height: 96px;
}

.logo-tile img {
  max-width: none;
  scale: 0.7;
}

@media (min-width: 48em) {
  .logo-tile { height: 120px; }
  .logo-tile img { scale: 1; }
}

@media (min-width: 80em) {
  .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Selected work ──────────────────────── */
.work {
  border-bottom: 1px solid var(--neutral-900);
  color: var(--neutral-900);
}

.gallery {
  display: grid;
  gap: var(--grid-gutter);
}

@media (min-width: 48em) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ── Gallery tile ───────────────────────── */
.gallery-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-tile);
}

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

.gallery-tile-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--neutral-900);
  color: var(--neutral-0);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out-expo);
}

.gallery-tile:hover .gallery-tile-overlay,
.gallery-tile:focus-visible .gallery-tile-overlay { opacity: 1; }

/* ── Approach & Process ─────────────────── */
.approach {
  --stack-gap: var(--space-2xl);
  border-bottom: 1px solid var(--neutral-900);
  color: var(--neutral-900);
}

.approach .split { --split-gap: 16px; }

.process-label { padding-top: 24px; }

@media (min-width: 48em) {
  .approach .split { --split-gap: 24px; }
}

/* ── Process step ───────────────────────── */
.process-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}

.process-step:nth-child(odd) { background: var(--brand-scarlet-fire-stripe); }

@media (min-width: 48em) {
  .process-step {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    min-height: 80px;
    padding: 12px 24px;
  }

  .process-step-number { flex: 0 0 56px; }
  .process-step-title  { flex: 0 0 280px; }
  .process-step-text   { flex: 1 1 0; min-width: 0; }
}

/* ── Contact section ────────────────────── */
.contact {
  --stack-gap: var(--space-l);
  background: var(--color-surface-inverse);
  border-bottom: 1px solid var(--neutral-900);
  color: var(--neutral-0);
}

.contact-email {
  align-self: flex-start;
  overflow-wrap: anywhere;
  transition: color var(--dur-fast) ease;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.contact-email:hover,
.contact-links a:hover { color: var(--color-accent); }

.contact-links a { transition: color var(--dur-fast) ease; }

/* ── Site footer ────────────────────────── */
.site-footer {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-3xl);
  padding-inline: max(var(--grid-margin), (100% - var(--grid-content)) / 2);
  background: var(--color-surface-inverse);
  color: var(--neutral-0);
}

.footer-brain {
  position: absolute;
  top: 0;
  right: -24px;
  width: 223px;
  height: auto;
  pointer-events: none;
}

.footer-bar {
  position: relative;
  display: flex;
  flex-direction: column;
}

.footer-bar a { text-decoration: underline; text-underline-offset: 0.2em; }

@media (min-width: 48em) {
  .footer-brain {
    top: 3px;
    right: 35px;
    width: 371px;
  }

  .footer-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-m);
  }
}

/* ── Case study: intro ──────────────────── */
.case-intro {
  --stack-gap: var(--space-l);
  padding-bottom: var(--space-2xl);
  color: var(--neutral-900);
}

.case-eyebrow,
.media-group figcaption,
.next-project-label { color: var(--color-ink-muted); }

.case-lead { max-width: 880px; }

/* ── Case study: overview ───────────────── */
.case-overview {
  --split-gap: var(--space-s);
  padding-top: 0;
  color: var(--neutral-900);
}

.case-overview p { max-width: 880px; }

/* ── Case study: media groups ───────────── */
.case-work {
  --stack-gap: var(--space-2xl);
  padding-top: 0;
}

.media-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols-mobile, 2), 1fr);
  gap: var(--grid-gutter);
}

.media-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio, 1);
  object-fit: cover;
  border-radius: var(--radius-tile);
}

.media-grid--cpp        { --cols: 3; --ratio: 416 / 902; }
.media-grid--screens    { --cols: 4; --ratio: 308 / 668; }
.media-grid--posts      { --cols: 3; }
.media-grid--mascots    { --cols: 2; }
.media-grid--covers     { --cols: 2; --ratio: 632 / 1370; }

/* Mobile: these rows become horizontal scroll strips, 160px per item. */
.media-grid--scroll {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.media-grid--scroll::-webkit-scrollbar { display: none; }
.media-grid--scroll > * { scroll-snap-align: start; }

@media (min-width: 48em) {
  .media-grid,
  .media-grid--scroll {
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    grid-auto-flow: row;
    overflow: visible;
  }
}

/* ── Case study: next project ───────────── */
.next-project {
  padding-top: 0;
  color: var(--neutral-900);
}

.next-project-link {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: var(--space-l);
  border-top: 1px solid var(--color-line);
}

.next-project-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.next-project-title .icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
  transition: translate var(--dur-base) var(--ease-out-expo);
}

.next-project-link:hover .icon { translate: 6px -6px; }

/* ── 404 ────────────────────────────────── */
.not-found {
  --stack-gap: var(--space-l);
  min-height: calc(100svh - var(--header-height));
  justify-content: center;
  color: var(--neutral-900);
}

.not-found a { text-decoration: underline; text-underline-offset: 0.2em; }
