/* ==========================================================================
   Case study pages. Shared by every folder under /case_studies/.
   White page, light gray bands, and green / navy textured bands behind screenshots.
   The textures are tiny SVG noise tiles (css/textures), so there is nothing heavy to download.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --band-gray: #f1f1f1;
  --ink: #29292f;
  --muted: #6b6b76;
  --line: #e3e3e8;
  --accent: #6338ee;
  --green: #316a44;
  --navy: #3d3e53;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --measure: 720px;
  --wide: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--wide), 100% - 48px); margin-inline: auto; }
.narrow { width: min(var(--measure), 100% - 48px); margin-inline: auto; }

/* Top bar */
.topbar { padding: 20px 0; background: var(--bg); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; }
.topbar a { text-decoration: none; font-weight: 600; }
.topbar .back { color: var(--muted); font-weight: 500; font-size: 15px; }
.topbar .back:hover { color: var(--ink); }

h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 24px; }
h2 { font-size: clamp(28px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -0.022em; margin: 0 0 16px; }
h3 { font-size: 20px; line-height: 1.3; margin: 24px 0 8px; }
h2 + h3, .narrow > h3:first-child { margin-top: 0; }
p { margin: 0 0 16px; }
.lede { font-size: 22px; line-height: 1.55; }

/* Sections: white by default, .gray for the light gray bands */
section { padding: 88px 0; background: var(--bg); }
section.gray { background: var(--band-gray); }
section.tight { padding-block: 56px; }

/* Textured bands behind screenshots */
.band { padding: 72px 0; background-color: var(--navy); background-image: url("textures/speckle-dark.svg"); background-size: 300px 300px; }
.band.purple { background-color: #4650da; }
.band.green { background-color: var(--green); background-image: url("textures/speckle-light.svg"); }
.band figure { margin: 0 auto; }
.band figure + figure { margin-top: 56px; }
.band img { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); }
.band figcaption { color: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 20px; margin-bottom: 24px; text-align: center; }
.band.hero { padding: 56px 0; }
.band .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.band .grid-2 figure + figure { margin-top: 0; }

/* Facts: problem, outcome, team, role, timeline */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 48px; margin: 56px auto 0; padding-top: 40px; border-top: 1px solid var(--line); }
.facts h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.facts p, .facts ul { margin: 0; font-size: 17px; }
.facts ul { padding: 0; list-style: none; }
.facts .full { grid-column: 1 / -1; }

/* Stat and pair cards: gray on white sections, white on gray sections */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.stat, .pair > div { background: var(--band-gray); border-radius: 16px; padding: 28px; }
.gray .stat, .gray .pair > div { background: #fff; }
.stat .num { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 12px; color: var(--accent); }
.stat p { margin: 0; font-size: 16px; line-height: 1.55; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 32px; }
.pair h3 { margin-top: 0; }
.pair ul { margin: 0; padding-left: 20px; }
.pair li { margin-bottom: 8px; }

/* Figures */
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 12px; }
figure.narrow-fig { max-width: 380px; }
figcaption { font-size: 15px; }

/* Previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 56px 0; }
.pager a, .pager span { display: block; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; }
.pager a:hover { background: var(--band-gray); }
.pager span { color: var(--muted); }
.pager small { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.pager .next { text-align: right; grid-column: 2; }   /* stays on the right even when there is no Previous */

