/* Shared by the case-study pages. Tokens and header/footer match index.html. */
:root {
  --black: #000;
  --white: #F4F4F2;
  --grey: #8E9097;
  --grey-2: #8A8C93;
  --rule: #1F2125;
  --field: #0E0F11;
  --blue: #5B97FF;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--black); }
body { margin: 0; background: var(--black); color: var(--white); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--blue); color: var(--black); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
@media (min-width: 700px) { .wrap { padding-inline: 32px; } }
.narrow { max-width: 760px; margin-inline: auto; }
h1, h2, h3 { font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 5.6vw, 64px); line-height: 1.04; letter-spacing: -.04em; }
h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -.03em; }
h3 { font-size: 19px; line-height: 1.35; letter-spacing: -.01em; }
p { margin: 0 0 14px; }
.small { font-size: 14px; line-height: 1.5; color: var(--grey-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 24px;
       border-radius: 10px; font: 600 16px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:hover { background: #fff; }
.btn-outline { background: transparent; color: var(--white); border-color: #3B3D43; }
.btn-outline:hover { border-color: var(--white); }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 559px) { .buttons .btn { flex: 1 1 100%; } }

/* header, same as the home page */
.top { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; border-bottom: 1px solid var(--rule); }
.brand { display: block; line-height: 0; }
.brand img { height: 22px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--grey); }
.nav a:hover, .nav a[aria-current] { color: var(--white); }
.nav .tel { color: var(--white); font-weight: 600; }
@media (max-width: 759px) { .nav { gap: 18px; font-size: 14px; } .nav .wide { display: none; } }

footer { border-top: 1px solid var(--rule); padding-block: 32px 40px; font-size: 14px; color: var(--grey-2); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
footer img { height: 18px; width: auto; margin-right: 8px; }
footer a { color: var(--grey); text-decoration: none; }
footer a:hover { color: var(--white); }

/* article head */
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 15px; color: var(--grey); }
.crumbs a { color: var(--white); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }
.head { padding-block: 64px 48px; text-align: center; }
@media (min-width: 900px) { .head { padding-block: 96px 56px; } }
.head h1 { margin-top: 22px; }
.head .sub { margin: 22px auto 0; max-width: 40ch; color: var(--grey); font-size: clamp(18px, 1.9vw, 21px); line-height: 1.5; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 40px auto 0; max-width: 760px; border-top: 1px solid var(--rule); text-align: left; }
.facts div { padding: 16px 16px 0 0; }
.facts dt { font-size: 13px; color: var(--grey-2); }
.facts dd { margin: 4px 0 0; font-size: 15px; line-height: 1.4; }
@media (max-width: 599px) { .facts { grid-template-columns: 1fr; } .facts div { padding: 14px 0; border-bottom: 1px solid var(--rule); } }

.cover { margin: 0; border-radius: 16px; overflow: hidden; background: var(--field); aspect-ratio: 16 / 9; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 599px) { .cover { aspect-ratio: 4 / 3; border-radius: 12px; } }

/* numbers */
.stats { display: grid; grid-template-columns: 1fr 1fr; margin: 56px 0 0; border-top: 1px solid var(--rule); }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { padding: 22px 16px 22px 0; border-bottom: 1px solid var(--rule); }
.stats dt { font-size: clamp(30px, 3.6vw, 42px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats dd { margin: 6px 0 0; color: var(--grey); font-size: 15px; line-height: 1.4; }
.stats-note { margin: 14px 0 0; max-width: 80ch; }

/* body copy */
.prose { padding-block: 72px 0; }
.prose h2 { margin: 64px 0 18px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: #C9CACD; font-size: 18px; line-height: 1.7; }
.prose p strong { color: var(--white); font-weight: 600; }

.split { display: grid; gap: 40px; margin: 64px auto 0; max-width: 1000px; align-items: start; }
.prose.flush { padding-top: 0; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; } .split .film { position: sticky; top: 24px; } }
.split h2 { margin-top: 0; }
.film { margin: 0; }
.film video { width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; background: var(--field); }
.film figcaption { margin-top: 10px; }

blockquote.pull { margin: 72px 0; padding: 0; text-align: center; }
blockquote.pull p { margin: 0 auto; max-width: 18ch; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.1; letter-spacing: -.035em; font-weight: 600; color: var(--white); }
blockquote.pull footer { border: 0; padding: 18px 0 0; font-size: 15px; color: var(--grey); }

/* what people asked for: bars scaled to the largest topic */
.bars { list-style: none; margin: 28px 0 10px; padding: 0; border-top: 1px solid var(--rule); }
.bars li { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) 2.5em; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
.bars .bar { height: 10px; border-radius: 5px; background: #17181B; overflow: hidden; }
.bars .bar span { display: block; height: 100%; width: calc(var(--n) / 18 * 100%); border-radius: 5px; background: var(--white); }
.bars li:first-child .bar span { background: var(--blue); }
.bars b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 559px) { .bars li { grid-template-columns: minmax(0, 1fr) 2.5em; } .bars .bar { grid-column: 1 / -1; grid-row: 2; } }

/* gallery: masonry with CSS columns, keeps every photo's own ratio */
.gallery { padding-block: 96px 0; }
.gallery h2 { margin-bottom: 8px; }
.masonry { columns: 3 280px; column-gap: 14px; margin-top: 32px; }
.masonry button { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--field);
                  cursor: zoom-in; break-inside: avoid; }
.masonry img { width: 100%; transition: transform .6s cubic-bezier(.16, 1, .3, 1), filter .6s; filter: brightness(.92); }
.masonry button:hover img { transform: scale(1.025); filter: brightness(1); }
@media (prefers-reduced-motion: reduce) { .masonry img { transition: none; } }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; color: var(--white); }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
body:has(dialog[open]) { overflow: hidden; }
.lb-in { position: relative; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 56px 20px 20px; gap: 14px; }
.lb-in img { width: auto; height: auto; max-width: 100%; max-height: 100%; margin: auto; border-radius: 10px; object-fit: contain; }
.lb-cap { text-align: center; color: var(--grey); font-size: 15px; margin: 0; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid #3B3D43; background: rgba(0, 0, 0, .6); color: var(--white);
          display: grid; place-items: center; cursor: pointer; padding: 0; }
.lb-btn:hover { border-color: var(--white); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 8px; right: 12px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
@media (max-width: 599px) { .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; } }

/* closing call to action */
.cta { margin: 96px 0 104px; padding: 40px; border-radius: 16px; background: var(--field); border: 1px solid var(--rule); display: grid; gap: 24px; }
@media (min-width: 900px) { .cta { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 48px 56px; } }
.cta p { color: var(--grey); margin: 12px 0 0; max-width: 52ch; }
@media (max-width: 599px) { .cta { padding: 28px 22px; } }

/* index of case studies */
.index-head { padding-block: 64px 40px; }
@media (min-width: 900px) { .index-head { padding-block: 96px 56px; } }
.index-head p { margin: 18px 0 0; max-width: 52ch; color: var(--grey); font-size: 19px; }
.study { display: grid; gap: 28px; padding-block: 40px 104px; border-top: 1px solid var(--rule); text-decoration: none; }
@media (min-width: 900px) { .study { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; } }
.study figure { margin: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--field); }
.study figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.study:hover figure img { transform: scale(1.02); }
.study .when { font-size: 15px; color: var(--grey); margin: 0 0 14px; }
.study h2 { font-size: clamp(28px, 3.4vw, 40px); }
.study p.lede { color: var(--grey); margin: 16px 0 22px; font-size: 18px; }
.study .go { font-weight: 600; text-decoration: underline; text-decoration-color: #3B3D43; text-underline-offset: 5px; }
.study:hover .go { text-decoration-color: var(--white); }
@media (prefers-reduced-motion: reduce) { .study figure img { transition: none; } }
