/* Case study pages. Tokens match index.php. */
:root {
    --ink: #100e0d;
    --ink-2: #1a1716;
    --ink-3: #26211f;
    --cream: #f4ede1;
    --muted: #b3a99c;
    --line: rgba(244, 237, 225, 0.14);
    --magenta: #ed0677;
    --orange: #f27121;
    --yellow: #fbc410;
    --green: #14b24b;
    --blue: #38c4e7;
    --purple: #6360ab;
    --display: 'Bricolage Grotesque', system-ui, sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
    --gutter: clamp(16px, 4vw, 48px);
    --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--display);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
figure { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }


.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(16, 14, 13, 0.85);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.site-nav a:hover { color: var(--cream); }
@media (max-width: 760px) { .site-nav .nav-link { display: none; } }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border-radius: 999px;
    background: var(--cream); color: var(--ink);
    font-weight: 600; text-decoration: none; border: 1px solid var(--cream);
    transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--yellow); border-color: var(--yellow); transform: translateY(-1px); }
.site-nav .btn { padding: 8px 16px; font-size: 0.9rem; color: var(--ink); }

.kicker { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 14px; }
.kicker .num { font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 1.3rem; color: var(--yellow); margin-right: 6px; }

/* hero */
.case-hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.case-hero h1 { font-size: clamp(3rem, 9vw, 6.6rem); }
.case-hero h1 em { color: var(--yellow); }
.case-hero .lede { font-size: clamp(1.15rem, 1.8vw, 1.4rem); color: #ddd4c7; max-width: 36em; margin: 24px 0 clamp(36px, 5vw, 56px); }
.hero-img img { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; border-radius: 22px; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

/* the 6 pieces, as on the home page's Approach (dial colors, in order) */
.pieces { padding: 0 0 clamp(40px, 6vw, 72px); }
.pieces .kicker { margin-bottom: 18px; }
.pieces-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.piece { --c: var(--cream); position: relative; background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px 22px; overflow: hidden; }
.piece::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c); }
.piece .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.piece .num { font-family: var(--serif); font-style: italic; font-size: 1.7rem; line-height: 1; color: var(--c); }
.piece svg { width: 24px; height: 24px; fill: none; stroke: var(--c); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.piece h3 { font-size: 1.25rem; margin: 0 0 8px; }
.piece p { color: var(--muted); margin: 0; font-size: 0.98rem; }
.piece:nth-child(1) { --c: var(--magenta); }
.piece:nth-child(2) { --c: var(--orange); }
.piece:nth-child(3) { --c: var(--yellow); }
.piece:nth-child(4) { --c: var(--green); }
.piece:nth-child(5) { --c: var(--blue); }
.piece:nth-child(6) { --c: var(--purple); }
@media (max-width: 900px) { .pieces-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pieces-grid { grid-template-columns: 1fr; } }

/* facts */
.facts { padding: clamp(40px, 6vw, 72px) 0; }
.facts dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; }
.facts dl > div { border-top: 2px solid var(--cream); padding-top: 16px; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 8px; }
.facts dd { margin: 0; font-size: 1rem; }
@media (max-width: 900px) { .facts dl { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .facts dl { grid-template-columns: 1fr; } }

/* chapters */
.chapter { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.chapter.alt { background: var(--ink-2); }
.chapter-text { max-width: 44em; margin-bottom: clamp(28px, 4vw, 48px); }
.chapter h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 22px; }
.chapter h2 em { color: var(--yellow); }
.chapter p { color: #ddd4c7; font-size: 1.1rem; }
.chapter p b { color: var(--cream); }

.media { display: grid; gap: 14px; }
.media img { width: 100%; border-radius: 16px; background: var(--ink-3); object-fit: cover; }
.media-grid { grid-template-columns: 1fr 1fr; }
.media-grid img { aspect-ratio: 4 / 3; }
.media-grid .wide { grid-column: span 2; }
.media-grid .wide img { aspect-ratio: 21 / 9; }
.media-grid .tall img { aspect-ratio: 3 / 4; }
.media-grid .contain img { object-fit: contain; }
.media-trio { grid-template-columns: repeat(3, 1fr); }
.media-trio img { aspect-ratio: 4 / 5; }
.media-flyers { grid-template-columns: repeat(4, 1fr); }
.media-flyers img { aspect-ratio: 5 / 8; object-fit: cover; object-position: top; }
.media-windows { grid-template-columns: repeat(3, 1fr); }
.media-windows figure:first-child { grid-column: span 2; grid-row: span 2; }
.media-windows img { aspect-ratio: 3 / 4; object-position: top; }
.media-windows figure:first-child img { height: 100%; }
.media-devices { grid-template-columns: 3fr 1fr; align-items: start; }
.media-devices img { aspect-ratio: 16 / 10; object-position: top; border: 1px solid var(--line); }
.media-devices .phone img { aspect-ratio: 390 / 844; border-radius: 22px; }
.media-devices .wide { grid-column: span 2; }
.media-devices .wide img { aspect-ratio: 16 / 9; }
.media-before { grid-template-columns: 1fr 1fr; }
.media-before img { aspect-ratio: 12 / 5; }
@media (max-width: 760px) {
    .media-grid, .media-before { grid-template-columns: 1fr; }
    .media-grid .wide { grid-column: auto; }
    .media-trio { grid-template-columns: 1fr 1fr; }
    .media-flyers, .media-windows { grid-template-columns: 1fr 1fr; }
    .media-windows figure:first-child { grid-row: auto; grid-column: span 2; }
    .media-windows figure:first-child img { height: auto; }
    .media-devices { grid-template-columns: 1fr; }
    .media-devices .wide { grid-column: auto; }
    .media-devices .phone { max-width: 260px; }
}

/* quote */
.quote { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
blockquote { margin: 0; max-width: 40em; }
blockquote p { font-family: var(--serif); font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.2; margin-bottom: 20px; }
blockquote cite { font-style: normal; color: var(--muted); }

/* credits */
.credits { padding: clamp(48px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.credits ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; }
.credits li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.credits li span { color: var(--muted); text-align: right; }
@media (max-width: 760px) { .credits ul { grid-template-columns: 1fr; } }

/* contact */
.contact { background: var(--cream); color: var(--ink); text-align: center; padding: clamp(64px, 9vw, 112px) 0; }
.contact h2 { font-size: clamp(2.2rem, 6vw, 4.4rem); max-width: 13em; margin: 0 auto 24px; }
.contact h2 em { color: var(--magenta); }
.contact p { color: #5a524a; max-width: 32em; margin: 0 auto 36px; font-size: 1.15rem; }
.contact .btn { background: var(--ink); color: var(--cream); border-color: var(--ink); font-size: 1.1rem; padding: 16px 30px; }
.contact .btn:hover { background: var(--magenta); border-color: var(--magenta); }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.contact .btn.btn-line { background: transparent; color: var(--ink); }
.contact .btn.btn-line:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.contact .email { display: block; margin-top: 20px; color: #5a524a; font-size: 0.95rem; }

footer { padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* light reveal (300ms, 8px), only when the script runs, so nothing is hidden without it */
.js .reveal { opacity: 0; transform: translateY(8px); transition: opacity 300ms ease-out, transform 300ms ease-out; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } }

/* print = the PDF version */
@media print {
    @page { size: letter; margin: 0; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { font-size: 11pt; }
    .site-header { position: static; }
    .site-nav { display: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .chapter, .quote, .credits, .facts { padding: 28px 0; }
    .case-hero { padding-top: 24px; }
    figure, .facts dl > div, .credits li, blockquote { break-inside: avoid; }
    .chapter { break-inside: auto; }
    .chapter-text { break-inside: avoid; break-after: avoid; }
    .chapter { break-before: page; }
    .chapter + .chapter, .quote, .credits { border-top: 0; }
    .contact .btn { display: none; }
    .contact { padding: 36px 0; }
}
