/* Case study pages. Loaded after home.css and reuses its tokens and device mockups. */
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.bg-grid, .bg-glow { display: none; }
.nav__logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.eyebrow { color: var(--lime); }

/* ---------- hero ---------- */
.cs-hero { padding: 140px 0 40px; }
.back { display: flex; width: fit-content; gap: 8px; color: var(--muted); margin-bottom: 36px; transition: color .2s; }
.back:hover { color: var(--ink); }
.cs-hero h1 { font-weight: 500; letter-spacing: -0.045em; line-height: 1.04; font-size: clamp(2.3rem, 5vw, 4.4rem); margin: 18px 0 22px; max-width: 18ch; }
.cs-hero h1 .serif { color: var(--muted); font-style: normal; }
.cs-hero .lead { margin: 0; max-width: 60ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.5vw, 1.2rem); }
.cs-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 48px; border-top: 1px solid var(--line); }
.cs-meta div { padding: 18px 20px 0 0; font-weight: 500; }
.cs-meta .mono { display: block; margin-bottom: 6px; font-weight: 400; }
@media (max-width: 720px) { .cs-meta { grid-template-columns: 1fr 1fr; row-gap: 10px; } }

.tldr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 56px; }
.tldr div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.tldr .mono { display: block; margin-bottom: 8px; color: var(--lime); }
.tldr p { margin: 0; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 720px) { .tldr { grid-template-columns: 1fr; } }

/* ---------- sections ---------- */
.cs-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
.cs-section > h2 { font-size: 1rem; font-weight: 500; margin: 0; position: sticky; top: 92px; align-self: start; }
.cs-section > h2 .mono { display: block; color: var(--lime); margin-bottom: 6px; }
.cs-body { max-width: 72ch; }
.cs-body h3 { font-weight: 500; letter-spacing: -0.03em; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.15; margin: 0 0 14px; }
.cs-body p, .cs-body ul { color: var(--ink-2); margin: 0 0 16px; }
.cs-body ul { padding-left: 20px; }
.cs-body li { margin-bottom: 8px; }
.cs-body strong { color: var(--ink); font-weight: 500; }
.cs-body a { color: var(--lime) !important; }
@media (max-width: 860px) { .cs-section { grid-template-columns: 1fr; } .cs-section > h2 { position: static; } }
.decision + .decision { margin-top: 64px; }
.decision .num { display: block; font-family: var(--mono); font-size: 12px; color: var(--lime); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }

.callout { border-left: 2px solid var(--lime); background: var(--bg-2); padding: 20px 24px; margin: 24px 0; }
.callout p { margin: 0; color: var(--ink); font-size: 1.15rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 28px; border-top: 1px solid var(--line); }
.stat { padding: 18px 20px 0 0; }
.stat strong { display: block; font-weight: 500; font-size: clamp(2rem, 3.6vw, 2.8rem); letter-spacing: -0.04em; line-height: 1.1; color: var(--ink); }
.stat span { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.feature { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--bg-2); }
.feature h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 500; color: var(--ink); }
.feature p { margin: 0; font-size: 0.94rem; }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.next-cs { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 32px; border: 1px solid var(--line); border-radius: 14px; margin: 48px 0 96px; transition: border-color .2s; }
.next-cs:hover { border-color: var(--lime); }
.next-cs strong { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -0.03em; }

/* ---------- figures ---------- */
.cs-figure { margin: 0; }
.cs-body .cs-figure { margin: 28px 0 40px; }
.cs-body h4 { margin: 40px 0 10px; font-size: 1.05rem; font-weight: 500; color: var(--ink); }
.cs-figure figcaption { padding: 12px 2px 0; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* static stages in case studies: no hover tilt */
.cs-figure .stage .browser { transform: rotateY(-6deg) rotateX(3deg); }
.cs-figure .stage .iphone { transform: none; }

/* phones laid out in a row */
.stage--phones { aspect-ratio: auto; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(16px, 3vw, 44px); align-items: end; padding: clamp(44px, 6vw, 72px) clamp(24px, 9vw, 120px) clamp(28px, 4vw, 48px); }
.stage--phones::after { display: none; }
.stage--phones .iphone { position: relative; right: auto; bottom: auto; width: 100%; transform: none !important; }
.stage--phones .lift { transform: translateY(-24px); }
.stage--phones .label { display: block; text-align: center; margin-bottom: 12px; }
@media (max-width: 640px) { .stage--phones { --n: 2 !important; padding-inline: 20px; } .stage--phones > :nth-child(3) { display: none; } }

/* screen recordings that already include a phone frame */
.vphone { display: block; width: 100%; height: auto; border-radius: 14% / 6.8%; background: transparent; box-shadow: 0 40px 70px -24px rgba(0,0,0,.9); }
.stage--phones .vlabel { display: block; text-align: center; margin-top: 12px; }

/* one browser, or one plain image */
.stage--single { aspect-ratio: auto; padding: clamp(40px, 5vw, 64px) clamp(20px, 5vw, 64px) clamp(24px, 4vw, 48px); }
.stage--single::after { display: none; }
.stage--single .browser { position: relative; left: auto; top: auto; width: 100%; transform: none !important; }
.stage--single .plain { width: 100%; border-radius: 10px; border: 1px solid var(--line-2); }

/* case pages: stages need a fixed shape when they hold absolute devices */
.cs-figure .stage:not(.stage--phones):not(.stage--single) { aspect-ratio: 16 / 10.5; }
.cs-figure .stage { background: var(--panel); border: 1px solid var(--line); }
.tldr div, .feature, .callout { background: var(--bg-2); }
.tldr .mono, .cs-section > h2 .mono, .decision .num { color: var(--ink); opacity: .55; }
.callout { border-left-color: var(--ink); }
.next-cs:hover { border-color: var(--ink); }
.cs-body a { color: var(--ink) !important; text-decoration: underline; text-underline-offset: 3px; }
