/* ============================================================================
   Work: the /work index and the case studies.

   /work is organised by the situation each client was in. Converted case
   studies use the "story" layout (situation, work at full size, result,
   client's words, written detail). Both opt in to the dark theme.

   Studies not yet converted still use the .case-study sheet further down.
   ========================================================================== */

/* Full-width sections with one shared left edge. */
.work-intro,
.situation,
.own-work,
.story-hero,
.story-beat,
.story-quote,
.story-details {
  padding-inline: var(--gutter);
}

@media (min-width: 1200px) {
  .work-intro,
  .situation,
  .own-work,
  .story-hero,
  .story-beat,
  .story-quote,
  .story-details {
    padding-inline: clamp(2.5rem, 4vw, 3.5rem);
  }
}

/* --------------------------------------------------------- /work index */

.work-intro {
  padding-block: clamp(3rem, 7vw, 4.5rem) clamp(2rem, 4vw, 2.5rem);
}

.work-intro h1 {
  max-width: 18ch;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.work-intro p {
  margin-top: 1.2rem;
  font-size: var(--text-lede);
  color: var(--ink-muted);
}

.situation {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.2rem);
  padding-block: clamp(3rem, 7vw, 4.5rem);
  border-top: 1px solid var(--hairline);
}

.situation__headline {
  max-width: 17ch;
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}

.situation__headline em,
.story-hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.situation__answer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 3rem;
}

.situation__answer p {
  max-width: 36rem;
  font-size: var(--text-lede);
}

.situation__link {
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  white-space: nowrap;
}

/* The same sections on the home page. */
.home-work {
  border-top: 1px solid var(--hairline);
}

