/* ==========================================================
   79mplus — EXPERIENCE LAYER
   Case study · command palette · theme engine · cursor ·
   preloader · lightbox · estimator · toasts · a11y · perf

   Loaded after style.css. Everything here is additive and
   degrades gracefully: no JS, no WebGL or reduced-motion
   users still get a complete, readable, fast site.
   ========================================================== */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
  --fx-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --fx-glow: 0 0 0 1px rgba(var(--brand-rgb), .35), 0 18px 50px rgba(var(--brand-rgb), .22);
  --fx-glass: rgba(255, 255, 255, .72);
  --fx-border: rgba(15, 23, 42, .10);
  --fx-shadow-soft: 0 30px 70px -30px rgba(15, 23, 42, .35);
  --fx-r-lg: 26px;
  --fx-r-md: 18px;
  --fx-speed: .32s;
  --fx-ease: cubic-bezier(.22, .68, .28, 1);
  --fx-num: tabular-nums;
}

/* Dark theme: re-skin the tokens style.css already uses.
   Every rule below exists because the light stylesheet hard-codes a colour
   somewhere (verified with an automated contrast audit, not by eye). */
[data-theme="dark"] {
  --ink: #e8eef6;
  --muted: #9fb0c4;
  --line: rgba(148, 163, 184, .20);
  --surface: #0e1520;
  --surface-alt: #080d14;
  --brand-soft: rgba(47, 190, 95, .16);
  --brand: #35c46a;          /* accents + text on dark */
  --brand-2: #45d97c;
  --brand-dark: #6ee7a0;
  --brand-solid: #0f7a34;    /* solid button fill: keeps white text ≥ 4.5:1 */
  --accent: #ffd24d;
  --dark-1: #04070c;
  --dark-2: #0a1a12;
  --footer-bg: #04070b;
  --fx-glass: rgba(14, 21, 32, .72);
  --fx-border: rgba(148, 163, 184, .18);
  --fx-shadow-soft: 0 30px 70px -30px rgba(0, 0, 0, .85);
  color-scheme: dark;
}

/* ---------- page shell ---------- */
html[data-theme="dark"] body { background: var(--surface-alt); color: var(--ink); }
html[data-theme="dark"] main, html[data-theme="dark"] .section { background: transparent; }
html[data-theme="dark"] hr { border-color: var(--line); opacity: 1; }

