/* ============================================================
   Case study pages, in the same system as the landing page.
   Plus Jakarta Sans throughout, same tokens, same chips and pills.
   ============================================================ */
:root{
  --bg:#0b0b0e;
  --surface:#141419;
  --surface-2:#1b1b22;
  --ink:#ffffff;
  --body:#c6c6d2;
  --soft:#9292a0;
  --faint:#6b6b7a;
  --rule:rgba(255,255,255,.12);
  --rule-2:rgba(255,255,255,.07);
  --acc:#ff8a4c;
  --acc-2:#ffb07d;

  --font:"Plus Jakarta Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --pad:clamp(22px,5vw,68px);
  --max:900px;
  --read:60ch;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--body);
  font-family:var(--font);font-size:17px;line-height:1.7;font-weight:400;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
::selection{background:var(--acc);color:#0b0b0e}
.wrap{max-width:var(--max);margin:0 auto;padding-inline:var(--pad)}

/* ============ top bar ============ */
.bar{border-bottom:1px solid var(--rule-2);background:var(--bg)}
.bar .wrap{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-block:14px}
.back{
  display:inline-flex;align-items:center;gap:9px;padding-block:12px;
  font-size:14.5px;font-weight:600;color:var(--soft);transition:color .2s ease;
}
.back:hover{color:var(--acc)}
.back .ar{transition:transform .2s ease;display:inline-block}
.back:hover .ar{transform:translateX(-3px)}
.bar nav{display:flex;align-items:center;gap:20px}
.bar nav a{font-size:14px;color:var(--soft);padding-block:12px;transition:color .2s ease}
.bar nav a:hover{color:var(--ink)}
.here{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:var(--soft)}
.here i{width:6px;height:6px;border-radius:50%;background:#3f9f55;display:block}

/* ============ hero ============ */
.hero{padding-block:clamp(40px,6vw,72px) clamp(28px,3vw,40px)}
.client{
  display:inline-flex;align-items:center;gap:13px;
  font-size:clamp(21px,2.6vw,26px);font-weight:800;letter-spacing:-.028em;
  color:var(--ink);line-height:1.2;padding-block:6px;transition:color .2s ease;
}
.client img{width:40px;height:40px;object-fit:contain;flex:none;border-radius:10px;background:#fff;padding:6px}
.client .ex{font-size:.58em;color:var(--faint);transition:transform .2s ease,color .2s ease}
.client:hover{color:var(--acc)}
.client:hover .ex{color:var(--acc);transform:translate(3px,-3px)}
.cmeta{font-size:14px;font-weight:500;color:var(--faint);margin:11px 0 0}
h1{
  font-size:clamp(30px,4.6vw,52px);font-weight:800;line-height:1.1;
  letter-spacing:-.036em;color:var(--ink);margin:24px 0 0;max-width:20ch;text-wrap:balance;
}

/* ============ sections ============ */
section{padding-block:clamp(44px,6vw,72px) 0}
.snum{
  font-size:11.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--acc);margin:0 0 12px;
}
h2{
  font-size:clamp(24px,3.2vw,34px);font-weight:800;line-height:1.15;
  letter-spacing:-.032em;color:var(--ink);margin:0 0 20px;max-width:24ch;text-wrap:balance;
}
h3{
  font-size:19px;font-weight:700;letter-spacing:-.02em;color:var(--ink);
  margin:44px 0 14px;
}
h3 span{color:var(--acc);font-weight:700}
.lead{
  font-size:clamp(18px,1.9vw,21px);font-weight:600;line-height:1.5;
  color:var(--ink);letter-spacing:-.018em;margin:0 0 20px;max-width:var(--read);text-wrap:balance;
}
p{margin:0 0 20px;max-width:var(--read);text-wrap:pretty}
p:last-child{margin-bottom:0}
b,strong{color:var(--ink);font-weight:700}
em{font-style:italic}
code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em;
  background:rgba(255,255,255,.07);border-radius:5px;padding:2px 6px;color:var(--ink);
}

ul.pts{list-style:none;margin:0 0 20px;padding:0;max-width:var(--read)}
ul.pts li{
  position:relative;padding:15px 0 15px 20px;border-top:1px solid var(--rule-2);
  font-size:16.5px;line-height:1.6;color:var(--body);text-wrap:pretty;
}
ul.pts li:first-child{border-top:none}
ul.pts li::before{
  content:"";position:absolute;left:0;top:24px;width:8px;height:2px;
  border-radius:2px;background:var(--acc);
}
ul.pts b{color:var(--ink);font-weight:700}

/* ============ numbers ============ */
.stats{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:1px;background:var(--rule-2);border:1px solid var(--rule-2);
  border-radius:16px;overflow:hidden;margin:0 0 22px;
}
.stat{background:var(--surface);padding:20px 18px}
.stat .v{
  display:block;font-size:29px;font-weight:800;letter-spacing:-.04em;
  color:var(--ink);line-height:1;margin-bottom:9px;
}
.stat.hi .v{color:var(--acc)}
.stat .k{font-size:13.5px;line-height:1.45;color:var(--soft)}

.note{
  margin:0 0 20px;padding:18px 20px;border-radius:14px;
  background:var(--surface);border:1px solid var(--rule-2);
  font-size:16px;line-height:1.6;color:var(--soft);max-width:var(--read);
}
.note b{color:var(--ink);font-weight:700}

/* the confidentiality panel */
.gate{
  margin:0 0 20px;padding:22px 24px;border-radius:16px;
  border:1px solid rgba(255,138,76,.3);
  background:linear-gradient(135deg,rgba(255,138,76,.09),rgba(255,138,76,.02) 60%,transparent),var(--surface);
}
.gate .lbl{
  font-size:11.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--acc);margin-bottom:11px;
}
.gate p{margin:0;font-size:16px;line-height:1.6;color:var(--body);max-width:none}