.home-work .work-intro h2 {
  max-width: 18ch;
  font-size: var(--text-h2);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.home-work__all {
  padding: 0 var(--gutter) var(--section-pad);
}

@media (min-width: 1200px) {
  .home-work__all {
    padding-inline: clamp(2.5rem, 4vw, 3.5rem);
  }
}

/* The work, straight on, in a strip that runs off the right edge and scrolls
   sideways. Nothing is cropped except long web pages, which show their first
   screen. */
.work-strip {
  --strip-height: clamp(13rem, 9rem + 14vw, 21rem);
  display: flex;
  align-items: flex-end;
  gap: clamp(0.75rem, 1.5vw, 1.1rem);
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  padding-bottom: 0.9rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

@media (min-width: 1200px) {
  .work-strip {
    margin-inline: calc(-1 * clamp(2.5rem, 4vw, 3.5rem));
    padding-inline: clamp(2.5rem, 4vw, 3.5rem);
  }
}

.work-strip__item {
  flex: none;
  height: var(--strip-height);
  overflow: hidden;
  border-radius: 6px;
}

.work-strip__item img {
  width: auto;
  max-width: none;
  height: 100%;
}

.work-strip__item--web {
  aspect-ratio: 16 / 10;
}

.work-strip__item--web img {
  width: 100%;
  height: auto;
}

.work-strip__item--phone {
  border: 5px solid #0b0a08;
  border-radius: 22px;
  background: #0b0a08;
}

/* ------------------------------------------------- the work we do for us */

.own-work {
  padding-block: clamp(3rem, 7vw, 4.5rem) var(--section-pad);
  border-top: 1px solid var(--hairline);
}

.own-work__heading {
  max-width: 20ch;
  font-size: var(--text-h2);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.own-work__project {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.own-work__name {
  margin-bottom: 0.5rem;
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
}

.own-work .work-strip {
  --strip-height: clamp(11rem, 8rem + 10vw, 16rem);
}

/* ------------------------------------------------------ case study story */

.story-hero {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding-block: clamp(3rem, 8vw, 5rem) clamp(2.5rem, 6vw, 4rem);
}

.story-hero h1 {
  max-width: 13ch;
  font-size: clamp(2.75rem, 1.2rem + 6.4vw, 6.6rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 0.98;
}

.story-hero p {
  max-width: 40rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem);
  color: var(--ink-muted);
}

.story-hero p strong {
  color: var(--ink);
}

/* One image across the full width of the page. */
.story-lead img {
  width: 100%;
}

.story-lead figcaption {
  padding: 0.75rem var(--gutter) 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* A headline and a few words beside the work it describes. */
.story-beat {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}

@media (min-width: 900px) {
  .story-beat {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  }

  .story-beat--flip {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  .story-beat--flip .story-beat__words {
    order: 2;
  }
}

.story-beat__words h2 {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.story-beat__words p {
  margin-top: 1.1rem;
  max-width: 26rem;
  font-size: var(--text-lede);
  color: var(--ink-muted);
}

.story-beat__work {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  align-items: start;
  min-width: 0;
}

/* A faint edge, so dark screens do not dissolve into the dark ground. */
.story-beat__work img,
.work-strip__item:not(.work-strip__item--phone) {
  outline: 1px solid var(--trace-faint);
  outline-offset: -1px;
}

.story-beat__work img {
  width: 100%;
  border-radius: 6px;
}

.story-beat__work--phones {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.story-beat__work--phones img {
  border: 5px solid #0b0a08;
  border-radius: 22px;
  background: #0b0a08;
}

.story-beat__work figcaption {
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* The result, on the one yellow, as its own screen. */
.story-result {
  display: grid;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: end;
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
  background: var(--accent);
  color: var(--on-accent);
}

@media (min-width: 1200px) {
  .story-result {
    padding-inline: clamp(2.5rem, 4vw, 3.5rem);
  }
}

@media (min-width: 1000px) {
  .story-result--figure {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.story-result__figure {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 1rem + 15vw, 15rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.8;
  white-space: nowrap;
}

.story-result__figure small {
  font-size: 0.4em;
  letter-spacing: -0.02em;
}

.story-result__words h2 {
  max-width: 18ch;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.05;
}

.story-result:not(.story-result--figure) .story-result__words h2 {
  max-width: 20ch;
  font-size: clamp(2.25rem, 1.2rem + 4vw, 4.4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.story-result__words p {
  margin-top: 1rem;
  max-width: 30rem;
}

.story-result :focus-visible {
  outline-color: var(--on-accent);
}

/* The client's words. */
.story-quote {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin: 0;
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

@media (min-width: 800px) {
  .story-quote--portrait {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}

.story-quote__portrait {
  width: 9rem;
  height: 9rem;
  object-fit: cover;
  border-radius: 50%;
}

.story-quote blockquote {
  max-width: 28ch;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.7rem);
  font-weight: 300;
  line-height: 1.18;
}

.story-quote figcaption {
  margin-top: 1.6rem;
  color: var(--ink-muted);
}

/* The written study, for anyone who wants all of it. */
.story-details {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(3rem, 7vw, 4rem) clamp(3.5rem, 8vw, 5rem);
  border-top: 1px solid var(--hairline);
}

@media (min-width: 1000px) {
  .story-details {
    grid-template-columns: 16rem minmax(0, 1fr);
  }
}

.story-details > h2 {
  font-size: var(--text-h2);
}

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

.story-details .prose h3 {
  font-size: var(--text-h3);
}

.story-details .trace-figure,
.story-details .pull-quote,
.story-details .video-facade {
  max-width: 60rem;
}

/* Captions say what the picture is; no figure numbers here. */
.story-details .trace-figure figcaption::before {
  content: none;
}

.story-details .pull-quote figcaption {
  margin-top: 1rem;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.story-details .pull-quote blockquote {
  margin: 0;
}

.story-details .pull-quote blockquote p {
  margin-bottom: 1rem;
}

/* ---------------------------------------------------- case study sheet */

.case-study {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 0 var(--gutter) var(--section-pad);
}

/* Wide feature banner at the top of a case study, matching the wide-image
   treatment used in the writings articles. Spans the full content width. */
.case-study__cover {
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
}

.case-study__cover img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
}

.case-study__body {
  margin-top: clamp(2rem, 5vw, 3rem);
}

.case-study__stat {
  margin: 1.25rem 0 0;
  max-width: 40rem;
}

.case-study__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.case-study__stat span {
  display: block;
  margin-top: 0.35rem;
}

/* Demoted headings inside the body: h2 acts as the section label, h3 as the
   subsection. Match the prose scale but keep BLUF/Role/Details prominent. */
.case-study__body.prose h2 {
  margin-top: 2.5em;
  font-family: var(--font-display);
  font-size: var(--text-h2);
  letter-spacing: -0.01em;
}

.case-study__body.prose h2:first-child {
  margin-top: 0;
}

.case-study__wip {
  margin-top: 1.5rem;
  padding: 0.85rem 1.1rem;
  border: 1px dashed var(--hairline);
  background: rgba(255, 255, 255, 0.3);
  font-size: var(--text-description);
  color: var(--ink);
}

.case-study__video {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
}

.case-study .pull-quote figcaption {
  margin-top: 1rem;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.case-study .pull-quote blockquote {
  margin: 0;
}

.case-study .pull-quote blockquote p {
  margin-bottom: 1rem;
}

.case-study .pull-quote blockquote p:last-child {
  margin-bottom: 0;
}
