/* Case study pages, Ink & Paper: a magazine spread per project. Uses the tokens in site.css. */

/* ---------- hero: who, the headline, the brief in three columns, then the cover full bleed */
.case-hero { padding-top: calc(var(--nav-h) + clamp(24px, 5vh, 56px)); }
.case-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3) var(--s-6); padding-bottom: var(--s-4); border-bottom: 1px solid var(--ink); }
.case-top a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.case-top a:hover { text-decoration: underline; text-underline-offset: 5px; }
.case-top .m-arrow--back { transform: scaleX(-1); }
.case-kicker { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-7); margin: clamp(28px, 6vh, 64px) 0 var(--s-5); }
.case-hero h1 { font-size: clamp(2.6rem, 1rem + 4.9vw, 7rem); line-height: .9; letter-spacing: -0.055em; max-width: 17ch; }
.case-cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 4fr); gap: var(--s-7) var(--gutter); margin-top: clamp(40px, 8vh, 88px); align-items: start; }
.case-cols .voice { font-size: clamp(1.6rem, 1.1rem + 1.3vw, 2.4rem); line-height: 1.08; }
.case-cols__text { font-size: 1.0625rem; line-height: 1.6; color: #34332f; }
.case-stats { border-bottom: 1px solid var(--ink); }
.case-stat { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: var(--s-3) 0 var(--s-4); border-top: 1px solid var(--ink); }
.case-stat b { font: 400 clamp(2.6rem, 1.6rem + 2vw, 3.8rem)/.95 var(--font-serif); letter-spacing: -0.02em; font-weight: 400; }
.case-stat span { font-size: .875rem; color: var(--muted); max-width: 18ch; text-align: right; line-height: 1.35; }
.case-cover { margin-top: clamp(48px, 9vh, 104px); height: clamp(320px, 82svh, 860px); overflow: clip; background: var(--surface); }
.case-cover img { width: 100%; height: 118%; object-fit: cover; object-position: 50% 40%; transform: translate3d(0, var(--py, 0px), 0); will-change: transform; }

/* ---------- story: the measured outcomes stay beside the reader while the project scrolls */
.case-story__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s-8) var(--gutter); align-items: start; }
.case-outcomes { position: sticky; top: calc(var(--nav-h) + 16px); display: grid; gap: var(--s-4); }
.metrics { border-top: 1px solid var(--ink); }
.metric { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.metric__value { font: 400 clamp(3.4rem, 2rem + 3vw, 5.4rem)/.85 var(--font-serif); letter-spacing: -0.02em; }
.metric__label { font-weight: 500; }
.metric__context { font-size: .875rem; line-height: 1.5; color: var(--muted); }
.case-story__body h2 { font-size: clamp(2.2rem, 1.2rem + 2.8vw, 4.25rem); line-height: .95; max-width: 18ch; margin: var(--s-4) 0 var(--s-6); }
.case-story__intro { display: grid; gap: var(--s-4); font-size: var(--t-lead); line-height: 1.6; max-width: 64ch; }
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); margin: clamp(40px, 7vh, 72px) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--ink); }
.case-meta dt { font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.case-meta dd { font-size: .9375rem; line-height: 1.5; }
.chapter { padding-top: clamp(56px, 10vh, 112px); display: grid; gap: var(--s-5); }
.chapter h3 { display: grid; gap: var(--s-3); font: 600 clamp(1.6rem, 1rem + 1.6vw, 2.6rem)/1.02 var(--font-display); letter-spacing: -0.04em; max-width: 22ch; }
.chapter__num { font: italic 400 clamp(3rem, 2rem + 2.4vw, 4.5rem)/.8 var(--font-serif); letter-spacing: -0.02em; }
.chapter > p { font-size: 1.0625rem; line-height: 1.65; max-width: 64ch; color: #34332f; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gutter); }
.checks li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); font-size: .9375rem; line-height: 1.5; }
.checks__icon { width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chapter__note { border-left: 2px solid var(--ink); padding: 4px 0 4px var(--s-5); max-width: 64ch; }
.chapter__note-title { font: italic 400 1.6rem/1.15 var(--font-serif); margin-bottom: 6px; }
.chapter__note p:last-child { color: var(--muted); }
.chapter__shot { margin-top: var(--s-3); }

/* a screen that opens full size */
.shot { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--surface); border-radius: var(--r-md); overflow: clip; cursor: zoom-in; }
.shot img { width: 100%; height: auto; transition: transform 700ms var(--ease-out); }
.shot__hint { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity 200ms var(--ease), transform 300ms var(--ease-out); }
.shot__hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) {
  .shot:hover img { transform: scale(1.02); }
  .shot:hover .shot__hint { opacity: 1; transform: none; }
}
.shot:focus-visible .shot__hint { opacity: 1; transform: none; }