/* Footer */
footer { padding: 56px 0 64px; background: var(--band-gray); text-align: center; }
.footer-title { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.footer-line { margin: 0 0 18px; font-size: 15px; color: var(--muted); letter-spacing: -0.01em; }
.footer-icons { display: flex; justify-content: center; gap: 12px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #d3d3db; color: var(--ink); text-decoration: none; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .lede { font-size: 19px; }
  .facts { grid-template-columns: 1fr; gap: 24px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; grid-column: auto; }
  section { padding: 56px 0; }
  .band { padding: 40px 0; }
  .band .grid-2 { grid-template-columns: 1fr; }
}

/* These two screenshots carry their own dark backdrop, so no extra shadow */
.band .grid-2 img { box-shadow: none; }

/* Small label above a heading, e.g. "V2" */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

/* Customer quote */
.quote { margin: 40px 0 0; padding: 32px; background: var(--band-gray); border-radius: 16px; }
.gray .quote { background: #fff; }
.quote p { font-size: 22px; line-height: 1.5; margin: 0; }
.quote cite { display: block; margin-top: 12px; font-size: 14px; font-style: normal; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

/* Stat cards whose headline is a short phrase rather than a number */
.stat .num.small { font-size: 26px; line-height: 1.2; }
.stat p + p { margin-top: 12px; }
.stat ul { margin: 0; padding-left: 20px; font-size: 16px; color: var(--muted); }

/* Four competitor screenshots */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 24px; margin-top: 48px; }
.comp-grid img { border: 1px solid var(--line); }
.comp-grid figcaption { margin-top: 12px; text-align: center; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .comp-grid { grid-template-columns: 1fr; } }

/* Band with one large screenshot and two smaller ones underneath */
.band .grid-2 { margin-top: 56px; }

/* ==========================================================================
   Story visuals: flows, chips, decision panels, meters. Built in HTML so they stay sharp and light.
   ========================================================================== */

/* A row of steps joined by arrows */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px 12px; margin-top: 32px; }
.node { flex: 1 1 150px; background: var(--band-gray); border: 1px solid transparent; border-radius: 14px; padding: 16px 18px; }
.gray .node { background: #fff; }
.node small { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.node strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.node.hl { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 56, 238, 0.12); }
.flow .arrow { align-self: center; color: var(--muted); flex: 0 0 auto; }

/* Pills */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--band-gray); font-size: 15px; line-height: 1.4; }
.gray .chip { background: #fff; }
.chip.ok { background: #e3f4e8; color: #1f6b3a; }
.chip.warn { background: #fff1cf; color: #8a5a00; }
.chip.idle { background: #ececf1; color: #55555e; }
.chip.accent { background: var(--accent); color: #fff; }

/* Side-by-side decision panels */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.panel { background: var(--band-gray); border-radius: 16px; padding: 28px; }
.gray .panel { background: #fff; }
.panel h3 { margin-top: 0; }
.panel h4 { margin: 20px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.panel ul { margin: 0; padding-left: 20px; font-size: 16px; }
.panel li { margin-bottom: 6px; }
.panel.chosen { border: 2px solid var(--accent); }
.badge { display: inline-block; margin-bottom: 12px; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* Proportion bar */
.split-bar { display: flex; height: 60px; margin-top: 32px; border-radius: 14px; overflow: hidden; font-weight: 600; }
.split-bar span { display: flex; align-items: center; padding: 0 20px; }
.split-bar .a { flex: 70; background: var(--ink); color: #fff; }
.split-bar .b { flex: 30; background: var(--accent); color: #fff; }

/* Percent meters */
.meters { margin-top: 28px; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin-bottom: 22px; align-items: baseline; }
.meter b { font-size: 22px; letter-spacing: -0.02em; color: var(--accent); }
.meter .track { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: #e3e3ea; overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* Product status cards, used on the coloured bands */
.trio-label { margin: 0 0 12px; text-align: center; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.trio + .trio-label { margin-top: 40px; }
.pcard { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
.pcard small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.pcard strong { display: block; font-size: 22px; letter-spacing: -0.02em; margin-bottom: 14px; }
.pcard .chip { margin: 0; }

/* A prompt, shown as quoted text */
.prompt { margin-top: 24px; padding: 20px 24px; border-left: 3px solid var(--accent); background: var(--band-gray); border-radius: 0 14px 14px 0; font-size: 17px; line-height: 1.6; }
.gray .prompt { background: #fff; }

/* Portrait screenshots sitting side by side */
.pair-fig { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.pair-fig.one { grid-template-columns: minmax(0, 420px); justify-content: center; }
.band .pair-fig figure + figure { margin-top: 0; }
.band .pair-fig img { border-radius: 14px; }

/* Bulleted takeaways */
.takeaway { margin-top: 32px; font-size: 24px; line-height: 1.45; letter-spacing: -0.02em; }

@media (max-width: 760px) {
  .cols-2, .trio, .pair-fig { grid-template-columns: 1fr; }
  .flow .arrow { display: none; }
  .node { flex-basis: 100%; }
  .trio-label { margin-top: 24px; }
}

/* ==========================================================================
   Three-up layouts and wide figures (concept comparisons, personas, diagrams)
   ========================================================================== */
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.cols-3 .panel h3 { font-size: 18px; }
.cols-3 .meter { margin: 20px 0 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.band .grid-3 figure + figure { margin-top: 0; }
.band .grid-3 figcaption { font-size: 16px; margin-bottom: 14px; }
.band .grid-3 img { border-radius: 10px; }

.figure-wide { margin-top: 40px; }
.figure-wide img { border: 1px solid var(--line); background: #fff; }
.figure-wide figcaption { margin-top: 12px; text-align: center; color: var(--muted); font-size: 15px; }
.figure-wide.narrow { margin-inline: auto; }

@media (max-width: 760px) {
  .cols-3, .grid-3 { grid-template-columns: 1fr; }
}
