:root {
  --ink: #17231f;
  --muted: #62706b;
  --paper: #f5f4f0;
  --card: #ffffff;
  --accent: #d95f3b;
  --accent-soft: #f2dfd7;
  --line: #d9ddd9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4.5rem;
  padding: 0 clamp(1.25rem, 4vw, 4.5rem);
  border-bottom: 1px solid rgba(23, 35, 31, .12);
  background: rgba(245, 244, 240, .92);
  backdrop-filter: blur(16px);
}
.brand { font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-decoration: none; }
.demo-badge {
  padding: .38rem .75rem;
  border-radius: 99px;
  color: #7c3420;
  background: var(--accent-soft);
  font-size: .72rem;
  font-weight: 700;
}
.back-link { justify-self: end; color: var(--muted); font-size: .78rem; text-decoration: none; }
.back-link:hover { color: var(--ink); }

main { width: min(88rem, 100%); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 4.5rem) 5rem; }
.case-hero {
  display: grid;
  grid-template-columns: minmax(18rem, .86fr) minmax(28rem, 1.4fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
  min-height: calc(100svh - 4.5rem);
  padding: clamp(3rem, 8vw, 7rem) 0;
}
.eyebrow, .section-kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .17em;
}
h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.8rem, 5.6vw, 6rem);
  font-weight: 700;
  line-height: .99;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.lede { max-width: 37rem; margin: 1.8rem 0 2rem; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.8; }
.primary-link {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  padding: .9rem 1.2rem;
  border-radius: 99px;
  color: white;
  background: var(--ink);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.hero-media { margin: 0; }
.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 1.1rem;
  box-shadow: 0 2rem 5rem rgba(23, 35, 31, .15);
}
.hero-media figcaption { margin-top: .8rem; color: var(--muted); font-size: .72rem; }

.overview, .deliverables {
  display: grid;
  grid-template-columns: minmax(18rem, .85fr) 1.4fr;
  gap: clamp(2rem, 7vw, 8rem);
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--line);
}
h2 { margin: 0; font-size: clamp(2rem, 3.5vw, 3.5rem); line-height: 1.08; letter-spacing: -.04em; }
.overview > div > p:last-child, .story-grid article > p:last-child, .result-panel > div > p:last-child {
  max-width: 43rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); }
.metrics div { padding: 1.6rem; background: var(--card); }
.metrics dt { color: var(--muted); font-size: .72rem; letter-spacing: .08em; }
.metrics dd { margin: .55rem 0 0; font-size: clamp(1.3rem, 2.4vw, 2.2rem); font-weight: 700; }

.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; padding-bottom: clamp(4rem, 8vw, 7rem); }
.story-grid article { min-height: 23rem; padding: clamp(2rem, 4vw, 4rem); background: var(--card); }
.story-grid .accent-card { color: white; background: var(--ink); }
.story-grid .accent-card .section-kicker { color: #f4a58e; }
.story-grid .accent-card > p:last-child { color: rgba(255,255,255,.72); }

.process { padding: clamp(4rem, 8vw, 7rem) 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 3rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 5rem 1.8rem 2rem; border: 1px solid var(--line); background: var(--card); counter-increment: step; }
.steps li::before { content: "0" counter(step); position: absolute; top: 1.6rem; left: 1.8rem; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.steps h3 { margin: 0 0 .8rem; font-size: 1.2rem; }
.steps p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.75; }

.result-panel { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(3rem, 8vw, 8rem); padding: clamp(3rem, 6vw, 6rem); color: white; background: #243a33; }
.result-panel .section-kicker { color: #f4a58e; }
.result-panel > div > p:last-child { color: rgba(255,255,255,.7); }
blockquote { align-self: center; margin: 0; font-size: clamp(1.35rem, 2.6vw, 2.4rem); font-weight: 600; line-height: 1.45; letter-spacing: -.025em; }
blockquote::before { content: "“"; color: #f4a58e; }
blockquote::after { content: "”"; color: #f4a58e; }

.deliverables ul { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin: 0; padding: 0; list-style: none; }
.deliverables li { display: flex; gap: .8rem; align-items: flex-start; padding: 1.15rem; border: 1px solid var(--line); background: var(--card); font-size: .9rem; line-height: 1.6; }
.deliverables li::before { content: "✓"; color: var(--accent); font-weight: 900; }

.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.case-nav a { display: flex; min-height: 7rem; align-items: center; padding: 1.5rem; background: var(--card); font-weight: 700; text-decoration: none; }
.case-nav a:last-child { justify-content: flex-end; text-align: right; }
.case-nav a:hover { color: var(--accent); }
.site-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem clamp(1.25rem, 4vw, 4.5rem); color: var(--muted); background: #e8e8e3; font-size: .72rem; }
.site-footer p { margin: 0; }

@media (max-width: 820px) {
  .case-hero, .overview, .deliverables, .result-panel { grid-template-columns: 1fr; }
  .case-hero { min-height: auto; }
  .hero-copy { order: 2; }
  .hero-media { order: 1; }
  .story-grid, .steps { grid-template-columns: 1fr; }
  .story-grid article { min-height: auto; }
  .steps li { min-height: 12rem; }
}

@media (max-width: 560px) {
  .topbar { grid-template-columns: 1fr auto; }
  .demo-badge { display: none; }
  h1 { font-size: clamp(2.45rem, 12vw, 4rem); }
  .metrics, .deliverables ul { grid-template-columns: 1fr; }
  .case-nav { grid-template-columns: 1fr; }
  .case-nav a:last-child { justify-content: flex-start; text-align: left; }
  .site-footer { display: block; }
  .site-footer a { display: inline-block; margin-top: .8rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
