/* ==========================================================================
   Lilo Socials — Case study detail pages (shared components)
   Used by work-cozmck.html and work-hoskett-hill.html
   ========================================================================== */

/* ---------------------------------- Hero ---------------------------------- */
.case-hero {
  position: relative;
  padding-top: clamp(7rem, 5.5rem + 5vw, 10rem);
  /* the section right after this one is pulled up over it by --wave-h (see
     .wave-top) to mask into the incoming wave curve — padding-bottom has to
     clear that full pull-up on top of its own breathing room, or the curve
     overlaps real hero copy instead of empty space beneath it */
  padding-bottom: calc(var(--space-6) + clamp(70px, 8vw, 140px));
  overflow: hidden;
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--text-small);
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity var(--duration-fast) var(--ease-soft), transform var(--duration-fast) var(--ease-soft);
}

.case-back:hover {
  opacity: 1;
  transform: translateX(-3px);
}

.case-back svg {
  flex-shrink: 0;
}

.case-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.case-hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4em 1em;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.case-hero h1 {
  margin-top: var(--space-4);
}

.case-hero .text-lead {
  margin-top: var(--space-4);
  max-width: 62ch;
}

/* ---------------------------------- Generic section rhythm ---------------------------------- */
.case-section {
  position: relative;
  padding-block: var(--section-pad-y);
}

.case-section--tight {
  padding-block: var(--space-6);
}

.case-section-head {
  max-width: 720px;
  margin-bottom: var(--space-6);
}

/* Every section title across both case-study pages uses this one size,
   whether it sits in .case-section-head, .case-brief, .case-outcome, or
   bare inside a .case-two-col column — several of those had no font-size
   rule of their own at all and were silently falling back to the browser
   default h2 size. */
.case-heading {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
}

.case-section-head .text-lead {
  margin-top: var(--space-3);
}

.case-section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* ---------------------------------- Brief / challenge callout ---------------------------------- */
.case-brief {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.case-brief .text-lead {
  margin-top: var(--space-3);
}

/* Simple bullet list — challenge / strategy points, tone of voice notes */
.case-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.case-list li {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.case-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.case-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 760px) {
  .case-two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------- Colour swatches (click to copy) ---------------------------------- */
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-4);
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.swatch-chip {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-soft);
}

.swatch:hover .swatch-chip {
  transform: scale(1.08);
}

.swatch:active .swatch-chip {
  transform: scale(0.96);
}

.swatch-copied {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 15, 41, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
  pointer-events: none;
}

.swatch.is-copied .swatch-copied {
  opacity: 1;
  transform: scale(1);
}

.swatch-name {
  font-size: var(--text-small);
  font-weight: 700;
}

.swatch-hex {
  font-size: var(--text-caption);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------------------------------- Typography specimen ---------------------------------- */
.type-sample {
  margin-top: var(--space-5);
}

.type-sample + .type-sample {
  margin-top: var(--space-5);
}

.type-sample-name {
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.type-sample-glyphs {
  margin-top: var(--space-1);
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.4rem);
  line-height: 1.4;
  word-break: break-word;
}

/* Typography specimen cards: shown at real display size (rather than a
   couple of small plain lines) so each font's actual character is visible
   at a glance, styled to match the weight of the palette swatches next to
   them instead of reading as an afterthought. */
.type-specimen-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.type-specimen-card {
  flex: 1 1 180px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--brand-cream);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.type-specimen-label {
  display: block;
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.type-specimen-glyphs {
  display: block;
  margin-top: var(--space-2);
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  line-height: 1;
  color: var(--text-primary);
}

.type-specimen-sample {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-small);
  color: var(--text-muted);
  word-break: break-word;
}

/* ---------------------------------- Poster / photo grids + lightbox ---------------------------------- */
.media-grid {
  display: grid;
  gap: var(--space-4);
}

.media-grid--4up {
  grid-template-columns: repeat(4, 1fr);
}

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

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

@media (max-width: 560px) {
  .media-grid--4up,
  .media-grid--3up {
    grid-template-columns: 1fr;
  }
}

.media-tile {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  cursor: zoom-in;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--brand-cream);
}

.media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-premium);
}

.media-tile:hover img {
  transform: scale(1.05);
}

.media-tile-zoom {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 15, 41, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.media-tile:hover .media-tile-zoom {
  opacity: 1;
  transform: translateY(0);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 26, 0.92);
  padding: var(--space-5);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-img {
  max-width: min(90vw, 900px);
  max-height: 86vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.lightbox.is-open .lightbox-img {
  opacity: 1;
  transform: scale(1);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(246, 244, 241, 0.12);
  border: 1px solid rgba(246, 244, 241, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-soft);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(246, 244, 241, 0.25);
}

.lightbox-close {
  top: var(--space-4);
  right: var(--space-4);
}

.lightbox-prev {
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

/* ---------------------------------- Video cards ---------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 900px) {
  .video-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }
}

.video-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--navy-deep);
  box-shadow: var(--shadow-sm);
}

.video-card video,
.video-card .video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-card .video-poster {
  transition: opacity 0.3s var(--ease-soft);
}

.video-card.is-playing .video-poster {
  opacity: 0;
  pointer-events: none;
}

.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: none;
  background: rgba(15, 15, 41, 0.25);
  cursor: pointer;
}

.video-card.is-playing .video-play {
  display: none;
}

.video-play-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(246, 244, 241, 0.92);
  display: grid;
  place-items: center;
  color: var(--navy-deep);
  transition: transform var(--duration-fast) var(--ease-soft);
}

.video-card:hover .video-play-icon {
  transform: scale(1.08);
}

.video-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-3);
  background: linear-gradient(0deg, rgba(15, 15, 41, 0.75), transparent);
  color: #fff;
  font-size: var(--text-caption);
  font-weight: 600;
  pointer-events: none;
}

.video-card.is-playing .video-caption {
  opacity: 0;
}

/* ---------------------------------- IG grid frame ---------------------------------- */
.ig-frame {
  max-width: 420px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--navy-deep);
}

.ig-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------------------------------- Content pillars ---------------------------------- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}

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

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

.pillar-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--brand-cream);
  transition: transform var(--duration-base) var(--ease-premium), box-shadow var(--duration-base) var(--ease-premium);
}