/* ============ figures ============ */
.fig{margin:26px 0 32px}
.figlabel{
  display:flex;align-items:baseline;gap:11px;margin-bottom:11px;
  font-size:11.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:var(--faint);line-height:1.5;
}
.figlabel b{
  color:var(--acc);font-weight:700;border:1px solid rgba(255,138,76,.32);
  border-radius:6px;padding:4px 12px;letter-spacing:.08em;
  white-space:nowrap;flex:none;
}
.fig .frame{
  position:relative;border:1px solid var(--rule-2);border-radius:16px;overflow:hidden;
  background:#17171c;line-height:0;cursor:zoom-in;transition:border-color .25s ease;
}
.fig .frame:hover{border-color:var(--rule)}
.fig .frame img{width:100%;display:block;transition:transform .35s cubic-bezier(.2,.7,.3,1)}
.fig .frame:hover img{transform:scale(1.012)}
.fig figcaption{
  font-size:15px;line-height:1.6;color:var(--soft);margin-top:13px;max-width:var(--read);text-wrap:pretty;
}
.fig figcaption b{color:var(--body);font-weight:700}
.zoomcue{
  position:absolute;right:12px;bottom:12px;z-index:2;pointer-events:none;
  display:flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;
  background:rgba(10,10,12,.85);border:1px solid var(--rule);
  backdrop-filter:blur(6px);
  font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink);
  opacity:0;transform:translateY(4px);transition:opacity .26s ease,transform .26s ease;
}
.fig .frame:hover .zoomcue{opacity:1;transform:none}

/* screenshot beside a numbered legend */
.figpair{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:26px;align-items:start;margin:26px 0 32px}
.legend{list-style:none;padding:0;margin:0}
.legend li{
  display:flex;gap:12px;align-items:flex-start;padding:13px 0;
  border-bottom:1px solid var(--rule-2);font-size:15px;line-height:1.55;color:var(--soft);
}
.legend li:last-child{border-bottom:none}
.legend .n{
  flex:none;width:21px;height:21px;border-radius:50%;background:var(--acc);
  color:#0b0b0e;font-size:11.5px;font-weight:800;display:grid;place-items:center;line-height:1;margin-top:1px;
}
.legend b{color:var(--ink);font-weight:700;display:block;margin-bottom:2px}

/* ============ stack ============ */
.stack{display:flex;flex-wrap:wrap;gap:10px;margin:0}
.chip{
  display:inline-flex;align-items:center;gap:10px;padding:11px 18px 11px 13px;
  border-radius:999px;background:var(--surface);border:1px solid var(--rule-2);
  font-size:15px;font-weight:600;color:var(--ink);
}
.chip img{width:22px;height:22px;object-fit:contain;flex:none}

/* ============ next / prev ============ */
.np{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin-top:22px}
.npc{
  padding:20px 22px;border-radius:16px;background:var(--surface);
  border:1px solid var(--rule-2);transition:border-color .22s ease,background .22s ease;
}
.npc:hover{border-color:var(--rule);background:var(--surface-2)}
.npc .l{display:block;font-size:11.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);margin-bottom:8px}
.npc .n{font-size:18px;font-weight:700;color:var(--ink);letter-spacing:-.02em}

