@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,700&family=Bricolage+Grotesque:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --paper: #f4f2ea;
  --paper-high: #fffefa;
  --ink: #10120f;
  --muted: #555b55;
  --line: #c9ccc3;
  --coral: #f05235;
  --blue: #4269ef;
  --green: #21b96b;
  --yellow: #efc43f;
  --max: 1180px;
  --pad: clamp(22px, 5vw, 72px);
}

[data-theme="dark"] {
  --paper: #090a09;
  --paper-high: #111311;
  --ink: #f6f5ef;
  --muted: #bcbeb8;
  --line: #343734;
  --coral: #ff7458;
  --blue: #7898ff;
  --green: #66dc98;
  --yellow: #f5d568;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Bricolage Grotesque", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
img { max-width: 100%; }

.case-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 72px;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.case-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; }
.case-brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.case-header-actions { display: flex; align-items: center; gap: 10px; }
.case-header a:not(.case-brand), .case-theme {
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 500 11px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  cursor: pointer;
}
.case-header a:not(.case-brand):hover, .case-theme:hover { border-color: var(--coral); color: var(--coral); }

.case-hero { padding: clamp(72px, 9vw, 132px) var(--pad) clamp(60px, 8vw, 105px); border-bottom: 1px solid var(--line); }
.case-hero-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: clamp(42px, 7vw, 100px); align-items: end; }
.case-kicker, .case-section-label, .case-context dt, .metric span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: uppercase;
}
.case-kicker { margin: 0 0 28px; color: var(--coral); }
.case-hero h1 { max-width: 850px; margin: 0; font-family: "Bodoni Moda", Georgia, serif; font-size: clamp(56px, 8.5vw, 118px); line-height: .88; letter-spacing: 0; }
.case-lede { max-width: 760px; margin: 32px 0 0; color: var(--muted); font-size: clamp(20px, 2vw, 28px); line-height: 1.45; }
.case-context { margin: 0; border-top: 1px solid var(--line); }
.case-context div { padding: 15px 0; display: grid; grid-template-columns: 105px 1fr; gap: 22px; border-bottom: 1px solid var(--line); }
.case-context dt { color: var(--muted); }
.case-context dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; }

.case-metrics { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.metric { min-height: 160px; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric strong { font-size: clamp(33px, 4.2vw, 58px); line-height: 1; color: var(--metric-color, var(--coral)); }
.metric span { color: var(--muted); }
.metric:nth-child(2) { --metric-color: var(--green); }
.metric:nth-child(3) { --metric-color: var(--blue); }
.metric:nth-child(4) { --metric-color: var(--yellow); }

.case-section { padding: clamp(64px, 8vw, 112px) var(--pad); border-bottom: 1px solid var(--line); }
.case-section-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: clamp(34px, 6vw, 92px); }
.case-section-label { margin: 8px 0 0; color: var(--coral); }
.case-copy h2 { max-width: 820px; margin: 0 0 30px; font-family: "Bodoni Moda", Georgia, serif; font-size: clamp(42px, 6vw, 78px); line-height: .95; }
.case-copy > p { max-width: 800px; margin: 0 0 22px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.decision-list { margin-top: 38px; border-top: 1px solid var(--line); }
.decision { padding: 24px 0; display: grid; grid-template-columns: 44px minmax(180px, .7fr) minmax(260px, 1.3fr); gap: 22px; border-bottom: 1px solid var(--line); }
.decision > span { color: var(--coral); font: 500 12px/1.4 "IBM Plex Mono", monospace; }
.decision h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.decision p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }

.architecture { background: var(--paper-high); }
.architecture-visual { margin-top: 36px; padding: clamp(12px, 2vw, 28px); border: 1px solid var(--line); background: #fff; }
.architecture-visual img { width: 100%; display: block; }
.architecture-note { margin-top: 14px; color: var(--muted); font: 400 12px/1.6 "IBM Plex Mono", monospace; }

.case-outcome { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .case-outcome { background: #f1eee4; color: #10120f; }
.case-outcome .case-section-label { color: #ff8065; }
.case-outcome .case-copy > p { color: color-mix(in srgb, currentColor 72%, transparent); }
.case-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.case-actions a { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; border: 1px solid currentColor; font-weight: 700; }
.case-actions a:first-child { background: var(--coral); border-color: var(--coral); color: #fff; }
.case-actions a:hover { transform: translateY(-2px); }

.case-footer { padding: 24px var(--pad); display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font: 500 11px/1.5 "IBM Plex Mono", monospace; text-transform: uppercase; }

@media (max-width: 760px) {
  .case-brand span { display: none; }
  .case-header a:not(.case-brand), .case-theme { min-height: 38px; padding-inline: 11px; font-size: 11px; }
  .case-hero-inner, .case-section-inner { grid-template-columns: 1fr; }
  .case-hero h1 { font-size: clamp(50px, 15vw, 72px); }
  .case-lede { font-size: 18px; }
  .case-context { margin-top: 10px; }
  .case-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 132px; padding: 20px; }
  .case-section-label { margin: 0; }
  .case-copy h2 { font-size: 42px; }
  .case-copy > p { font-size: 16px; }
  .decision { grid-template-columns: 34px 1fr; }
  .decision p { grid-column: 2; }
  .case-footer { align-items: flex-start; flex-direction: column; }
}