/* ---------- navbar (incl. the collapsed mobile menu) ---------- */
html[data-theme="dark"] .site-nav { background: rgba(8, 13, 20, .88); border-bottom-color: var(--line); }
html[data-theme="dark"] .site-nav.scrolled { background: rgba(8, 13, 20, .96); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .site-nav .nav-link { color: #c8d5e3; }
html[data-theme="dark"] .site-nav .nav-link:hover,
html[data-theme="dark"] .site-nav .nav-link.active { color: var(--brand-2); }
html[data-theme="dark"] .site-nav .navbar-toggler { color: var(--ink); }
/* the collapsed menu only becomes a panel on small screens — on desktop the
   nav bar itself is the surface, so no box is drawn around the links */
@media (max-width: 991.98px) {
  html[data-theme="dark"] .site-nav .navbar-collapse { background: #0b121b; border: 1px solid var(--line); border-radius: 16px; }
  html[data-theme="dark"] .site-nav .navbar-collapse.show { box-shadow: 0 24px 60px rgba(0, 0, 0, .65); }
}
html[data-theme="dark"] .fx-cmd-trigger { background: #0b121b; border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .fx-cmd-trigger kbd, html[data-theme="dark"] .fx-cmd-trigger kbd * { color: #9fe8bd !important; }
html[data-theme="dark"] .fx-theme-btn { background: #0b121b; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .fx-status-chip { background: #0b121b; border-color: var(--line); color: var(--muted); }

/* ---------- surfaces (light.css hard-codes #fff on these) ---------- */
html[data-theme="dark"] .stats-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .reco-card,
html[data-theme="dark"] .work-card,
html[data-theme="dark"] .process-step,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .sidebar-card,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .chip-outline,
html[data-theme="dark"] .share-btn,
html[data-theme="dark"] .impact,
html[data-theme="dark"] .cs-meta div,
html[data-theme="dark"] .est-option,
html[data-theme="dark"] .fx-modal,
html[data-theme="dark"] .fx-palette,
html[data-theme="dark"] .fx-toast,
html[data-theme="dark"] .fx-bar { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .section-alt { background: #0b111a; }
html[data-theme="dark"] .cs-meta { border-color: var(--line); background: var(--line); }
html[data-theme="dark"] .shot { background: #0b111a; border-color: var(--fx-border); }

/* ---------- text ---------- */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .work-body p,
html[data-theme="dark"] .product-body p,
html[data-theme="dark"] .post-card p,
html[data-theme="dark"] .reco-card small,
html[data-theme="dark"] .team-card p,
html[data-theme="dark"] .feature-card p,
html[data-theme="dark"] .process-step p,
html[data-theme="dark"] .contact-card p,
html[data-theme="dark"] .est-option small,
html[data-theme="dark"] .impact .k,
html[data-theme="dark"] .article-toc a { color: var(--muted) !important; }
html[data-theme="dark"] .hero .lead,
html[data-theme="dark"] .page-header p,
html[data-theme="dark"] .section-sub { color: #b9c7d7; }
html[data-theme="dark"] .post-card h5 a,
html[data-theme="dark"] .reco-card,
html[data-theme="dark"] .related-link { color: var(--ink); }
html[data-theme="dark"] .post-card h5 a:hover { color: var(--brand-2); }
html[data-theme="dark"] .check-list li { color: var(--muted); }
html[data-theme="dark"] .chip { background: var(--brand-soft); color: var(--brand-2); border: 1px solid rgba(47, 190, 95, .28); }
html[data-theme="dark"] .chip-outline { color: var(--muted); }
html[data-theme="dark"] .tag,
html[data-theme="dark"] .skill-chip { background: var(--brand-soft); color: var(--brand-2); border-color: rgba(47, 190, 95, .3); }

/* ---------- article body (hard-codes #1e293b) ---------- */
html[data-theme="dark"] .article-body { color: #d7e1ec; }
html[data-theme="dark"] .article-body h2,
html[data-theme="dark"] .article-body h3,
html[data-theme="dark"] .article-body strong { color: #f1f6fb; }
html[data-theme="dark"] .article-body .lead-in { color: var(--muted); border-left-color: var(--accent); }
html[data-theme="dark"] .article-body code { background: rgba(47, 190, 95, .14); color: var(--brand-2); }
html[data-theme="dark"] .article-body pre { background: #060b12; color: #cfe9d8; }
html[data-theme="dark"] .callout { background: var(--brand-soft); color: var(--ink); border-left-color: var(--brand-2); }
html[data-theme="dark"] .code-copy { background: rgba(255, 255, 255, .08); color: #cfe9d8; border-color: rgba(255, 255, 255, .16); }

/* ---------- buttons: white text needs a darker fill in dark mode ---------- */
html[data-theme="dark"] .btn-brand,
html[data-theme="dark"] .skip-link { background: var(--brand-solid); border-color: var(--brand-solid); color: #fff; }
html[data-theme="dark"] .btn-brand:hover { background: #0b6a2e; border-color: #0b6a2e; color: #fff; }
html[data-theme="dark"] .btn-outline-brand { color: var(--brand-2); border-color: var(--brand-2); }
html[data-theme="dark"] .btn-outline-brand:hover { background: var(--brand-solid); border-color: var(--brand-solid); color: #fff; }
html[data-theme="dark"] .btn-light { background: #16212e; color: #d1fae5; border-color: var(--line); }
html[data-theme="dark"] .btn-light:hover { background: #1d2b3b; color: #fff; }
html[data-theme="dark"] .btn-light-outline { background: transparent; color: #dbe6f2; border-color: rgba(255, 255, 255, .38); }
html[data-theme="dark"] .btn-light-outline:hover { background: #fff; color: #06170d; }
html[data-theme="dark"] #scrollTop { background: linear-gradient(135deg, var(--brand-solid), #159c46); }

/* ---------- floating chips + code window (hard-coded white) ---------- */
html[data-theme="dark"] .float-chip { background: #101a26; color: var(--ink); border: 1px solid var(--fx-border); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .float-chip i { color: var(--brand-2); }
html[data-theme="dark"] .tok-c { color: #8ba3bd; }
html[data-theme="dark"] .device-frame { background: #060b12; border-color: var(--fx-border); }
html[data-theme="dark"] .device-frame .chrome { background: #0a1119; border-bottom-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .device-frame .chrome .url { background: rgba(255, 255, 255, .06); color: var(--brand-2); }

/* ---------- panels with their own dark gradients ---------- */
html[data-theme="dark"] .about-visual,
html[data-theme="dark"] .work-top { background: linear-gradient(150deg, #071019, #0c2018); }
html[data-theme="dark"] .estimator-result { background: linear-gradient(160deg, #050b12, #0b1f16); }
html[data-theme="dark"] .sidebar-card[style*="gradient"] { background: linear-gradient(150deg, #0a1620, #0d2a1c) !important; }
html[data-theme="dark"] .tech-ticker { background: linear-gradient(90deg, #04070c, #08170f 50%, #04070c); }
html[data-theme="dark"] .site-footer { background: #03060a; border-top: 1px solid var(--line); }
html[data-theme="dark"] .footer-bottom { border-top-color: var(--line); }
html[data-theme="dark"] .footer-marquee { border-top-color: var(--line); }
html[data-theme="dark"] .footer-marquee span { -webkit-text-stroke: 1px rgba(148, 163, 184, .30); }

/* ---------- forms ---------- */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .bg-white { background-color: #0b1119 !important; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .input-group-text.bg-white i { color: var(--brand-2); }
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus { background: #0d141d; border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(47, 190, 95, .18); }
html[data-theme="dark"] .form-control::placeholder { color: #6b7d92; }
html[data-theme="dark"] .form-label { color: #cbd8e6; }
html[data-theme="dark"] .invalid-feedback { color: #fca5a5; }
html[data-theme="dark"] .form-draft-note { background: var(--brand-soft); color: var(--muted); border-color: rgba(47, 190, 95, .3); }
html[data-theme="dark"] .char-count { color: var(--muted); }
html[data-theme="dark"] .alert-success { background: rgba(34, 197, 94, .12); color: #86efac; border-color: rgba(34, 197, 94, .35); }
html[data-theme="dark"] .alert-danger { background: rgba(239, 68, 68, .12); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
html[data-theme="dark"] .form-check-input { background-color: #0b1119; border-color: var(--line); }
html[data-theme="dark"] .form-check-input:checked { background-color: var(--brand-solid); border-color: var(--brand-solid); }

/* ---------- accordion ---------- */
html[data-theme="dark"] .accordion-item { background: var(--surface); border-color: var(--line) !important; }
html[data-theme="dark"] .accordion-button { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .accordion-button:not(.collapsed) { background: var(--brand-soft); color: var(--brand-2); box-shadow: none; }
html[data-theme="dark"] .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(47, 190, 95, .22); border-color: var(--brand-2); }
html[data-theme="dark"] .accordion-button::after { filter: invert(1) brightness(1.7); }

/* ---------- command palette + misc overlays ---------- */
html[data-theme="dark"] kbd,
html[data-theme="dark"] .fx-item .fx-hint { background: #0b1119; border-color: var(--line); color: #cfe0d4; }
[data-theme="dark"] kbd { background: #0b1119; color: #cfe0d4; border: 1px solid var(--line); border-bottom-width: 2px; }
html[data-theme="dark"] .fx-cursor-ring { border-color: rgba(110, 231, 160, .7); }
html[data-theme="dark"] .fx-cursor { background: var(--brand-2); }
html[data-theme="dark"] .fx-empty { color: var(--muted); }
html[data-theme="dark"] .fx-marquee, html[data-theme="dark"] .fx-marquee span { color: transparent; }

/* ------------------------------------------------------------
   2. FOUNDATION: focus, selection, scrollbar, skip link
   ------------------------------------------------------------ */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(var(--brand-rgb), .28); color: inherit; }
html { -webkit-tap-highlight-color: transparent; }

* { scrollbar-width: thin; scrollbar-color: rgba(var(--brand-rgb), .55) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: linear-gradient(var(--brand), var(--brand-2)); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--brand-dark); background-clip: content-box; }

.skip-link {
  position: fixed; top: 10px; left: 50%; transform: translate(-50%, -160%);
  z-index: 3000; background: var(--brand); color: #fff; font-weight: 700;
  padding: .7rem 1.3rem; border-radius: 999px; box-shadow: var(--fx-shadow-soft);
  transition: transform .28s var(--fx-ease);
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

.mono { font-family: var(--fx-mono); letter-spacing: .02em; }
.mono-label {
  font-family: var(--fx-mono); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; color: var(--muted);
}
.text-gradient {
  background: linear-gradient(100deg, var(--brand-dark) 0%, var(--brand-2) 30%, var(--brand) 55%, var(--brand-2) 80%, var(--brand-dark) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fx-sheen 8s ease-in-out infinite;
}
@keyframes fx-sheen { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }

/* ---------- WebGL background layer ---------- */
.fx-webgl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* ---------- Preloader (first visit per session only) ---------- */
#fx-boot {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% 30%, #0d3a22 0%, #05130c 55%, #020805 100%);
  color: #d1fae5; font-family: var(--fx-mono);
  transition: opacity .5s ease, visibility .5s ease, clip-path .7s var(--fx-ease);
}
#fx-boot.done { opacity: 0; visibility: hidden; clip-path: inset(0 0 100% 0); }
#fx-boot .boot-inner { width: min(420px, 82vw); text-align: left; }
#fx-boot .boot-mark { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
#fx-boot .boot-mark img { width: 34px; height: 34px; border-radius: 10px; }
#fx-boot .boot-mark span { font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: .9rem; }
#fx-boot .boot-log { font-size: .78rem; color: #6ee7a0; min-height: 3.4em; white-space: pre-line; }
#fx-boot .boot-bar { height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 1rem; }
#fx-boot .boot-bar i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #6ee7a0, var(--accent)); transition: width .25s linear; }
#fx-boot .boot-pct { display: flex; justify-content: space-between; font-size: .7rem; color: #64748b; margin-top: .55rem; letter-spacing: .1em; }

/* ------------------------------------------------------------
   4. CUSTOM CURSOR
   ------------------------------------------------------------ */
.fx-cursor, .fx-cursor-ring { position: fixed; top: 0; left: 0; z-index: 3990; pointer-events: none; will-change: transform; }
.fx-cursor { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 12px rgba(var(--brand-rgb), .9); }
.fx-cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  border: 1.5px solid rgba(var(--brand-rgb), .55); transition: width .22s var(--fx-ease), height .22s var(--fx-ease), margin .22s var(--fx-ease), background-color .22s ease, border-color .22s ease, opacity .2s ease;
}
.fx-cursor-ring.is-link { width: 62px; height: 62px; margin: -31px 0 0 -31px; background: rgba(var(--brand-rgb), .12); border-color: rgba(var(--brand-rgb), .8); }
.fx-cursor-ring.is-media { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: rgba(var(--brand-rgb), .16); }
.fx-cursor-ring .fx-cursor-tag { position: absolute; inset: 0; display: grid; place-items: center; font: 600 9px/1 var(--fx-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-dark); opacity: 0; transition: opacity .2s ease; }
.fx-cursor-ring.is-media .fx-cursor-tag { opacity: 1; }
body.fx-has-cursor, body.fx-has-cursor * { cursor: none !important; }

/* ------------------------------------------------------------
   5. COMMAND PALETTE
   ------------------------------------------------------------ */
.fx-palette-backdrop {
  position: fixed; inset: 0; z-index: 3600; display: none;
  background: rgba(3, 8, 14, .62); backdrop-filter: blur(14px) saturate(1.2);
  padding: clamp(1rem, 9vh, 7rem) 1rem 1rem; justify-content: center;
}
.fx-palette-backdrop.open { display: flex; animation: fx-fade .18s ease; }
@keyframes fx-fade { from { opacity: 0; } }
.fx-palette {
  width: min(680px, 100%); max-height: min(70vh, 620px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--fx-border); border-radius: var(--fx-r-lg);
  box-shadow: var(--fx-shadow-soft); overflow: hidden; animation: fx-pop .26s var(--fx-ease);
}
@keyframes fx-pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.fx-palette-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.fx-palette-head i { color: var(--brand); font-size: 1.15rem; }
.fx-palette-head input {
  flex: 1; border: 0; background: transparent; font-size: 1.02rem; color: var(--ink);
  outline: none; font-family: inherit;
}
.fx-palette-head input::placeholder { color: var(--muted); }
.fx-palette-results { overflow-y: auto; padding: .5rem; scrollbar-width: thin; }
.fx-group-label { font: 600 .68rem/1 var(--fx-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: .8rem .7rem .4rem; }
.fx-item {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left;
  padding: .62rem .7rem; border: 0; background: transparent; border-radius: 12px;
  color: var(--ink); font-size: .95rem; cursor: pointer; transition: background .12s ease;
}
.fx-item .fx-ico { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-size: .9rem; }
.fx-item .fx-txt { min-width: 0; }
.fx-item .fx-txt strong { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-item .fx-txt small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-item .fx-hint { margin-left: auto; font: 600 .7rem/1 var(--fx-mono); color: var(--muted); border: 1px solid var(--line); padding: .25rem .45rem; border-radius: 6px; }
.fx-item[aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .35); }
.fx-item mark { background: rgba(var(--brand-rgb), .22); color: inherit; border-radius: 3px; padding: 0 1px; }
.fx-palette-foot { display: flex; gap: 1rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); flex-wrap: wrap; }
.fx-palette-foot kbd { font: 600 .7rem/1 var(--fx-mono); background: var(--surface-alt); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .22rem .35rem; margin-right: .3rem; }
.fx-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }

/* Nav trigger */
.fx-cmd-trigger {
  display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .55rem 0 .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.fx-cmd-trigger:hover { color: var(--brand); border-color: rgba(var(--brand-rgb), .5); box-shadow: 0 6px 18px rgba(var(--brand-rgb), .12); }
.fx-cmd-trigger kbd {
  font: 700 .74rem/1 var(--fx-mono); color: var(--muted);   /* explicit: Bootstrap left this white */
  background: var(--surface-alt); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 7px; padding: .3rem .45rem; min-width: 1.55em; text-align: center;
}
.fx-cmd-trigger kbd, .fx-cmd-trigger kbd * { color: var(--muted) !important; -webkit-text-fill-color: currentColor; }
.fx-cmd-trigger:hover kbd { color: var(--brand); border-color: rgba(var(--brand-rgb), .45); background: var(--brand-soft); }
.fx-theme-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; font-size: 1.05rem;
  transition: transform .3s var(--fx-ease), border-color .2s ease, color .2s ease;
}
.fx-theme-btn:hover { transform: rotate(-25deg) scale(1.06); color: var(--brand); border-color: rgba(var(--brand-rgb), .5); }
.fx-status-chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .7rem .3rem .55rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font: 600 .74rem/1 var(--fx-mono); color: var(--muted); white-space: nowrap;
}
.fx-status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); animation: fx-pulse 2.4s infinite; }
@keyframes fx-pulse { 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ------------------------------------------------------------
   6. TOASTS
   ------------------------------------------------------------ */
.fx-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 3800; display: flex; flex-direction: column; gap: .6rem; pointer-events: none; }
.fx-toast {
  pointer-events: auto; display: flex; align-items: center; gap: .7rem; min-width: 240px; max-width: 380px;
  padding: .8rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--fx-border);
  box-shadow: var(--fx-shadow-soft); font-size: .92rem; color: var(--ink);
  animation: fx-toast-in .34s var(--fx-ease);
}
.fx-toast.out { animation: fx-toast-out .3s var(--fx-ease) forwards; }
.fx-toast i { font-size: 1.1rem; color: var(--brand); }
.fx-toast.err i { color: #ef4444; }
@keyframes fx-toast-in { from { transform: translateX(120%); opacity: 0; } }
@keyframes fx-toast-out { to { transform: translateX(120%); opacity: 0; } }

/* ------------------------------------------------------------
   7. MODAL / PROFILE
   ------------------------------------------------------------ */
.fx-modal-backdrop {
  position: fixed; inset: 0; z-index: 3500; display: none; place-items: center; padding: 1rem;
  background: rgba(3, 8, 14, .66); backdrop-filter: blur(12px);
}
.fx-modal-backdrop.open { display: grid; animation: fx-fade .18s ease; }
.fx-modal {
  width: min(720px, 100%); max-height: 88vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--fx-border); border-radius: var(--fx-r-lg); box-shadow: var(--fx-shadow-soft);
  animation: fx-pop .3s var(--fx-ease); position: relative;
}
.fx-modal-close {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; z-index: 3;
}
.fx-modal-close:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.fx-modal-body { padding: 2.4rem; }
.fx-profile-head { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.fx-profile-head .avatar-wrap { margin: 0; width: 104px; height: 104px; }
.fx-profile-head h3 { margin: 0 0 .2rem; font-size: 1.5rem; }
.fx-bars { display: grid; gap: .85rem; margin-top: 1.4rem; }
.fx-bar-row { display: grid; grid-template-columns: 8.5rem 1fr 3rem; align-items: center; gap: .8rem; font-size: .88rem; }
.fx-bar { height: 8px; border-radius: 99px; background: var(--surface-alt); overflow: hidden; border: 1px solid var(--line); }
.fx-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 1s var(--fx-ease); }
.fx-bar-row .pct { font: 600 .78rem/1 var(--fx-mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   8. CASE STUDY — device frame, gallery, lightbox
   ------------------------------------------------------------ */
.device-frame {
  position: relative; border-radius: 20px; overflow: hidden; background: #0b111a;
  border: 1px solid var(--fx-border); box-shadow: var(--fx-shadow-soft);
  transform-style: preserve-3d; transition: transform .2s ease-out;
}
.device-frame .chrome { display: flex; align-items: center; gap: .55rem; padding: .7rem .9rem; background: #0d141d; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.device-frame .chrome i { width: 10px; height: 10px; border-radius: 50%; }
.device-frame .chrome i:nth-child(1) { background: #ef4444; } .device-frame .chrome i:nth-child(2) { background: #f59e0b; } .device-frame .chrome i:nth-child(3) { background: #22c55e; }
.device-frame .chrome .url { margin-left: .5rem; flex: 1; display: flex; align-items: center; gap: .45rem; background: rgba(255, 255, 255, .06); border-radius: 99px; padding: .25rem .7rem; font: 500 .74rem/1.6 var(--fx-mono); color: #7dd3a8; max-width: 320px; }
.device-frame .chrome .url .lock { color: #22c55e; font-size: .8rem; }
.device-frame img { display: block; width: 100%; height: auto; }
.device-frame .scanline { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 0%, rgba(var(--brand-rgb), .10) 50%, transparent 100%); height: 30%; animation: fx-scan 5.5s linear infinite; }
@keyframes fx-scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(360%); } }

.cs-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--fx-r-md); overflow: hidden; }
.cs-meta div { background: var(--surface); padding: 1.1rem 1.2rem; }
.cs-meta dt { font: 600 .7rem/1 var(--fx-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.cs-meta dd { margin: 0; font-weight: 650; font-size: .98rem; }

.shot { position: relative; margin: 0; border-radius: var(--fx-r-md); overflow: hidden; border: 1px solid var(--fx-border); background: var(--surface-alt); box-shadow: var(--fx-shadow-soft); }
.shot img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .6s ease, transform .7s var(--fx-ease); transform: scale(1.02); }
.shot img.ready { opacity: 1; }
.shot.zoomable { cursor: zoom-in; }
.shot.zoomable:hover img { transform: scale(1.045); }
.shot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.6rem 1.1rem .9rem; font-size: .82rem; color: #e2e8f0; background: linear-gradient(transparent, rgba(2, 6, 12, .88)); opacity: 0; transition: opacity .3s ease; }
.shot:hover figcaption { opacity: 1; }
.shot .badge-live { position: absolute; top: 12px; left: 12px; z-index: 2; font: 600 .68rem/1 var(--fx-mono); letter-spacing: .12em; text-transform: uppercase; background: rgba(2, 6, 12, .72); color: #d1fae5; padding: .35rem .6rem; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }

.gallery-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem; }
.gallery-grid .shot:nth-child(1) { grid-column: span 6; }
.gallery-grid .shot:nth-child(2) { grid-column: span 3; }
.gallery-grid .shot:nth-child(3) { grid-column: span 3; }
.gallery-grid .shot:nth-child(4) { grid-column: span 2; }
.gallery-grid .shot:nth-child(5) { grid-column: span 2; }
.gallery-grid .shot:nth-child(6) { grid-column: span 2; }
.gallery-grid .shot:nth-child(n+7) { grid-column: span 3; }
@media (max-width: 991.98px) {
  .gallery-grid .shot, .gallery-grid .shot:nth-child(n) { grid-column: span 6; }
}

.fx-lightbox {
  position: fixed; inset: 0; z-index: 3900; display: none; place-items: center;
  background: rgba(2, 5, 10, .93); backdrop-filter: blur(10px); padding: clamp(.5rem, 3vw, 2.5rem);
}
.fx-lightbox.open { display: grid; animation: fx-fade .2s ease; }
.fx-lightbox figure { margin: 0; max-width: min(1400px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: .8rem; }
.fx-lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 12px; box-shadow: 0 40px 90px rgba(0, 0, 0, .6); background: #0b111a; }
.fx-lightbox figcaption { color: #cbd5e1; font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.fx-lightbox figcaption .n { font-family: var(--fx-mono); color: #6ee7a0; }
.fx-lb-btn { position: fixed; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.3rem; cursor: pointer; backdrop-filter: blur(8px); transition: background .2s ease, transform .2s ease; }
.fx-lb-btn:hover { background: var(--brand); transform: scale(1.06); }
.fx-lb-prev { left: 18px; top: 50%; margin-top: -26px; } .fx-lb-next { right: 18px; top: 50%; margin-top: -26px; }
.fx-lb-close { right: 18px; top: 18px; }

/* Impact / stat band */
.impact-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.impact { padding: 1.6rem 1.4rem; border-radius: var(--fx-r-md); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.impact::before { content: ""; position: absolute; inset: 0; background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--brand-rgb), .12), transparent 60%); opacity: 0; transition: opacity .3s ease; }
.impact:hover::before { opacity: 1; }
.impact .v { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: var(--fx-num); }
.impact .k { font-size: .85rem; color: var(--muted); margin-top: .35rem; }

/* Architecture diagram (pure CSS) */
.arch { display: grid; gap: 1rem; }
.arch-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; align-items: stretch; }
.arch-node { padding: .95rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: center; font-size: .86rem; font-weight: 600; position: relative; transition: transform .25s var(--fx-ease), border-color .25s ease, box-shadow .25s ease; }
.arch-node:hover { transform: translateY(-3px); border-color: rgba(var(--brand-rgb), .45); box-shadow: 0 12px 28px rgba(var(--brand-rgb), .14); }
.arch-node small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; margin-top: .2rem; }
.arch-node.core { background: linear-gradient(140deg, rgba(var(--brand-rgb), .14), rgba(var(--brand-rgb), .04)); border-color: rgba(var(--brand-rgb), .4); }
.arch-flow { text-align: center; color: var(--muted); font: 600 .7rem/1 var(--fx-mono); letter-spacing: .14em; }

/* Feature rows for the case study */
.cs-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 991.98px) { .cs-feature { grid-template-columns: 1fr; gap: 1.8rem; } }
.cs-feature.flip > .cs-feature-copy { order: 2; }
@media (max-width: 991.98px) { .cs-feature.flip > .cs-feature-copy { order: 0; } }
.cs-feature ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.cs-feature li { display: flex; gap: .7rem; color: var(--muted); }
.cs-feature li i { color: var(--brand); margin-top: .15rem; }
.cs-feature li strong { color: var(--ink); }

/* ------------------------------------------------------------
   9. ESTIMATOR (services)
   ------------------------------------------------------------ */
.estimator { border-radius: var(--fx-r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--fx-shadow-soft); }
.estimator-grid { display: grid; grid-template-columns: 1.15fr .85fr; }
@media (max-width: 991.98px) { .estimator-grid { grid-template-columns: 1fr; } }
.estimator-side { padding: 2rem; border-right: 1px solid var(--line); }
@media (max-width: 991.98px) { .estimator-side { border-right: 0; border-bottom: 1px solid var(--line); } }
.estimator-result { padding: 2rem; background: linear-gradient(160deg, var(--dark-1), var(--dark-2)); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.est-option { display: flex; align-items: flex-start; gap: .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; margin-bottom: .6rem; transition: border-color .2s ease, background .2s ease, transform .2s var(--fx-ease); }
.est-option:hover { transform: translateX(3px); border-color: rgba(var(--brand-rgb), .4); }
.est-option input { margin-top: .3rem; accent-color: var(--brand); width: 18px; height: 18px; }
.est-option.is-on { border-color: var(--brand); background: var(--brand-soft); }
.est-option strong { display: block; font-size: .95rem; }
.est-option small { color: var(--muted); font-size: .82rem; }
.est-price { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: var(--fx-num); line-height: 1; }
.est-sub { color: #cbd5e1; font-size: .9rem; }
.est-rows { display: grid; gap: .5rem; margin: 1.2rem 0; font-size: .88rem; }
.est-rows div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed rgba(255, 255, 255, .16); padding-bottom: .45rem; }
.est-rows span:last-child { font-family: var(--fx-mono); color: #d1fae5; }
.est-pulse { animation: fx-flash .5s var(--fx-ease); }
@keyframes fx-flash { 0% { filter: brightness(1.7); } 100% { filter: none; } }

/* ------------------------------------------------------------
   10. BLOG: reading progress, TOC, code copy
   ------------------------------------------------------------ */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; z-index: 1200; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.article-toc { position: sticky; top: 96px; font-size: .92rem; }
.article-toc .toc-title { font: 600 .72rem/1 var(--fx-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.article-toc a { display: block; padding: .34rem 0 .34rem .8rem; border-left: 2px solid var(--line); color: var(--muted); transition: color .2s ease, border-color .2s ease; }
.article-toc a:hover, .article-toc a.active { color: var(--brand); border-color: var(--brand); }
.article-toc a.sub { padding-left: 1.6rem; font-size: .86rem; }
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 100px; }
.code-wrap { position: relative; }
.code-copy { position: absolute; top: 10px; right: 10px; z-index: 2; font: 600 .7rem/1 var(--fx-mono); letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .1); color: #d1fae5; border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; padding: .35rem .55rem; cursor: pointer; opacity: 0; transition: opacity .2s ease, background .2s ease; }
.code-wrap:hover .code-copy, .code-copy:focus { opacity: 1; }
.code-copy:hover { background: var(--brand); }

/* ------------------------------------------------------------
   11. FORM UX
   ------------------------------------------------------------ */
.char-count { font: 600 .74rem/1 var(--fx-mono); color: var(--muted); text-align: right; margin-top: .35rem; }
.char-count.warn { color: #f59e0b; }
.hp-field { position: absolute !important; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: fx-spin .7s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.form-draft-note { display: none; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); background: var(--brand-soft); border: 1px solid rgba(var(--brand-rgb), .25); border-radius: 10px; padding: .5rem .75rem; margin-bottom: 1rem; }
.form-draft-note.show { display: flex; }

/* ------------------------------------------------------------
   12. FOOTER EXTRAS
   ------------------------------------------------------------ */
.footer-clock { display: inline-flex; align-items: center; gap: .5rem; font: 600 .86rem/1 var(--fx-mono); color: #cbd5e1; }
.footer-clock .t { color: #6ee7a0; }
.footer-marquee { overflow: hidden; border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 2.5rem; padding: 1.4rem 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.footer-marquee .track { display: flex; gap: 2.5rem; width: max-content; animation: fx-marquee 34s linear infinite; }
.footer-marquee span { font: 800 clamp(2.4rem, 7vw, 5rem)/1 var(--fx-mono); letter-spacing: .02em; color: transparent; -webkit-text-stroke: 1px rgba(148, 163, 184, .35); white-space: nowrap; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }
.copy-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: .2rem .6rem; font: 600 .74rem/1.4 var(--fx-mono); color: #cbd5e1; background: rgba(255, 255, 255, .04); cursor: pointer; transition: all .2s ease; }
.copy-chip:hover { color: #fff; border-color: var(--brand); background: rgba(var(--brand-rgb), .18); }

/* ------------------------------------------------------------
   13. PERFORMANCE + MOTION SAFETY
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .fx-cursor, .fx-cursor-ring { display: none; }
  .device-frame .scanline { display: none; }
  #fx-boot { display: none; }
}
/* Long pages are already light (no webfonts beyond Inter, WebP imagery, one
   stylesheet pair). We deliberately skip content-visibility here: it makes the
   document grow while scrolling, which fights scroll-reveal animations and
   causes layout shift on long pages. */
@media print {
  .site-nav, .site-footer, #scrollTop, #fx-boot, .fx-toasts, .fx-cursor, .fx-cursor-ring, .fx-cmd-trigger, .fx-theme-btn, .tech-ticker, .read-progress { display: none !important; }
  body { color: #000; background: #fff; }
}

/* highlight a section jumped to from the command palette */
.cmd-flash { animation: cmd-flash 1.2s var(--fx-ease); }
@keyframes cmd-flash {
  0%   { box-shadow: inset 0 0 0 0 rgba(var(--brand-rgb), 0); }
  25%  { box-shadow: inset 0 0 0 3px rgba(var(--brand-rgb), .55); }
  100% { box-shadow: inset 0 0 0 0 rgba(var(--brand-rgb), 0); }
}

/* ------------------------------------------------------------
   14. TEAM AVATARS — monogram by default, real photo if present
   Drop a file at  team/<slug>.jpg  (or .png / .webp) and it is
   used automatically. No markup change needed.
   ------------------------------------------------------------ */
.avatar { position: relative; isolation: isolate; letter-spacing: .02em; }
.avatar::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at 30% 15%, rgba(255, 255, 255, .34), transparent 55%);
  mix-blend-mode: soft-light;
}
.avatar img { position: relative; z-index: 1; }
.avatar-sm { width: 78px; height: 78px; font-size: 1.45rem; border-width: 3px; }
.avatar-wrap:has(.avatar-sm) { width: 78px; height: 78px; margin-bottom: 1rem; }
.avatar-wrap:has(.avatar-sm)::before,
.avatar-wrap:has(.avatar-sm)::after { inset: -5px; }

.team-card-compact { padding: 1.6rem .8rem 1.4rem; }
.team-card-compact h5 { font-size: .96rem; line-height: 1.3; }
.team-card-compact .team-role { font-size: .8rem; margin-bottom: 0; }
.team-card-compact .avatar-wrap { margin-bottom: .85rem; }

/* deterministic per-person tint, kept inside the brand family */
.avatar[data-tone="0"] { background: linear-gradient(135deg, #22a84e, #0b6a2e); }
.avatar[data-tone="1"] { background: linear-gradient(135deg, #2bb3a3, #0f6e63); }
.avatar[data-tone="2"] { background: linear-gradient(135deg, #3aa63f, #14532d); }
.avatar[data-tone="3"] { background: linear-gradient(135deg, #4bbf6a, #12703c); }
.avatar[data-tone="4"] { background: linear-gradient(135deg, #2f9e6f, #0b5c46); }
.avatar[data-tone="5"] { background: linear-gradient(135deg, #37b04a, #0a5a2c); }
[data-theme="dark"] .avatar[data-tone="0"] { background: linear-gradient(135deg, #1d7a3e, #0b3d21); }
[data-theme="dark"] .avatar[data-tone="1"] { background: linear-gradient(135deg, #1c6b60, #0b3a34); }
[data-theme="dark"] .avatar[data-tone="2"] { background: linear-gradient(135deg, #27682f, #10331c); }
[data-theme="dark"] .avatar[data-tone="3"] { background: linear-gradient(135deg, #2a7340, #0f3f24); }
[data-theme="dark"] .avatar[data-tone="4"] { background: linear-gradient(135deg, #1c6044, #0a3428); }
[data-theme="dark"] .avatar[data-tone="5"] { background: linear-gradient(135deg, #21682f, #0c3a1b); }

/* a photo-backed avatar sits flush inside the ring */
.avatar.has-photo { border-color: var(--brand-2); }
.avatar.has-photo::after { background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .28)); mix-blend-mode: normal; }

/* ------------------------------------------------------------
   15. BLOG ARCHIVE
   ------------------------------------------------------------ */
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1rem; }
.post-card .read-more { margin-top: 0; }
.post-foot .read-more { font-size: .88rem; }
.pill-count { display: inline-block; margin-left: .35rem; font: 700 .68rem/1 var(--fx-mono); opacity: .65; }
[data-theme="dark"] .post-foot .mono-label { color: var(--muted); }

/* ------------------------------------------------------------
   16. HERO CODE WINDOW — live typing
   ------------------------------------------------------------ */
.hero .code-window { transition: box-shadow .8s ease; cursor: pointer; }
.hero .code-window.cw-typing { box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 0 90px rgba(var(--brand-rgb), .18); }
.hero .code-window.cw-done { box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 0 120px rgba(var(--brand-rgb), .26); }

.code-window .cw-title {
  margin-left: .7rem; color: #7d93ab; font: 600 .72rem/1 var(--fx-mono);
  letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.code-window .cw-status { margin-left: auto; font: 600 .68rem/1 var(--fx-mono); color: #6ee7a0; opacity: .9; }
.code-window .cw-status.ok { color: #ffd24d; }
.code-window .cw-status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4rem; vertical-align: 1px; }
.code-window.cw-typing .cw-status::before { animation: fx-pulse 1.1s infinite; }

.code-window .cw-body { display: flex; align-items: flex-start; }
.code-window .cw-gutter {
  flex: 0 0 auto; min-width: 1.5rem; margin: 1.25rem 0 0 1.15rem; text-align: right;
  font: 600 12px/24px var(--fx-mono); color: #33465c; user-select: none;
}
.code-window .cw-gutter div { animation: cw-num .35s var(--fx-ease) both; }
@keyframes cw-num { from { opacity: 0; transform: translateY(5px); } }
.code-window .cw-code { flex: 1; min-width: 0; }
.code-window .cw-body pre { margin: 0; padding: 1.25rem 1.5rem 1.5rem .9rem; }

.cw-caret {
  display: inline-block; width: .55em; height: 1.02em; margin-left: 2px;
  vertical-align: -.16em; border-radius: 2px;
  background: #6ee7a0; box-shadow: 0 0 10px rgba(110, 231, 160, .85);
  animation: cw-blink 1.05s steps(1) infinite;
}
@keyframes cw-blink { 50% { opacity: 0; } }

/* the float chips pop once the code has "saved" (class lands on the hero) */
.hero .float-chip { opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .55s ease, transform .55s var(--fx-ease); }
.hero.hero-code-done .float-chip { opacity: 1; transform: none; }
.hero.hero-code-done .float-chip.c2 { transition-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  .hero .float-chip { opacity: 1; transform: none; }
  .cw-caret { animation: none; }
}

/* Stats card straddling the join between "What We Do" and the flagship build.
   The card is half-over the section above and half-over the section below, and
   both sections keep the same clear space around it, so it reads as one divider
   between them rather than a strip bolted onto either one. */
#services { padding-bottom: 7rem; }
#work { padding-top: 7rem; }
.stats-inflow { margin-top: -4rem; padding: 0; border: 0; }
.stats-inflow::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: color-mix(in srgb, var(--muted) 28%, transparent); z-index: -1; }
.stats-inflow .stats-card { margin-bottom: -4rem; position: relative; z-index: 1; }
@media (max-width: 767.98px) {
  #services { padding-bottom: 9rem; }
  #work { padding-top: 9rem; }
  .stats-inflow { margin-top: -6.5rem; }
  .stats-inflow .stats-card { margin-bottom: -6.5rem; padding: 1.1rem .5rem; position: relative; z-index: 1; }
  .stats-inflow .stat { padding: .2rem .35rem; }
  .stats-inflow .stat .num { font-size: clamp(1.5rem, 7.5vw, 1.9rem); }
  .stats-inflow .stat .lbl { font-size: .8rem; }
}