/* ============ close ============ */
.close{margin-top:clamp(56px,7vw,90px);padding-block:clamp(52px,7vw,86px);border-top:1px solid var(--rule-2)}
.close h2{font-size:clamp(26px,3.6vw,40px);max-width:19ch;margin-bottom:26px}
.close .q{color:var(--soft)}
.acts{display:flex;gap:12px;flex-wrap:wrap}
.btn{
  display:inline-flex;align-items:center;justify-content:center;min-height:52px;
  padding:14px 26px;border-radius:999px;font-size:16px;font-weight:700;letter-spacing:-.014em;
  transition:background .22s ease,color .22s ease,border-color .22s ease;
}
.btn.solid{background:var(--acc);color:#0b0b0e}
.btn.solid:hover{background:var(--acc-2)}
.btn.ghost{border:1px solid var(--rule);color:var(--ink)}
.btn.ghost:hover{border-color:var(--ink)}
.fine{font-size:14px;line-height:1.75;color:var(--faint);margin:34px 0 0;max-width:60ch}

/* ============ responsive ============ */
@media (max-width:820px){
  .figpair{grid-template-columns:1fr;gap:18px}
}
@media (max-width:620px){
  body{font-size:16.5px}
  /* the label beside the badge wrapped to 2 lines, leaving the badge
     stranded in the middle of a tall row. Give each its own line. */
  .figlabel{flex-direction:column;align-items:flex-start;gap:9px;line-height:1.45}
  /* a 6-line paragraph on a phone reads as a wall, so open it up */
  p,.note,.gate p{line-height:1.8}
  p{margin-bottom:24px}
  ul.pts li{padding:17px 0 17px 20px;line-height:1.7}
  ul.pts li::before{top:27px}
  .fig figcaption{line-height:1.7;margin-top:14px}
  .lead{line-height:1.45}
  .btn{width:100%}
  .bar .here{display:none}
}

/* ============ lightbox ============ */
dialog.lb{
  padding:0;border:none;background:transparent;color:var(--body);
  width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;overflow:hidden;
}
dialog.lb[open]{display:flex;align-items:center;justify-content:center}
dialog.lb::backdrop{background:rgba(6,6,8,.8);backdrop-filter:blur(9px) saturate(.9)}
dialog.lb .lbinner{position:relative;display:flex;flex-direction:column;align-items:center;max-width:92vw}
dialog.lb .lbscroll{
  max-width:92vw;max-height:82vh;overflow:hidden;
  border:1px solid var(--rule);border-radius:16px;background:#17171c;
  box-shadow:0 32px 90px rgba(0,0,0,.6);line-height:0;
}
dialog.lb img{display:block;margin:0 auto;max-width:92vw;max-height:82vh;width:auto;height:auto}
dialog.lb .lbcap{margin-top:14px;font-size:15px;line-height:1.6;color:var(--soft);max-width:70ch;text-align:center}
dialog.lb .lbclose{
  position:absolute;top:-14px;right:-14px;z-index:3;
  width:38px;height:38px;border-radius:50%;cursor:pointer;display:grid;place-items:center;
  background:var(--surface);border:1px solid var(--rule);color:var(--ink);
  font-size:19px;line-height:1;transition:all .2s ease;
}
dialog.lb .lbclose:hover{background:var(--acc);color:#0b0b0e;border-color:var(--acc);transform:rotate(90deg)}
@media (prefers-reduced-motion:no-preference){
  dialog.lb[open]{animation:lbin .28s cubic-bezier(.2,.7,.3,1)}
  dialog.lb[open]::backdrop{animation:fadein .28s ease}
  @keyframes lbin{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
  @keyframes fadein{from{opacity:0}to{opacity:1}}
}
@media (pointer:coarse){
  /* always visible on touch since there is no hover, so keep it small:
     these workflow shots are short and wide and it covers real content */
  .zoomcue{
    opacity:.85;transform:none;right:8px;bottom:8px;
    padding:5px 9px;font-size:9.5px;letter-spacing:.04em;
  }
  .fig .frame{cursor:default}

  dialog.lb .lbinner{max-width:100vw;width:100vw}
  dialog.lb .lbcap{padding:0 18px}
  dialog.lb .lbclose{top:-48px;right:14px}

  /* opens fitted, so the whole diagram is on screen at once */
  dialog.lb .lbscroll{
    max-width:100vw;width:100vw;max-height:76vh;overflow:hidden;
    border-radius:0;border-left:none;border-right:none;
    display:grid;place-items:center;
  }
  dialog.lb img{max-width:100vw;max-height:76vh;width:auto;height:auto}

  /* tapping switches to a size you can read, and drag around */
  dialog.lb.zoomed .lbscroll{overflow:auto;-webkit-overflow-scrolling:touch;display:block}
  dialog.lb.zoomed img{max-width:none;max-height:none;height:68vh;width:auto;margin:0}
}

.lbhint{
  display:block;margin-bottom:6px;color:var(--acc);
  font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
}