/* ---------- modules: interface architecture, one tab per module */
.case-modules { border-top: 1px solid var(--ink); }
.case-modules .section-head h2, .case-screens .section-head h2 { max-width: 16ch; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); border-bottom: 1px solid var(--line); margin-bottom: clamp(32px, 6vh, 56px); }
.tab { position: relative; min-height: 52px; padding: 0; border: 0; background: none; cursor: pointer; font: 500 1.0625rem/1.2 var(--font-text); color: var(--muted); text-align: left; }
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 320ms var(--ease-out); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.module { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s-7) var(--gutter); align-items: start; }
.module[hidden] { display: none; }
.module__text { display: grid; gap: var(--s-4); }
.module__role { font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.module h3 { font: italic 400 clamp(2rem, 1.3rem + 1.6vw, 3rem)/1 var(--font-serif); letter-spacing: -0.01em; }
.module__desc { line-height: 1.6; color: #34332f; }
.module .checks { grid-template-columns: 1fr; }
@media (prefers-reduced-motion: no-preference) {
  .module:not([hidden]) { animation: module-in 520ms var(--ease-out); }
  @keyframes module-in { from { opacity: 0; transform: translateY(12px); } }
}

/* ---------- screens: a magazine gallery, wide plates and pairs */
.case-screens { border-top: 1px solid var(--ink); }
.screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vh, 64px) var(--gutter); }
.screen--wide { grid-column: 1 / -1; }
.screen { display: grid; gap: var(--s-3); }
.screen__text { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding-top: var(--s-2); border-top: 1px solid var(--line); }
.screen__text h3 { font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.screen__text p { font-size: .875rem; color: var(--muted); text-align: right; }

/* ---------- faq */
.case-faq { border-top: 1px solid var(--ink); }
.case-faq__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7) var(--gutter); align-items: start; }
.case-faq h2 { font-size: clamp(2.4rem, 1.2rem + 3.4vw, 5rem); position: sticky; top: calc(var(--nav-h) + 16px); }
.faq { border-top: 1px solid var(--ink); }
.faq__item { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.faq dt { font: italic 400 clamp(1.4rem, 1.1rem + .8vw, 1.9rem)/1.15 var(--font-serif); margin-bottom: var(--s-3); }
.faq dd { line-height: 1.65; color: #34332f; max-width: 64ch; }

/* ---------- next case: an ink band with the name set giant */
.case-next { background: var(--ink); color: var(--bg); padding-block: clamp(72px, 12vh, 140px); }
.next { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-7) var(--gutter); align-items: end; }
.next__meta { display: block; margin-bottom: var(--s-5); color: rgba(239, 237, 231, .65); }
.next__title { display: block; font: 600 clamp(3.2rem, 1rem + 8vw, 10rem)/.82 var(--font-display); letter-spacing: -0.065em; }
.next__title em { display: block; font: italic 400 clamp(1.5rem, 1rem + 1.4vw, 2.4rem)/1.1 var(--font-serif); letter-spacing: -0.01em; margin-top: var(--s-4); max-width: 26ch; }
.next__cta { display: inline-flex; align-items: center; gap: 10px; margin-top: var(--s-6); border-bottom: 1px solid currentColor; padding-bottom: 4px; }
.next__media { display: block; border-radius: var(--r-md); overflow: clip; aspect-ratio: 4 / 3; }
.next__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .next:hover .next__media img { transform: scale(1.04); } .next:hover .next__title { font-style: normal; } }
.next:focus-visible { outline-color: var(--bg); outline-offset: 8px; }

