/* Case study pages — shares design tokens with index.html v5
   (IBM Plex Sans/Mono, graphite/cobalt spec-sheet system; cobalt = actions/links only).
   Case-specific components not in index.html: chero hero, TL;DR cards, chat/hypothesis
   blocks, paired bar chart, decision table, phone/solution mockup, roadmap gantt, mock blocks.
   Token values below are copied from index.html :root (see design-spec.md in porto-agents repo
   for the mapping table) — keep them in sync if index.html's tokens change. */
:root {
  --paper: #FFFFFF;
  --surface: #f4f6f9;
  --line: #dde1e8;
  --line-strong: #b3bac6;
  --graphite: #1c2129;
  --body: #3a414d;
  --muted: #5d6573;
  --muted-dark: #aab2c0;
  --cobalt: #2f5bea;
  --cobalt-strong: #2449c7;
  --cobalt-tint: #e8eefe;
  --cobalt-soft: #a9bdf8;
  --cobalt-on-dark: #7f9cff;
  --success: #1d7a4c;
  --success-tint: #e3f4ea;
  --progress: #8a5a00;
  --progress-tint: #fff1d1;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --max: 1160px; --read: 760px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); color: var(--body); background: var(--paper); line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--graphite); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 24px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: var(--r-sm); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: var(--r-md); font: inherit; font-weight: 500; font-size: 15px; text-decoration: none; transition: background .2s ease, border-color .2s ease, transform .2s ease; white-space: nowrap; cursor: pointer; border: 1px solid transparent; }
.btn-cta { background: var(--cobalt); color: var(--paper); }
.btn-cta:hover { background: var(--cobalt-strong); }
.btn-ghost { color: var(--graphite); background: var(--paper); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--graphite); }
.btn-dark { color: var(--paper); background: transparent; border-color: var(--muted-dark); }
.btn-dark:hover { border-color: var(--paper); }

/* header */
header.nav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--line); }
header.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.logo { font-weight: 600; font-size: 19px; color: var(--graphite); text-decoration: none; letter-spacing: -.03em; display: inline-flex; align-items: center; gap: 10px; }
.logo .mark { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--cobalt); display: grid; place-items: center; }
.links { display: flex; gap: 24px; list-style: none; align-items: center; }
.links a { color: var(--body); text-decoration: none; font-size: 14px; }
.links a:hover { color: var(--graphite); }
.links .btn { padding: 10px 18px; font-size: 14px; color: var(--paper); }