.pillar-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.pillar-card h3 {
  font-size: var(--text-h3);
  /* reserves space for a two-line title so the underline (and everything
     below it) lines up across cards, regardless of whether a given card's
     title wraps to one line or two */
  min-height: calc(2.2em + var(--space-2));
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.pillar-card p {
  margin-top: var(--space-3);
  font-size: var(--text-small);
  line-height: var(--leading-body);
}

.pillar-card > p:first-of-type {
  /* same reasoning as the h3 fix above: this intro line wraps to a
     different number of lines per card (up to 3 at this column width),
     which was pushing the "e.g." example line below it out of alignment
     across the row */
  min-height: calc(3 * var(--leading-body) * 1em);
}

.pillar-card p.pillar-example {
  color: var(--brand-primary);
  font-style: italic;
  /* same reasoning as the intro line above: wraps to a different number
     of lines per card, which was pushing pillar-why out of alignment */
  min-height: calc(3 * var(--leading-body) * 1em);
}

.pillar-card p.pillar-why {
  color: var(--text-muted);
}

/* ---------------------------------- Content mix donut chart ---------------------------------- */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  justify-content: center;
}

.donut-chart {
  width: min(280px, 60vw);
  height: min(280px, 60vw);
  flex-shrink: 0;
}

.donut-chart circle.donut-segment {
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 1.2s var(--ease-premium);
  cursor: pointer;
}

.donut-chart.is-visible circle.donut-segment {
  stroke-dashoffset: var(--donut-offset, 0);
}

.donut-center {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 100;
}

.donut-legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-small);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-soft);
}

.donut-legend li:hover,
.donut-legend li.is-active {
  transform: translateX(4px);
}

.donut-legend .swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend strong {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------- Roadmap timeline ---------------------------------- */
.roadmap-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
}

@media (max-width: 900px) {
  .roadmap-track {
    grid-template-columns: 1fr;
  }
  .roadmap-line {
    display: none;
  }
}

.roadmap-line {
  position: absolute;
  top: 27px;
  left: 4%;
  right: 4%;
  height: 2px;
  background: rgba(246, 244, 241, 0.15);
  z-index: 0;
}

.roadmap-line-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--brand-sand);
  transform-origin: left center;
}

.roadmap-step {
  position: relative;
  z-index: 1;
}

.roadmap-index {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy-deep);
  border: 2px solid rgba(246, 244, 241, 0.25);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 100;
  font-size: var(--text-caption);
  font-weight: 700;
  margin-bottom: var(--space-3);
  text-align: center;
  line-height: 1.15;
}

.roadmap-step h3 {
  color: var(--text-inverse);
  font-size: var(--text-h3);
  margin-bottom: var(--space-3);
}

.roadmap-step h4 {
  color: var(--brand-sand);
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-3);
}

.roadmap-step p {
  color: rgba(246, 244, 241, 0.75);
  font-size: var(--text-small);
  margin-top: var(--space-1);
}

/* ---------------------------------- Framed Instagram post mockups ---------------------------------- */
.mockup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}

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

@media (max-width: 560px) {
  .mockup-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin-inline: auto;
  }
}

.mockup-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.5s var(--ease-premium), box-shadow 0.5s var(--ease-premium);
  box-shadow: var(--shadow-sm);
}

.mockup-card:nth-child(odd) {
  transform: rotate(-2deg);
}

.mockup-card:nth-child(even) {
  transform: rotate(2deg);
}

.mockup-card:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.mockup-card img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------------------------------- Organic performance stats ---------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}

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

.stat-tile {
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(246, 244, 241, 0.06);
  border: 1px solid rgba(246, 244, 241, 0.12);
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 100;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 700;
  color: var(--brand-sand);
}

.stat-label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: rgba(246, 244, 241, 0.7);
}

/* ---------------------------------- Outcome / closing statement ---------------------------------- */
.case-outcome {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.case-outcome .text-lead {
  margin-top: var(--space-3);
}

/* ---------------------------------- Wave-top glow wrappers ---------------------------------- */
/* Same technique as #work / .testimonials / .contact-cta / .site-footer on
   the homepage: pulls the wrapper up over whatever precedes it and masks
   its own top edge into the wave curve, so the curve reveals a literal
   continuation of THIS wrapper's own glow instead of a flat-colour swatch
   that hands off to a separately-appearing glow further down the page. */
.wave-top {
  --wave-h: clamp(70px, 8vw, 140px);
  margin-top: calc(-1 * var(--wave-h));
  padding-top: var(--wave-h);
  -webkit-mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C240,70 480,0 720,30 C960,60 1200,70 1440,30 L1440,100 L0,100 Z' fill='%23000'/%3E%3C/svg%3E"),
    linear-gradient(#000, #000);
  mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C240,70 480,0 720,30 C960,60 1200,70 1440,30 L1440,100 L0,100 Z' fill='%23000'/%3E%3C/svg%3E"),
    linear-gradient(#000, #000);
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: top, bottom;
  mask-position: top, bottom;
  -webkit-mask-size: 100% var(--wave-h), 100% calc(100% - var(--wave-h));
  mask-size: 100% var(--wave-h), 100% calc(100% - var(--wave-h));
}
