/* ============================================================
   FX.CSS — the cinematic layer, shared by every page.
   Loaded after site.css (and after the page's own stylesheet).
   Driven by js/fx.js. Everything degrades to the plain page:
   no JS, no video, reduced motion — each piece just switches off.

   Contents
     1. Film heroes      sub-page heroes with a looping plate behind them
     2. Device scene     laptop + phone playing a recording of the build
     3. Marquee          a kinetic type band that reacts to scroll speed
     4. Cursor           a viewfinder frame that snaps onto targets
     5. Sound            the toggle (the audio itself is synthesized)
     6. Quote builder    inline and in a dialog
     7. Gallery & misc
   ============================================================ */

/* ---------- 1. FILM HEROES ----------
   A section marked data-film gets a background layer injected by fx.js:
   poster + looping plate, grain, shade, viewfinder corners, REC and a
   running timecode. The section keeps its own content and layout. */
[data-film] {
  position:relative; isolation:isolate; overflow:hidden;
  min-height:min(78svh, 760px);
  display:grid; align-items:center;
  padding-top:96px !important; padding-bottom:96px !important;
}
[data-film]::before { display:none !important; }       /* the old glow */
.film-bg { position:absolute; inset:0; z-index:-1; background:var(--bg); pointer-events:none; }
.film-media {
  position:absolute; inset:0;
  transform:scale(calc(1 + var(--o, 0) * .12)); will-change:transform;
}
.film-media img, .film-media video {
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
}
.film-media video { opacity:0; transition:opacity 1.2s ease; }
.film-bg.is-playing .film-media video { opacity:1; }
[data-film="dust"] .film-media img, [data-film="dust"] .film-media video { object-position:75% 30%; }
.film-grain {
  position:absolute; inset:-60%;
  background:url(../assets/hero/grain.png) repeat;
  opacity:.07; mix-blend-mode:overlay;
  animation:fx-grain .9s steps(6) infinite;
}
@keyframes fx-grain {
  0%{transform:translate(0,0)} 17%{transform:translate(-6%,4%)} 33%{transform:translate(5%,-7%)}
  50%{transform:translate(-3%,8%)} 67%{transform:translate(8%,2%)} 83%{transform:translate(-8%,-4%)}
  100%{transform:translate(0,0)}
}
.film-shade {
  position:absolute; inset:0;
  background:
    linear-gradient(to right, rgba(22,20,15,.95) 0%, rgba(22,20,15,.80) 38%, rgba(22,20,15,.40) 70%, rgba(22,20,15,.25) 100%),
    linear-gradient(to top, rgba(22,20,15,1) 0%, rgba(22,20,15,0) 28%),
    linear-gradient(to bottom, rgba(22,20,15,.6) 0%, rgba(22,20,15,0) 20%);
}
.film-bg .vf-corner { position:absolute; width:26px; height:26px; border:2px solid rgba(232,130,61,.9); }
.film-bg .vf-corner.tl { top:22px; left:22px; border-right:0; border-bottom:0; }
.film-bg .vf-corner.tr { top:22px; right:22px; border-left:0; border-bottom:0; }
.film-bg .vf-corner.bl { bottom:22px; left:22px; border-right:0; border-top:0; }
.film-bg .vf-corner.br { bottom:22px; right:22px; border-left:0; border-top:0; }
.film-hud {
  position:absolute; display:flex; align-items:center; gap:7px;
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.62rem; letter-spacing:.18em;
  color:#CFC7B8; text-transform:uppercase;
}
.film-hud.rec { top:28px; left:62px; color:#F2EFE6; }
.film-hud.rec i { width:8px; height:8px; border-radius:50%; background:var(--amber); animation:fx-blink 1.6s ease-in-out infinite; }
.film-hud.label { bottom:28px; left:62px; }
.film-hud.tc { top:28px; right:62px; }
@keyframes fx-blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.film-pause { position:absolute; right:58px; bottom:24px; z-index:3; pointer-events:auto; }

/* everything the page put in the hero rides above the film */
[data-film] > .wrap, [data-film] > .inner { position:relative; z-index:1; width:100%; }
[data-film] > .wrap { transform:translate3d(0, calc(var(--o, 0) * -60px), 0);
  opacity:calc(1 - var(--o, 0) * 1.1); }

@media (max-width:680px) {
  [data-film] { min-height:auto; padding-top:84px !important; padding-bottom:84px !important; }
  .film-shade { background:
    linear-gradient(to top, rgba(22,20,15,.97) 0%, rgba(22,20,15,.82) 55%, rgba(22,20,15,.55) 100%); }
  .film-bg .vf-corner { width:20px; height:20px; }
  .film-bg .vf-corner.tl, .film-bg .vf-corner.tr { top:14px; }
  .film-bg .vf-corner.bl, .film-bg .vf-corner.br { bottom:14px; }
  .film-bg .vf-corner.tl, .film-bg .vf-corner.bl { left:14px; }
  .film-bg .vf-corner.tr, .film-bg .vf-corner.br { right:14px; }
  .film-hud.rec, .film-hud.label { left:44px; }
  .film-hud.rec, .film-hud.tc { top:19px; }
  .film-hud.label { bottom:19px; }
  .film-hud.tc { right:44px; }
  .film-pause { right:40px; bottom:12px; }
}

/* the shared pause chip (home.css styles its own copy too) */
.amb-pause {
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(22,20,15,.72); border:1px solid var(--line); color:var(--muted);
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.62rem;
  letter-spacing:.14em; text-transform:uppercase;
  padding:8px 13px; border-radius:999px; transition:color .2s ease, border-color .2s ease;
}
.amb-pause[hidden] { display:none; }
.amb-pause:hover { color:var(--text); border-color:var(--amber); }
.amb-pause .ic { font-size:.6rem; letter-spacing:-.05em; }

/* headline intro: words rise out of a mask (fx.js splits them) */
.split .w { display:inline-block; overflow:hidden; vertical-align:top; padding-bottom:.08em; margin-bottom:-.08em; }
.split .w, .split .w > span { color:inherit; }
.split .w > span { display:inline-block; transform:translateY(105%);
  transition:transform .9s cubic-bezier(.2,.75,.2,1); transition-delay:calc(var(--i) * 65ms + .1s); }
.split.go .w > span { transform:none; }
html[data-motion="reduced"] .split .w > span { transform:none; opacity:0; transition:opacity .6s ease;
  transition-delay:calc(var(--i) * 50ms); }
html[data-motion="reduced"] .split.go .w > span { opacity:1; }

/* ---------- 2. DEVICE SCENE ----------
   A laptop and a phone, drawn in CSS, each playing a scroll-through
   recording of the real build. fx.js sets --p from 0 (entering) to 1
   (settled) as it scrolls in; without JS --p is 1 and they sit flat. */
.device-stage { padding-top:10px; }
.devices {
  position:relative; perspective:1800px; perspective-origin:50% 10%;
  max-width:1000px; margin:0 auto; padding:0 6% 40px 0;
}
.laptop {
  position:relative; transform-origin:50% 100%;
  transform:
    translate3d(0, calc((1 - var(--p, 1)) * 70px), 0)
    rotateX(calc((1 - var(--p, 1)) * 38deg))
    scale(calc(.8 + var(--p, 1) * .2));
  will-change:transform;
}
.laptop-screen {
  position:relative; aspect-ratio:16/10.6; border-radius:14px 14px 4px 4px;
  background:#0b0a08; padding:2.2% 2.2% 0;
  box-shadow:0 0 0 1px #3a362c, 0 40px 80px rgba(0,0,0,.55);
}
.laptop-bar {
  display:flex; align-items:center; gap:6px; height:26px; padding:0 10px;
  background:#1f1c16; border-radius:6px 6px 0 0; border-bottom:1px solid #2c281f;
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.6rem; letter-spacing:.08em; color:var(--muted);
}
.laptop-bar i { width:9px; height:9px; border-radius:50%; background:#3a362c; }
.laptop-bar i:nth-child(1){ background:#e5484d; } .laptop-bar i:nth-child(2){ background:#f5a524; } .laptop-bar i:nth-child(3){ background:#30a46c; }
.laptop-bar span { margin-left:10px; flex:1; text-align:center; padding-right:50px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.laptop-view { position:relative; aspect-ratio:16/10; overflow:hidden; background:#000; }
.laptop-view img, .laptop-view video, .phone-view img, .phone-view video {
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:top center;
}
.dev-vid { opacity:0; transition:opacity .6s ease; }
.dev-vid.ready { opacity:1; }
.laptop-base {
  position:relative; height:16px; margin:0 -7%;
  background:linear-gradient(#2c281f, #16140f); border-radius:0 0 18px 18px;
  box-shadow:0 18px 40px rgba(0,0,0,.5);
}
.laptop-base::before { content:''; position:absolute; left:50%; top:0; width:16%; height:6px;
  transform:translateX(-50%); background:#0f0e0b; border-radius:0 0 8px 8px; }
.phone {
  position:absolute; right:0; bottom:0; width:23%; min-width:130px;
  transform:
    translate3d(0, calc((1 - var(--p, 1)) * 220px), 0)
    rotate(calc((1 - var(--p, 1)) * -10deg));
  will-change:transform;
}
.phone-screen {
  position:relative; aspect-ratio:9/19.5; border-radius:28px; padding:9px;
  background:#0b0a08; box-shadow:0 0 0 1px #3a362c, 0 30px 60px rgba(0,0,0,.6);
}
.phone-view { position:relative; width:100%; height:100%; border-radius:20px; overflow:hidden; background:#000; }
.phone-screen::after { content:''; position:absolute; top:15px; left:50%; width:30%; height:14px;
  transform:translateX(-50%); background:#0b0a08; border-radius:999px; z-index:2; }
.device-cap {
  margin-top:26px; text-align:center; color:var(--muted); font-size:.82rem;
  font-family:'JetBrains Mono',ui-monospace,monospace; letter-spacing:.06em;
}
.device-cap a { color:var(--amber); }
html[data-motion="reduced"] .laptop, html[data-motion="reduced"] .phone { transform:none; }
@media (max-width:680px) {
  .devices { padding:0 10% 30px 0; }
  .laptop-bar { height:18px; } .laptop-bar i { width:6px; height:6px; } .laptop-bar span { display:none; }
  .phone { width:30%; min-width:0; }
  .phone-screen { border-radius:18px; padding:5px; } .phone-view { border-radius:14px; }
  .phone-screen::after { top:9px; height:8px; }
}

/* ---------- 3. MARQUEE ---------- */
.marquee {
  position:relative; overflow:hidden; padding:34px 0;
  border-block:1px solid var(--line); background:var(--bg);
  -webkit-mask-image:linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image:linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display:flex; width:max-content; will-change:transform; }
.marquee-track span {
  flex:none; padding-right:.5em; white-space:nowrap;
  font-family:'Anton','Arial Narrow',sans-serif; text-transform:uppercase; line-height:1;
  font-size:clamp(3rem, 8vw, 6.4rem); letter-spacing:.01em; color:var(--text);
}
.marquee-track span em { font-style:normal; color:transparent; -webkit-text-stroke:1.5px rgba(242,239,230,.55); }
.marquee-track span b { color:var(--amber); font-weight:400; margin:0 .25em; }
html[data-motion="reduced"] .marquee-track { transform:none !important; }

/* ---------- 4. CURSOR ----------
   The system cursor is never hidden. A viewfinder frame snaps around the
   thing under it that you can click, and a small tag rides beside the
   pointer over work cards. Mouse and trackpad only, full motion only. */
.cur { position:fixed; left:0; top:0; width:0; height:0; z-index:2147483647; pointer-events:none; }
.cur-frame {
  position:fixed; left:0; top:0; width:0; height:0; opacity:0;
  transition:opacity .15s ease;
  will-change:transform;
}
.cur-frame.on { opacity:1; }
.cur-frame.jump { transition:opacity .15s ease, transform .16s cubic-bezier(.2,.75,.2,1), width .16s cubic-bezier(.2,.75,.2,1), height .16s cubic-bezier(.2,.75,.2,1); }
.cur-frame i { position:absolute; width:9px; height:9px; border:1.5px solid var(--amber); }
.cur-frame i:nth-child(1){ left:0; top:0; border-right:0; border-bottom:0; }
.cur-frame i:nth-child(2){ right:0; top:0; border-left:0; border-bottom:0; }
.cur-frame i:nth-child(3){ left:0; bottom:0; border-right:0; border-top:0; }
.cur-frame i:nth-child(4){ right:0; bottom:0; border-left:0; border-top:0; }
.cur-tag {
  position:fixed; left:0; top:0; padding:6px 11px; border-radius:999px;
  background:var(--amber); color:#16140F;
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.6rem; letter-spacing:.18em; text-transform:uppercase;
  opacity:0; transition:opacity .15s ease; will-change:transform; white-space:nowrap;
}
.cur-tag.on { opacity:1; }
[data-cursor] { cursor:pointer; }

/* ---------- 5. SOUND ---------- */
.snd {
  position:fixed; left:20px; bottom:20px; z-index:79;
  display:inline-flex; align-items:center; gap:9px;
  background:rgba(22,20,15,.86); border:1px solid var(--line); color:var(--muted);
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.6rem; letter-spacing:.16em; text-transform:uppercase;
  padding:9px 13px; border-radius:999px; transition:color .2s ease, border-color .2s ease;
}
.snd:hover { color:var(--text); border-color:var(--amber); }
.snd .eq { display:inline-flex; align-items:flex-end; gap:2px; height:11px; }
.snd .eq i { width:2px; height:3px; background:currentColor; border-radius:1px; transition:height .2s ease; }
.snd[aria-pressed="true"] { color:var(--amber); border-color:rgba(232,130,61,.5); }
.snd[aria-pressed="true"] .eq i { animation:fx-eq 1s ease-in-out infinite; }
.snd[aria-pressed="true"] .eq i:nth-child(2) { animation-delay:-.3s; }
.snd[aria-pressed="true"] .eq i:nth-child(3) { animation-delay:-.6s; }
.snd[aria-pressed="true"] .eq i:nth-child(4) { animation-delay:-.15s; }
@keyframes fx-eq { 0%,100%{height:3px} 50%{height:11px} }
@media (max-width:680px) { .snd { left:14px; bottom:14px; padding:9px 11px; } .snd .t { display:none; } }
.snd.in-nav { position:static; padding:9px 12px; background:transparent; }
@media (max-width:1000px) { .snd.in-nav .t { display:none; } }
@media (max-width:820px) { .snd.in-nav { padding:8px 10px; } }

/* ---------- 6. QUOTE BUILDER ---------- */
.qb { display:grid; grid-template-columns:1.25fr .9fr; gap:26px; align-items:start; }
.qb-steps { display:grid; gap:14px; }
.qb-step {
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:22px 22px 20px;
  transition:border-color .3s ease, opacity .35s ease, transform .45s cubic-bezier(.2,.75,.2,1);
}
.qb-step[hidden] { display:none; }
.qb-step.enter { opacity:0; transform:translateY(14px); }
.qb-step h3 { font-size:1rem; margin-bottom:4px; display:flex; gap:12px; align-items:baseline; }
.qb-step h3 .n { font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.66rem; color:var(--amber); letter-spacing:.16em; }
.qb-step p.hint { color:var(--muted); font-size:.85rem; margin-bottom:14px; }
.qb-opts { display:flex; flex-wrap:wrap; gap:10px; }
.qb-opt { position:relative; }
.qb-opt input { position:absolute; opacity:0; width:1px; height:1px; }
.qb-opt span {
  display:inline-flex; align-items:center; gap:8px; padding:11px 16px; border-radius:999px;
  border:1px solid var(--line); background:var(--panel-2); color:#CFC7B8; font-size:.9rem;
  transition:border-color .2s ease, background .2s ease, color .2s ease, transform .15s ease;
  cursor:pointer; user-select:none;
}
.qb-opt span:hover { border-color:var(--muted); }
.qb-opt input:checked + span { border-color:var(--amber); color:var(--text); background:rgba(232,130,61,.12); }
.qb-opt input:checked + span::before { content:'✓'; color:var(--amber); font-size:.8rem; }
.qb-opt input:focus-visible + span { outline:2px solid var(--amber); outline-offset:3px; }
.qb-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.qb-card span {
  display:block; height:100%; padding:14px 14px 13px; border-radius:12px; border-width:1px; text-align:left;
}
.qb-card span::before { display:none; }
.qb-card b { display:block; color:var(--text); font-size:.92rem; margin-bottom:4px; }
.qb-card small { display:block; color:var(--muted); font-size:.78rem; line-height:1.45; }
.qb-card em { display:block; margin-top:10px; font-style:normal; font-family:'JetBrains Mono',ui-monospace,monospace;
  font-size:.7rem; color:var(--amber); letter-spacing:.04em; }
.qb-field { display:grid; gap:6px; }
.qb-field label { font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.62rem; letter-spacing:.16em; text-transform:uppercase; color:var(--muted); }
.qb-field input, .qb-field textarea {
  width:100%; background:var(--panel-2); border:1px solid var(--line); color:var(--text);
  border-radius:10px; padding:12px 14px; font:inherit; font-size:.92rem;
}
.qb-field textarea { min-height:78px; resize:vertical; }
.qb-field input:focus, .qb-field textarea:focus { outline:none; border-color:var(--amber); }
.qb-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

.qb-sum {
  position:sticky; top:96px;
  background:linear-gradient(180deg, #26221a, #1c1914); border:1px solid rgba(232,130,61,.35);
  border-radius:var(--radius); padding:24px; box-shadow:var(--shadow); overflow:hidden;
}
.qb-sum::before { content:''; position:absolute; inset:0 0 auto; height:2px;
  background:linear-gradient(90deg, transparent, var(--amber), transparent); }
.qb-sum .eyebrow { display:block; margin-bottom:10px; }
.qb-total {
  font-family:'Anton','Arial Narrow',sans-serif; font-size:clamp(1.7rem,3.2vw,2.4rem); line-height:1.05;
  letter-spacing:.01em; color:var(--text); min-height:1.1em;
}
.qb-total small { display:block; font-family:'Inter',system-ui,sans-serif; font-size:.85rem; color:var(--muted); margin-top:6px; letter-spacing:0; }
.qb-lines { list-style:none; margin:18px 0; display:grid; gap:10px; border-top:1px dashed var(--line); padding-top:16px; }
.qb-lines li { display:flex; justify-content:space-between; gap:14px; font-size:.88rem; color:#CFC7B8;
  animation:fx-line .4s cubic-bezier(.2,.75,.2,1) both; }
.qb-lines li span:last-child { color:var(--text); text-align:right; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.78rem; }
.qb-lines li.empty { color:var(--muted); font-style:italic; }
@keyframes fx-line { from { opacity:0; transform:translateX(-8px); } }
.qb-notes { font-size:.78rem; color:var(--muted); display:grid; gap:6px; margin-bottom:18px; }
.qb-send { width:100%; justify-content:center; }
.qb-send[aria-disabled="true"] { opacity:.45; pointer-events:none; }
.qb-fine { margin-top:12px; font-size:.74rem; color:var(--muted); text-align:center; }

.qb-modal {
  width:min(1080px, calc(100vw - 32px)); max-height:calc(100svh - 32px); margin:auto;
  padding:0; border:1px solid var(--line); border-radius:18px; background:var(--bg); color:var(--text);
  box-shadow:0 30px 90px rgba(0,0,0,.7); overflow:auto;
}
.qb-modal::backdrop { background:rgba(10,9,7,.78); }
.qb-modal[open] { animation:fx-pop .45s cubic-bezier(.2,.75,.2,1); }
@keyframes fx-pop { from { opacity:0; transform:translateY(20px) scale(.98); } }
.qb-modal-head { display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding:22px 26px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--bg); z-index:2; }
.qb-modal-head h2 { font-family:'Anton','Arial Narrow',sans-serif; font-weight:400; text-transform:uppercase; font-size:1.5rem; letter-spacing:.01em; }
.qb-modal-body { padding:24px 26px 28px; }
.qb-close { background:none; border:1px solid var(--line); color:var(--muted); width:40px; height:40px; border-radius:50%; font-size:1rem; }
.qb-close:hover { color:var(--text); border-color:var(--amber); }
@media (max-width:900px) {
  .qb { grid-template-columns:1fr; }
  .qb-sum { position:relative; top:0; }
  .qb-cards { grid-template-columns:1fr; }
}
@media (max-width:520px) {
  .qb-row { grid-template-columns:1fr; }
  .qb-modal-head, .qb-modal-body { padding-left:18px; padding-right:18px; }
}

/* ---------- 7. GALLERY & MISC ---------- */
/* gallery frames get the viewfinder corners on hover */
.g-item { position:relative; }
.g-item::before, .g-item::after {
  content:''; position:absolute; z-index:3; width:18px; height:18px; pointer-events:none;
  border:2px solid var(--amber); opacity:0; transition:opacity .25s ease, transform .35s cubic-bezier(.2,.75,.2,1);
}
.g-item::before { left:10px; top:10px; border-right:0; border-bottom:0; transform:translate(6px,6px); }
.g-item::after { right:10px; bottom:10px; border-left:0; border-top:0; transform:translate(-6px,-6px); }
.g-item:hover::before, .g-item:hover::after, .g-item:focus-visible::before, .g-item:focus-visible::after { opacity:1; transform:none; }
.g-item img { transition:transform .9s cubic-bezier(.2,.75,.2,1); }
.g-item:hover img { transform:scale(1.04); }
html[data-motion="reduced"] .g-item:hover img { transform:none; }

/* a gentler, film-like lightbox entrance */
.lightbox.open .lightbox-inner img { animation:fx-develop .7s cubic-bezier(.2,.75,.2,1); }
@keyframes fx-develop { from { opacity:0; transform:scale(.97); filter:brightness(1.8) saturate(0); } }

/* image frames on case studies wipe open as they enter */
.shot.reveal { clip-path:inset(8% 6% 8% 6% round 14px); transition:clip-path 1.1s cubic-bezier(.2,.75,.2,1), opacity .8s ease, transform .9s cubic-bezier(.2,.75,.2,1); }
.shot.reveal.in { clip-path:inset(0 0 0 0 round 14px); }
html[data-motion="reduced"] .shot.reveal { clip-path:none; }

/* services: tiers lift, and the featured one breathes */
.tier { transition:transform .45s cubic-bezier(.2,.75,.2,1), border-color .25s ease, box-shadow .45s ease; }
.tier:hover { transform:translateY(-6px); box-shadow:0 22px 50px rgba(0,0,0,.45); }
.tier.featured { animation:fx-breathe 4s ease-in-out infinite; }
@keyframes fx-breathe { 0%,100%{ box-shadow:0 0 0 0 rgba(232,130,61,0); } 50%{ box-shadow:0 0 40px -6px rgba(232,130,61,.35); } }
html[data-motion="reduced"] .tier:hover { transform:none; }
html[data-motion="reduced"] .tier.featured { animation:none; }
fieldset.qb-step { margin:0; min-width:0; }
/* centred heroes (thanks page) want an even shade, not a left-hand one */
.thanks[data-film] .film-shade { background:radial-gradient(ellipse at 50% 50%, rgba(22,20,15,.72) 0%, rgba(22,20,15,.88) 60%, rgba(22,20,15,.97) 100%); }
/* film grain steps aside while the page is scrolling (site.js sets the
   class): blending an animated layer over moving video was the largest
   remaining scroll cost in testing. At 7% it is not missed mid-scroll. */
html.is-scrolling .hero-grain, html.is-scrolling .film-grain { visibility:hidden; }

/* ---------- 8. CURRENCY SWITCH ---------- */
.cur-switch { position:relative; display:inline-flex; align-items:center; }
.cur-select {
  appearance:none; -webkit-appearance:none; background:transparent; color:var(--muted);
  border:1px solid var(--line); border-radius:999px; padding:8px 26px 8px 12px; cursor:pointer;
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.66rem; letter-spacing:.12em;
}
.cur-switch::after { content:'▾'; position:absolute; right:10px; top:50%; transform:translateY(-50%); font-size:.6rem; color:var(--muted); pointer-events:none; }
.cur-select:hover, .cur-select:focus-visible { color:var(--text); border-color:var(--amber); }
.cur-select option { background:var(--panel); color:var(--text); }
.cur-inline { display:inline-flex; margin-left:8px; vertical-align:middle; }
.qb-cur { font-style:italic; }
@media (max-width:820px) { .cur-select { padding:7px 22px 7px 10px; } }

/* side service: visually secondary */
.svc-side { opacity:.86; border-style:dashed !important; }
.svc-side h3 em, .svc-block-side h2 em { font-style:normal; font-weight:400; color:var(--muted); font-size:.8em; }
.svc-block-side { opacity:.9; }

/* ---------- 9. UNDER THE HOOD (case studies) ---------- */
.hood { border-top:1px solid var(--line); }
.hood-grid { display:grid; grid-template-columns:1fr 1.1fr; gap:26px; align-items:start; }
.arch { display:flex; align-items:center; gap:0; margin-bottom:24px; flex-wrap:wrap; }
.arch .node { padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel);
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.7rem; letter-spacing:.06em; color:#CFC7B8; }
.arch .node.hot { border-color:var(--amber); color:var(--text); box-shadow:0 0 30px -8px rgba(232,130,61,.5); }
.arch i { flex:1; min-width:24px; height:1px; background:linear-gradient(90deg, var(--line), var(--amber), var(--line)); position:relative; overflow:hidden; }
.arch i::after { content:''; position:absolute; top:-2px; left:-20%; width:20%; height:5px; border-radius:3px; background:var(--amber); animation:fx-packet 2.4s linear infinite; }
.arch i:nth-of-type(2)::after { animation-delay:1.2s; }
@keyframes fx-packet { to { left:120%; } }
html[data-motion="reduced"] .arch i::after { animation:none; display:none; }
.hood-arch h3 { font-size:1rem; margin-bottom:12px; }
.hood-list { list-style:none; display:grid; gap:12px; margin-bottom:22px; }
.hood-list li { position:relative; padding-left:22px; color:#CFC7B8; font-size:.92rem; line-height:1.6; }
.hood-list li::before { content:'→'; position:absolute; left:0; color:var(--amber); }
.hood-list code, .case p code { font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.85em; color:var(--amber); }
.api-console { background:#0f0e0b; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.api-head { display:flex; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line); background:#15130f;
  font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.64rem; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.api-health { display:inline-flex; align-items:center; gap:7px; }
.api-health i { width:7px; height:7px; border-radius:50%; background:#666; }
.api-health.ok { color:#7fd18b; } .api-health.ok i { background:#3fb950; box-shadow:0 0 8px #3fb950; }
.api-health.down { color:#d9a441; } .api-health.down i { background:#d9a441; }
.api-eps { list-style:none; padding:10px; display:grid; gap:4px; border-bottom:1px solid var(--line); }
.api-eps li { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.api-eps li > span { color:var(--muted); font-size:.76rem; }
.api-eps li > span i { font-style:normal; opacity:.7; }
.api-ep { display:inline-flex; align-items:center; gap:10px; background:none; border:1px solid transparent; border-radius:8px;
  padding:8px 10px; color:var(--text); font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.74rem; text-align:left; }
.api-ep[data-run]:hover, .api-ep.active { border-color:var(--amber); background:rgba(232,130,61,.08); }
.api-ep:disabled { cursor:default; opacity:.7; }
.api-ep code { white-space:nowrap; }
.m { font-weight:600; font-size:.62rem; letter-spacing:.06em; padding:3px 6px; border-radius:4px; min-width:52px; text-align:center; }
.m-get { color:#7fd18b; background:rgba(63,185,80,.12); } .m-post { color:#e8b04a; background:rgba(232,176,74,.12); }
.m-delete { color:#ff7b72; background:rgba(255,123,114,.12); }
.api-out { margin:0; padding:16px; max-height:380px; overflow:auto; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.74rem;
  line-height:1.6; color:#CFC7B8; white-space:pre-wrap; word-break:break-word; min-height:180px; }
.j-k { color:#e8a06a; } .j-s { color:#a5d6a7; } .j-n { color:#79c0ff; } .j-l { color:#d2a8ff; } .j-c { color:#8b8577; } .j-ok { color:#7fd18b; } .j-err { color:#ff7b72; }
@media (max-width:900px) { .hood-grid { grid-template-columns:1fr; } }

/* ---------- 10. COMMAND PALETTE ---------- */
.kp { width:min(640px, calc(100vw - 24px)); margin:12vh auto auto; padding:0; border:1px solid var(--line); border-radius:16px;
  background:#15130f; color:var(--text); box-shadow:0 40px 100px rgba(0,0,0,.7); overflow:hidden; }
.kp::backdrop { background:rgba(10,9,7,.7); }
.kp[open] { animation:fx-pop .3s cubic-bezier(.2,.75,.2,1); }
.kp-in { display:flex; align-items:center; gap:12px; padding:16px 18px; border-bottom:1px solid var(--line); }
.kp-ic { color:var(--amber); font-size:1rem; }
.kp-in input { flex:1; background:none; border:0; color:var(--text); font:inherit; font-size:1.02rem; outline:none; }
.kp kbd, .kp-foot span { font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.62rem; color:var(--muted); letter-spacing:.08em; }
.kp kbd { border:1px solid var(--line); border-radius:6px; padding:3px 7px; }
.kp-list { list-style:none; max-height:min(420px, 55vh); overflow:auto; padding:8px; }
.kp-list li { display:flex; justify-content:space-between; gap:16px; padding:11px 12px; border-radius:10px; cursor:pointer; font-size:.92rem; color:#CFC7B8; }
.kp-list li em { font-style:normal; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); align-self:center; }
.kp-list li[aria-selected="true"] { background:rgba(232,130,61,.12); color:var(--text); }
.kp-list li[aria-selected="true"] em { color:var(--amber); }
.kp-none { color:var(--muted); cursor:default !important; }
.kp-foot { display:flex; gap:18px; padding:10px 18px; border-top:1px solid var(--line); }
.kp-open b { margin-right:4px; }
.fx-toast { position:fixed; left:50%; bottom:28px; z-index:9999; transform:translate(-50%, 12px); opacity:0; transition:all .3s ease;
  background:var(--amber); color:#16140F; font-weight:600; font-size:.85rem; padding:10px 16px; border-radius:999px; }
.fx-toast.on { opacity:1; transform:translate(-50%, 0); }

/* ── Live frames in the device mockups ──────────────────────────────────
   A case study can show the real build running inside the laptop and the
   phone instead of a screenshot that goes stale. The iframe is laid out at
   a real device width and scaled down to fit the mockup, so the page inside
   sees a desktop viewport and lays itself out accordingly. js/frames.js
   sets --fs on each frame. */
.laptop-view iframe, .phone-view iframe {
  position:absolute; top:0; left:0; border:0; display:block;
  transform-origin:top left; transform:scale(var(--fs, .55));
  width:1280px; height:800px; background:var(--bg, #0d0d0d);
}
.phone-view iframe { width:390px; height:845px; transform:scale(var(--fs, .34)); }
.laptop-view.is-live, .phone-view.is-live { background:#efe9de; }