/* motif: flow line (lihat index.html baris 192-205 — disalin manual, bukan live sync) */
.flow { position: absolute; z-index: 1; pointer-events: none; overflow: visible; }
.flow path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 6 6; }
.flow .node { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.5; }
.flow .goal { fill: var(--cobalt); }
.flow.on-dark path, .flow.on-dark .node { stroke: #4a5361; }
.flow.on-dark .node { fill: var(--graphite); }
.flow.on-dark .goal { fill: var(--cobalt-on-dark); }
.flow path.fill { stroke: var(--cobalt); stroke-width: 2; stroke-dasharray: none; }
.flow.on-dark path.fill { stroke: var(--cobalt-on-dark); }
.flow .node, .flow .goal { transition: fill .3s ease, stroke .3s ease; }
.flow .node.hit { fill: var(--cobalt); stroke: var(--cobalt); }
.js .flow .goal:not(.hit) { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.5; }

/* case hero */
.chero { background: var(--graphite); color: #fff; padding: 64px 0 120px; position: relative; overflow: hidden; }
.chero .flow { right: -60px; top: 30px; width: 440px; opacity: .4; }
.chero .flow .node, .js .chero .flow .goal:not(.hit) { fill: var(--graphite); stroke: #4a5361; }
.chero .flow .node.hit, .chero .flow .goal.hit { fill: var(--cobalt-on-dark); stroke: var(--cobalt-on-dark); }
.back { color: var(--cobalt-on-dark); text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }
.chero .num { display: block; margin-top: 34px; font-size: 14px; color: var(--muted-dark); letter-spacing: .14em; font-family: var(--mono); text-transform: uppercase; }
.chero h1 { color: #fff; font-size: clamp(32px, 4.6vw, 54px); max-width: 900px; margin: 12px 0 18px; position: relative; z-index: 2; }
.chero .lead { color: var(--muted-dark); font-size: clamp(17px, 1.8vw, 20px); font-weight: 300; max-width: 720px; position: relative; z-index: 2; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 44px; position: relative; z-index: 2; }
.meta div { border-top: 1px solid rgba(255,255,255,.16); padding-top: 12px; }
.meta small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); font-family: var(--mono); }
.meta span { color: #fff; font-size: 15px; }

/* TL;DR cards overlapping hero */
.tldr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: -72px; position: relative; z-index: 3; }
.tldr div { background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: 0 20px 50px rgba(28,33,41,.14); border: 1px solid var(--line); }
.tldr small { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.tldr p { font-size: 15.5px; color: var(--graphite); line-height: 1.55; }
.tldr b { font-weight: 600; }

/* article */
.article { max-width: var(--read); margin: 0 auto; padding: 90px 24px 100px; }
.article h2 { font-size: clamp(26px, 3vw, 34px); margin: 72px 0 16px; display: flex; gap: 14px; align-items: baseline; }
.article h2:first-child { margin-top: 0; }
.article h2 .n { font-size: 14px; color: var(--muted); letter-spacing: .1em; font-weight: 500; flex: none; font-family: var(--mono); }
.article p { font-size: 17px; margin-bottom: 16px; }
.article strong { color: var(--graphite); font-weight: 600; }
.article ul, .article ol { margin: 0 0 18px 22px; font-size: 17px; }
.article li { margin-bottom: 8px; }
.wide { margin: 30px -120px; }

/* callouts */
.callout { background: var(--success-tint); border-radius: var(--r-lg); padding: 22px 24px; margin: 26px 0; display: flex; gap: 14px; }
.callout .ck { width: 30px; height: 30px; border-radius: 50%; background: var(--success); display: grid; place-items: center; flex: none; margin-top: 2px; }
.callout p { margin: 0; font-size: 16px; color: var(--graphite); }
.callout.note { background: var(--surface); }
.callout.note p { color: var(--body); }
.callout.note .ck { background: var(--muted); }

/* real-screenshot strips (Design Riddle, Usability, NADI) */
.shots { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 12px; margin: 26px 0 8px; }
.shots figure { margin: 0; }
.shots img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); display: block; }
.shots figcaption { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 7px; }

/* mini mockup visual — same component as index.html's gallery cards, used as a page's hero visual */
.mvis { background: var(--graphite); color: #fff; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; min-height: 140px; justify-content: center; border-radius: var(--r-lg); margin: 26px 0; box-shadow: 0 14px 40px rgba(28,33,41,.08); }
.mvis .mv-split { display: flex; gap: 12px; align-items: center; }
.mvis .mv-chip { flex: 1; background: rgba(255,255,255,.08); border-radius: var(--r-sm); padding: 10px 12px; font: 500 13px var(--mono); text-align: center; }
.mvis .mv-arrow { color: var(--cobalt-on-dark); font-size: 18px; flex: none; }
.mvis .mv-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; max-width: 220px; }
.mvis .mv-dots span { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--cobalt-on-dark); }
.mvis .mv-stat { font: 500 26px var(--mono); }
.mvis .mv-sub { font-size: 12px; color: var(--muted-dark); letter-spacing: .04em; text-transform: uppercase; }
.mvis .mv-bub { background: rgba(255,255,255,.08); border-radius: 10px 10px 10px 3px; padding: 9px 13px; font-size: 13px; max-width: 80%; }
.mvis .mv-bub.b { align-self: flex-end; border-radius: 10px 10px 3px 10px; background: var(--cobalt); }
.mvis .mv-ab { display: flex; gap: 10px; max-width: 320px; }
.mvis .mv-ab div { flex: 1; height: 52px; border-radius: var(--r-sm); border: 1.5px solid rgba(255,255,255,.18); display: grid; place-items: center; font: 600 12px var(--mono); }
.mvis .mv-ab div.win { border-color: var(--cobalt-on-dark); background: rgba(127,156,255,.12); color: var(--cobalt-on-dark); }

