/* ==========================================================================
   D03 — Mara Lind · Case study: Hofmark Dairy
   (demos/mara-lind/case-study-hofmark.html)
   Title, full-bleed cover, facts, two-column story rows, proof rounds,
   before/after slider, image sequence, pull quote, result cards,
   testimonial, CTA band and next-project teaser.
   ========================================================================== */

/* Cross-document view transition from the work page (shared "hofmark" frame) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* ---- Section rhythm ----------------------------------------------------- */
.case-section {
  margin-top: clamp(80px, 10vw, 144px);
}

/* ---- Title & cover ------------------------------------------------------ */
.case-hero {
  padding-top: clamp(40px, 6vw, 80px);
}

.case-hero__kicker {
  margin-bottom: 20px;
}

.case-hero__title {
  max-width: 13em;
  font-size: clamp(44px, 7.5vw, 128px);
  line-height: .92;
  text-wrap: balance;
}

/* Full-bleed images (no radius, fluid padding) */
.case-cover,
.case-bleed {
  width: 100%;
  padding: clamp(16px, 3vw, 40px);
  border-radius: 0;
}

.case-cover {
  max-height: 84vh;
  margin-top: clamp(32px, 5vw, 64px);
  view-transition-name: hofmark;
}

/* ---- Facts -------------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0 24px;
  margin-top: 32px;
  margin-bottom: 0;
  border-top: 1px solid var(--ink);
}

.fact {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.fact__value {
  margin: 4px 0 0;
  font-size: 16px;
}

/* ---- Story rows: label + heading left, text right ------------------------ */
.case-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.case-row__head {
  grid-column: 1 / span 4;
  min-width: 0;
}

.case-row__kicker {
  margin-bottom: 12px;
}

.case-row__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  grid-column: 6 / span 7;
  min-width: 0;
}

.case-row__text {
  margin: 0;
  max-width: 36em;
  text-wrap: pretty;
}

/* Full-width media row inside a story row */
.case-row__wide {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 24px;
}

/* ---- Credits ------------------------------------------------------------ */
.credits {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.credit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.credit__role {
  color: var(--muted);
}

.credit__name {
  margin: 0;
  font-weight: 600;
}

/* ---- Proof rounds ------------------------------------------------------- */
.rounds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 24px);
}

.round {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.round__media {
  position: relative;
}

.round__stamp {
  position: absolute;
  top: 10px;
  right: 10px;
}

.round__stamp .stamp {
  transform: rotate(-7deg);
}

.round__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.round__version {
  font-size: 13px;
  color: var(--ink);
}

.round__text {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

.rounds__note {
  margin-top: 16px;
  font-family: var(--f-hand);
  font-size: 30px;
  color: var(--accent-text);
  text-align: center;
  transform: rotate(-2deg);
}

/* ---- Before / after slider ---------------------------------------------- */
.compare {
  --pos: 50%;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid var(--line);
}

.compare__after,
.compare__before {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.compare__after {
  justify-content: flex-end;
  background: repeating-linear-gradient(45deg, var(--line) 0 6px, var(--surface) 6px 12px);
}

/* "Before" layer is clipped at the divider */
.compare__before {
  background: repeating-linear-gradient(135deg, var(--ph) 0 10px, var(--ph-stripe) 10px 11px);
  filter: grayscale(1);
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}

.compare__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas);
}

/* Invisible native range on top: pointer + keyboard control */
.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.compare:focus-within .compare__knob {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Image sequence ----------------------------------------------------- */
.sequence__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sequence {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 clamp(20px, 4vw, 56px) 12px;
}

.sequence__item {
  flex: 0 0 min(64vw, 320px);
  scroll-snap-align: start;
}

/* ---- Pull quote --------------------------------------------------------- */
.pull-quote {
  display: grid;
  grid-template-columns: minmax(0, 80px) minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: clamp(32px, 5vw, 64px) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.pull-quote__mark {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  text-transform: var(--d-case);
  letter-spacing: var(--d-track);
  font-size: 120px;
  line-height: .7;
  color: var(--accent);
}

.pull-quote__text {
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.12;
}

.pull-quote__caption {
  margin-top: 16px;
  color: var(--muted);
}

/* ---- Result cards ------------------------------------------------------- */
.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.result-card--featured {
  border-color: var(--ink);
}

.result-card__number {
  position: relative;
  align-self: flex-start;
  font-size: clamp(48px, 5vw, 76px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Underline stroke sits 14px below the number */
.result-card__number > .mark {
  bottom: -14px;
}

.result-card__label {
  font-weight: 600;
}

.result-card--featured .result-card__label {
  margin-top: 10px;
}

.result-card__baseline {
  font-size: 15px;
  color: var(--muted);
}

.result-card__source {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---- Testimonial -------------------------------------------------------- */
.quote {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.quote__stamp {
  position: absolute;
  top: 18px;
  right: 18px;
}

.quote__stamp .stamp {
  transform: rotate(-6deg);
}

.quote__text {
  max-width: 24em;
  margin: 0;
  padding-right: 96px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.2;
  text-indent: -.4em;
}

.quote__author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quote__avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: repeating-linear-gradient(135deg, var(--ph) 0 10px, var(--ph-stripe) 10px 11px);
  filter: var(--img-filter);
}

.quote__name {
  display: block;
  font-weight: 600;
}

.quote__role {
  display: block;
  font-size: 15px;
  color: var(--muted);
}

/* ---- CTA band ----------------------------------------------------------- */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: clamp(28px, 4vw, 48px);
  background: var(--accent);
  color: var(--on-accent);
}

.cta-band__title {
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.05;
}

.cta-band__button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 14px 22px;
  background: var(--on-accent);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.cta-band__button:hover {
  color: var(--ink);
}

/* ---- Next project ------------------------------------------------------- */
.next-project {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  align-items: end;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}

.next-project__title {
  display: block;
  margin-top: 10px;
  font-size: var(--t-h1);
  line-height: 1;
}

.next-project__label {
  display: block;
}
