/* =========================================================
   WORK: /work on aesv.io
   Inherits .subpage shell (and its inter-section gap) from
   foundation.css. Section h2s render through the shared
   :where(.work-section) > h2 rule, and the page-head lede
   reads its size/color from .page-head .lede in foundation.
   This file owns only the bespoke pieces: shape grid, the
   surfaces marquees, the standalone CTA, and case-study
   cards.
   ========================================================= */

.work-shell {
  overflow-wrap: anywhere;
}
.work-shell h1,
.work-shell h2,
.work-shell h3 {
  overflow-wrap: anywhere;
}

/* ---------- Title-sized button. Used by the CTA section. */
.btn-xl {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: -0.01em;
  padding: 0.875rem 1.75rem;
  gap: 0.875rem;
}

/* ---------- Problem-shape cards (six in a 3-column grid).
   Each .shape-card uses .tile for chrome from foundation.css.
   Heading + one-line clarifier. */
.shape-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  /* Three columns inside the 64rem content band; downsteps to
     two on tablet and one on phone. */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
@media (max-width: 720px) {
  .shape-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .shape-grid {
    grid-template-columns: 1fr;
  }
}

.shape-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.shape-h {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.shape-body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

/* ---------- Surfaces marquees.
   Two opposing scrolls: "things i work on" goes left, "things i do"
   goes right. Each track is a flex row of two identical groups; the
   animation slides the track by half its width so the loop is seamless. */
.surfaces-section {
  /* Override the shared work-section gap with a tighter pair-spacing
     so the two marquees read as a single stacked element. */
  gap: 1rem;
}

.marquee {
  width: 100%;
  overflow: hidden;
  position: relative;
  /* Soft fade at the edges so items don't pop visually at the cutoff. */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    var(--ink) 5%,
    var(--ink) 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    var(--ink) 5%,
    var(--ink) 95%,
    transparent 100%
  );
}

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

.marquee-group {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding-right: 0.625rem;
  flex-shrink: 0;
}

.marquee-sep {
  color: var(--ink-mute);
  padding: 0 4px;
}

/* Two opposing directions. Each track is 2x the visible width
   (group + duplicate), so a -50% translate is exactly one group's
   worth of distance, which is what makes the loop seamless. */
@keyframes marquee-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

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

.marquee-left .marquee-track {
  animation: marquee-left 60s linear infinite;
}

.marquee-right .marquee-track {
  animation: marquee-right 60s linear infinite;
}

/* Pause on hover so a reader can stop and read. */
.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .marquee-left .marquee-track,
  .marquee-right .marquee-track {
    animation: none;
  }
  .marquee-right .marquee-track {
    transform: translateX(-50%);
  }
}

/* ---------- CTA. Standalone lavender button under its h2.
   Pinned to the start of the section so it reads as a deliberate
   gesture rather than centered hero chrome. */
.cta-section {
  align-items: flex-start;
}

/* ---------- Case-study cards.
   Auto-fit grid: each card has a target width, and the grid
   packs in as many columns as fit at the current viewport.
   At 1200px ~3 cards across, at 1800px ~4, at 2400px ~6. Cards
   never stretch past their target — the leftover space sits as
   gutter so the cards stay a comfortable size at any width.
   No aspect-ratio constraint either — cards size to content so
   the "read" arrow always sits below the summary. */
.case-card-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  /* Three columns inside the 64rem content band; downsteps to
     two on tablet and one on phone. */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
@media (max-width: 720px) {
  .case-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .case-card-grid {
    grid-template-columns: 1fr;
  }
}
.case-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.25rem 1.25rem 1rem;
  text-decoration: none;
  color: var(--ink);
  /* The case study reads as a finished artifact — a square card. At
     the 1-col phone breakpoint the square would force a tall narrow
     box, so cards size to content there. */
  aspect-ratio: 1 / 1;
}
@media (max-width: 480px) {
  .case-card {
    aspect-ratio: auto;
  }
}
.case-card:hover {
  color: var(--ink);
}
.case-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}
.case-card-summary {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--ink-mute);
  margin: 0;
  flex: 1 1 auto;
}
.case-card-arrow {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  align-self: flex-end;
  color: var(--ink);
  margin-top: 0.5rem;
}
.case-card:hover .case-card-arrow {
  color: var(--lavender);
}

/* ---------- Case-study detail page (used by /work/<slug>). */
.case-study-detail .case-fact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.case-study-detail .case-fact {
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.case-study-detail .case-fact-impact {
  --tile-bg: var(--lavender);
  color: var(--offwhite);
}
.case-study-detail .case-fact-impact .block-eyebrow {
  color: rgb(from var(--cream) r g b / 0.7);
}
.case-study-detail .case-fact p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}
.case-study-detail .case-fact-stack p {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink-mute);
}
@media (max-width: 640px) {
  .case-study-detail .case-fact-row {
    grid-template-columns: 1fr;
  }
}
.case-prose {
  max-width: var(--reading-default);
}

/* No billboard tier — type and shell are locked to the default
   scale regardless of viewport width. See foundation.css. */