/* chat (WhatsApp-style mockup — bg/bubble colours stay literal, see design-spec.md §1f) */
.chat { background: #EFE7DD; border-radius: var(--r-lg); padding: 20px; margin: 24px 0; display: flex; flex-direction: column; gap: 10px; }
.chat .b { background: #fff; border-radius: 12px 12px 12px 3px; padding: 10px 14px; max-width: 80%; font-size: 15px; box-shadow: 0 1px 1px rgba(0,0,0,.07); }
.chat .b small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.chat .b.r { align-self: flex-end; border-radius: 12px 12px 3px 12px; background: #D9FDD3; }
.chat .cap { text-align: center; font-size: 12.5px; color: #6B6257; }

/* hypothesis */
.hypo { list-style: none; margin: 18px 0 22px !important; display: grid; gap: 10px; }
.hypo li { background: var(--surface); border-radius: var(--r-md); padding: 14px 18px 14px 54px; position: relative; margin: 0 !important; }
.hypo li::before { content: "?"; position: absolute; left: 16px; top: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--graphite); color: var(--paper); font-size: 13px; font-weight: 600; display: grid; place-items: center; }

/* paired bar chart */
.chart { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; margin: 28px 0; }
.chart h4 { font-size: 18px; }
.chart .sub { font-size: 14px; color: var(--muted); margin: 4px 0 14px; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: var(--r-sm); margin-right: 7px; vertical-align: -1px; }
.c1 { background: var(--cobalt-soft); } .c2 { background: var(--cobalt); }
.brow { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--surface); }
.brow:first-of-type { border-top: 0; }
.brow .lbl { font-size: 14px; font-weight: 500; color: var(--graphite); line-height: 1.3; }
.brow .lbl em { display: block; font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.pair { display: grid; gap: 3px; margin-right: 54px; }
.track { position: relative; height: 15px; }
.track b { position: absolute; left: 0; top: 0; height: 15px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.track span { position: absolute; top: -2px; padding-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--graphite); white-space: nowrap; font-family: var(--mono); }
.axis { display: grid; grid-template-columns: 160px 1fr; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }
.axis div { display: flex; justify-content: space-between; margin-right: 54px; }
details { margin-top: 14px; font-size: 14px; }
details summary { cursor: pointer; color: var(--cobalt-strong); font-weight: 500; }
details table { width: 100%; border-collapse: collapse; margin-top: 10px; }
details td, details th { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
details.board { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 16px 20px; margin: 22px 0; }
details.board summary { color: var(--graphite); }
details.board figure { margin-top: 16px; }
figure figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }
figure img { border-radius: var(--r-md); border: 1px solid var(--line); }

/* decision table */
table.decision { width: 100%; border-collapse: separate; border-spacing: 0; margin: 22px 0 26px; font-size: 15px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
table.decision th { text-align: left; background: var(--graphite); color: var(--paper); font-weight: 500; padding: 13px 16px; }
table.decision td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.p1 { background: var(--cobalt); color: var(--paper); }
.p2 { background: var(--cobalt-tint); color: var(--cobalt-strong); }
.p3 { background: var(--surface); color: var(--muted); }

/* solution */
.solution { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; margin: 28px 0; }
.phone { background: var(--graphite); border-radius: 24px; padding: 11px; box-shadow: 0 24px 50px rgba(28,33,41,.25); }
.screen { background: #fff; border-radius: 16px; overflow: hidden; }
.ph-top { background: var(--graphite); color: #fff; padding: 16px; }
.ph-top small { color: var(--muted-dark); font-size: 11px; display: block; }
.ph-top b { font-weight: 500; font-size: 15px; }
.days { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow: hidden; }
.days span { font-size: 11px; padding: 4px 10px; border-radius: 99px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.days span.on { background: var(--cobalt); color: var(--paper); font-weight: 600; }
.act { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.act .ic { height: 40px; border-radius: var(--r-md); background: var(--cobalt-tint); display: grid; place-items: center; }
.act b { font-size: 12.5px; font-weight: 500; color: var(--graphite); display: block; line-height: 1.3; }
.act span { font-size: 11px; color: var(--muted); }
.ph-btn { margin: 12px; background: var(--cobalt); color: var(--paper); text-align: center; font-size: 12px; padding: 10px; border-radius: var(--r-md); }
.story { background: var(--surface); border-radius: var(--r-lg); padding: 24px; }
.story .tag { font-size: 12px; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.story blockquote { font-size: 18px; color: var(--graphite); font-weight: 500; letter-spacing: -.01em; margin: 10px 0 16px; line-height: 1.45; }
.story ul { font-size: 15px !important; }

/* roadmap */
.roadmap { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin: 24px 0; overflow-x: auto; }
.rm { display: grid; grid-template-columns: 150px repeat(10, minmax(46px, 1fr)); row-gap: 10px; min-width: 640px; align-items: center; }
.rm .m { font-size: 12px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.rm .lane { font-size: 13px; font-weight: 500; color: var(--graphite); line-height: 1.25; }
.rm .lane em { display: block; font-style: normal; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.rb { height: 28px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 500; display: flex; align-items: center; padding: 0 9px; white-space: nowrap; overflow: hidden; margin: 0 1px; }
.rb.r { background: var(--surface); color: var(--graphite); }
.rb.a { background: var(--cobalt); color: var(--paper); }
.rb.b { background: var(--progress-tint); color: var(--progress); }
.rb.ms { background: var(--success); color: var(--paper); justify-content: center; padding: 0; }
.rb.it { background: repeating-linear-gradient(135deg, var(--success-tint) 0 6px, var(--surface) 6px 12px); color: var(--success); }
.rm-note { font-size: 12px !important; color: var(--muted); margin: 12px 0 0 !important; }

/* generic cards & steps */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 22px 0; }
.steps div { background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px; }
.steps b { display: block; color: var(--graphite); font-weight: 500; margin-bottom: 4px; }
.steps span { font-size: 15px; color: var(--muted); }
.steps .k { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-md); background: var(--graphite); color: var(--paper); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.phases div { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; position: relative; overflow: hidden; }
.phases div::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--cobalt); }
.phases b { display: block; color: var(--graphite); font-weight: 500; margin-bottom: 8px; }
.phases ul { font-size: 14px !important; color: var(--muted); margin: 0 0 0 18px !important; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 26px -120px; }

/* mock blocks */
.mock { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 26px 0; box-shadow: 0 14px 40px rgba(28,33,41,.08); }
.mock-head { background: var(--graphite); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; }
.mock-head small { color: var(--muted-dark); font-weight: 400; }
.mock-tabs { display: flex; border-bottom: 1px solid var(--line); }
.mock-tabs span { flex: 1; text-align: center; padding: 11px 6px; font-size: 13px; color: var(--muted); }
.mock-tabs span.on { color: var(--graphite); font-weight: 600; box-shadow: inset 0 -2px 0 var(--cobalt); }
.mrow { display: grid; grid-template-columns: 100px 1fr 54px; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--graphite); }
.mrow:first-of-type { border-top: 0; }
.bar { height: 8px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 99px; }
.mrow em { font-style: normal; color: var(--muted); text-align: right; font-family: var(--mono); }
.mday { padding: 16px 18px; border-top: 1px solid var(--line); }
.mday:first-of-type { border-top: 0; }
.mday .t { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.mday b { display: block; color: var(--graphite); font-weight: 500; }
.mday p { font-size: 14px !important; color: var(--muted); margin: 2px 0 0 !important; }

/* next + footer */
.next { background: var(--cobalt-tint); padding: 70px 0; }
.next .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.next small { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt-strong); }
.next a.t { font-size: clamp(24px, 3.2vw, 38px); font-weight: 500; color: var(--graphite); text-decoration: none; letter-spacing: -.03em; }
.next a.t:hover { text-decoration: underline; text-underline-offset: 6px; }
footer { background: var(--graphite); color: var(--muted-dark); padding: 40px 0; font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
footer .row { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1000px) {
  .wide, .gallery { margin-left: 0; margin-right: 0; }
  .links li.opt { display: none; }
}
@media (max-width: 720px) {
  .meta { grid-template-columns: 1fr 1fr; }
  .tldr, .phases, .steps, .gallery { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .tldr { margin-top: -60px; }
  .solution { grid-template-columns: 1fr; }
  .phone { max-width: 270px; margin: 0 auto; }
  .brow, .axis { grid-template-columns: 104px 1fr; }
  .pair, .axis div { margin-right: 46px; }
  .chero .flow { width: 240px; right: -110px; opacity: .25; }
  .article { padding-top: 64px; }
  .mrow { grid-template-columns: 80px 1fr 46px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* cursor spotlight (see spotlight.js) — graphite surfaces only */
[data-spot] { position: relative; overflow: hidden; }
[data-spot] > :not(.spot):not(.flow) { position: relative; z-index: 1; }
.spot { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease;
  background: radial-gradient(circle 340px at var(--sx, 50%) var(--sy, 50%), rgba(127,156,255,.16), rgba(127,156,255,.05) 45%, transparent 72%); }
.spot.on { opacity: 1; }
.tile .spot { background: radial-gradient(circle 220px at var(--sx, 50%) var(--sy, 50%), rgba(127,156,255,.18), transparent 70%); }