/* ---------- the full-size viewer */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(18, 18, 17, .97); color: #efede7; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.lightbox__count { font: 500 .75rem/1 var(--font-mono); letter-spacing: .1em; opacity: .7; }
.lightbox__fig { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; margin: 0; padding: 0 clamp(16px, 7vw, 96px) 20px; min-height: 0; }
.lightbox__fig img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.lightbox figcaption { display: grid; gap: 4px; text-align: center; }
.lightbox__title { font: italic 400 1.5rem/1.1 var(--font-serif); }
.lightbox__sub { opacity: .65; font-size: .875rem; }
.lightbox__btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(239, 237, 231, .3); background: transparent; color: inherit; cursor: pointer; }
.lightbox__btn:hover { background: #efede7; color: #121211; }
.lightbox__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox :focus-visible { outline-color: #efede7; }

/* ---------- the hero entrance */
@media (prefers-reduced-motion: no-preference) {
  .case-hero :is(.case-kicker, h1, .case-cols) { transition: opacity 800ms var(--ease), transform 1000ms var(--ease-out); }
  .case-hero h1 { transition-delay: 80ms; }
  .case-hero .case-cols { transition-delay: 220ms; }
  .case-cover { transition: clip-path 1300ms var(--ease-out) 200ms; clip-path: inset(0); }
  .ink-pre .case-hero :is(.case-kicker, h1, .case-cols) { opacity: 0; transform: translateY(24px); }
  .ink-pre .case-cover { clip-path: inset(12% 4% 0 4%); }
}

/* ---------- smaller screens */
@media (max-width: 1023px) {
  .case-cols { grid-template-columns: 1fr 1fr; }
  .case-cols .voice { grid-column: 1 / -1; }
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .case-story__grid, .module, .case-faq__grid, .next { grid-template-columns: 1fr; }
  .case-outcomes { position: static; }
  .metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s-4); }
  .metric__context { display: none; }
  .case-faq h2 { position: static; }
}
@media (max-width: 699px) {
  .case-cols { grid-template-columns: 1fr; gap: var(--s-6); }
  .case-kicker { gap: var(--s-2) var(--s-5); }
  .case-cover { height: 56svh; }
  .metrics { grid-template-columns: 1fr; }
  .metric { grid-template-columns: auto 1fr; align-items: baseline; column-gap: var(--s-4); }
  .metric__value { font-size: 3rem; }
  .checks { grid-template-columns: 1fr; }
  .screens { grid-template-columns: 1fr; }
  .screen__text { flex-direction: column; gap: 2px; }
  .screen__text p { text-align: left; }
  .case-top .case-top__count { display: none; }
}

/* tabs with the motion kit's sliding ink pill: the label turns paper on the pill, the underline steps aside */
.tabs.m-has-ind { gap: var(--s-2); border-bottom: 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-btn); width: fit-content; max-width: 100%; }
.tabs.m-has-ind .tab { min-height: 44px; padding: 0 clamp(14px, 1.6vw, 22px); border-radius: var(--r-btn); font-size: 1rem; }
.tabs.m-has-ind .tab::after { display: none; }
.tabs.m-has-ind .tab[aria-selected="true"] { color: var(--bg); }
@media (max-width: 699px) {
  .tabs.m-has-ind { border-radius: 22px; }
  .tabs.m-has-ind .tab { flex: 1 1 100%; justify-content: flex-start; }
}
