/* ============================================================
   MAZELOGICS — "Engineered blueprint at night"
   Signature: the pathfinding solve. Boldness lives there;
   everything else stays quiet and drafted.
   ============================================================ */

:root {
  --f-display: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --trace: #4fe3c1;      /* the solved-path signal — used ONLY for path & active */
  --trace-dim: #2f7d70;
  --line-blue: #4f7cf0;  /* structural blueprint line */
  --amber: #ffb35c;      /* human / outcome, sparingly */

  --gap: clamp(72px, 9vw, 128px);
  --e: cubic-bezier(.22,.68,0,1);
}

:root, [data-theme="light"] {
  color-scheme: light;
  --on-trace: #ffffff;
  --trace: #2f7de0;       /* light-blue signal in daylight */
  --trace-dim: #7aa6e8;
  --line-blue: #5c7ca8;   /* steel grey-blue structure */
  --ink: #dde4ee;         /* blue-grey drafting paper */
  --ink-raise: #eef2f8;
  --ink-2: #d0d9e7;
  --line: #aebdd2;
  --line-soft: #c0cbdd;
  --chalk: #1a2436;
  --slate: #46536e;
  --slate-dim: #71809c;
  --grid: rgba(60,90,140,.10);
  --grid-strong: rgba(60,90,140,.16);
  --shadow: 0 20px 44px rgba(30,50,90,.16);
  --warn: #c02f1d;
}
[data-theme="light"] ::selection { background: rgba(47,125,224,.25); }
[data-theme="light"] .mark::after { background: linear-gradient(transparent 62%, rgba(47,125,224,.28) 62%); }
[data-theme="light"] .btn:hover { box-shadow: 0 10px 26px rgba(47,125,224,.35); }
[data-theme="light"] .wp.on .wp-node::before { box-shadow: 0 0 14px rgba(47,125,224,.45); }
[data-theme="light"] .rule { box-shadow: 0 0 8px rgba(47,125,224,.6); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--ink);
  color: var(--chalk);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(79,227,193,.28); }
:focus-visible { outline: 2px solid var(--trace); outline-offset: 3px; border-radius: 3px; }

/* ---------- blueprint paper background ---------- */
.paper {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 30%, transparent 85%);
}
.rule { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 60; background: var(--trace); box-shadow: 0 0 10px var(--trace); }

/* AI signals routing along the grid, site-wide */
.ai-bg { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- universal interactivity: cursor spotlight ---------- */
[data-ia] { position: relative; overflow: hidden; }
[data-ia] .spot {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity .35s;
  background: radial-gradient(190px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--trace) 13%, transparent), transparent 72%);
}
[data-ia]:hover .spot { opacity: 1; }
@media (pointer: coarse) { [data-ia] .spot { display: none; } }

.chip.on { border-color: var(--trace); color: var(--trace); }
.chip.on i { background: var(--trace); }
.stat { cursor: pointer; transition: background .25s; }
.stat:hover { background: var(--ink-2); }
.wp { cursor: default; }
.wp:hover .wp-node::before { border-color: var(--trace); }
.solve-stage { cursor: pointer; }

/* ---------- layout ---------- */
.wrap { width: min(1200px, 92%); margin-inline: auto; position: relative; z-index: 1; }
.wrap.narrow { width: min(820px, 92%); }
.center { text-align: center; }
.section { padding-block: var(--gap); position: relative; z-index: 1; }
.band { background: var(--ink-2); border-block: 1px solid var(--line-soft); }
main, .footer { position: relative; z-index: 1; }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; }
.mono { font-family: var(--f-mono); font-weight: 400; }

.lede { max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.lede-h { font-size: clamp(2rem, 4.3vw, 3.1rem); }
.lede-p { color: var(--slate); font-size: clamp(1rem, 1.35vw, 1.14rem); margin-top: 18px; max-width: 62ch; }

/* eyebrow = drafting annotation with a route tick */
.eyebrow, .tag {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--trace);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before, .tag::before {
  content: ''; width: 22px; height: 8px; flex-shrink: 0;
  border-left: 2px solid var(--trace); border-bottom: 2px solid var(--trace);
  border-bottom-left-radius: 3px;
}

/* the "mark" — a trace underline drawn beneath key words (no gradient text) */
.mark { position: relative; white-space: nowrap; color: var(--chalk); }
.mark::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -.06em; height: .5em;
  background: linear-gradient(transparent 62%, rgba(79,227,193,.32) 62%);
  border-radius: 2px;
}
@media (max-width: 640px) { .mark { white-space: normal; } }

/* drafting corner brackets */
.brackets { position: relative; }
.brackets::before, .brackets::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--trace); opacity: .8;
}
.brackets::before { top: 9px; left: 9px; border-top: 2px solid; border-left: 2px solid; border-top-left-radius: 3px; }
.brackets::after { bottom: 9px; right: 9px; border-bottom: 2px solid; border-right: 2px solid; border-bottom-right-radius: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 10px;
  font-family: var(--f-display); font-weight: 600; font-size: .94rem;
  background: var(--trace); color: var(--on-trace);
  border: 1px solid var(--trace);
  transition: transform .3s var(--e), box-shadow .3s, background .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(79,227,193,.28); }
.btn-line { background: transparent; color: var(--chalk); border-color: var(--line); }
.btn-line:hover { border-color: var(--trace); box-shadow: none; }
.btn-sm { padding: 11px 16px; font-size: .86rem; }
.ghost-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--chalk); transition: border-color .25s, color .25s;
}
.ghost-btn:hover { border-color: var(--trace); color: var(--trace); }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--ink); display: grid; place-items: center; transition: opacity .7s, visibility .7s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; gap: 20px; justify-items: center; color: var(--line-blue); }
.ld-mark { width: 88px; height: 88px; animation: markIn .9s .1s var(--e) both; }
@keyframes markIn { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.loader-word { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .3em; color: var(--slate-dim); }
.dots { animation: blink 1.2s steps(3,end) infinite; }
@keyframes blink { 0%{opacity:.2} 50%{opacity:1} }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: background .35s, border-color .35s; border-bottom: 1px solid transparent; }
.nav.on { background: color-mix(in srgb, var(--ink) 78%, transparent); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 26px; height: 70px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand-logo { display: block; height: 32px; width: auto; }
.foot-logo .brand-logo { height: 34px; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: 8px; font-size: .9rem; color: var(--slate); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--chalk); background: var(--ink-raise); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.burger { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; }
.burger span { width: 17px; height: 2px; background: var(--chalk); transition: transform .3s, opacity .3s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(36px, 5vw, 72px);
  align-items: center; padding-top: clamp(130px, 15vw, 180px); padding-bottom: var(--gap);
}
.hero-copy { animation: rise .9s .1s var(--e) both; }
.tag { margin-bottom: 22px; }
.hero-h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); font-weight: 700; letter-spacing: -.03em; }
.hero-sub { color: var(--slate); font-size: clamp(1.02rem, 1.5vw, 1.2rem); max-width: 52ch; margin: 26px 0 32px; }
.hero-actions { display: flex; gap: 13px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }
.hero-note { margin-top: 30px; font-family: var(--f-mono); font-size: .82rem; color: var(--slate-dim); }
.hero-note b { color: var(--trace); font-weight: 500; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

/* SIGNATURE — the solve panel */
.solve {
  border: 1px solid var(--line); border-radius: 16px; background: var(--ink-raise);
  padding: 14px; box-shadow: var(--shadow);
  animation: rise 1s .35s var(--e) both;
}
.solve-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; color: var(--slate-dim); font-size: .72rem; }
.solve-head .live { color: var(--trace); display: inline-flex; align-items: center; gap: 7px; }
.solve-head .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--trace); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(79,227,193,.5);} 50%{ box-shadow: 0 0 0 7px rgba(79,227,193,0);} }
.solve-stage { position: relative; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; background: var(--ink-2); aspect-ratio: 4 / 3; }
#mazeCanvas { width: 100%; height: 100%; }
.solve-label { position: absolute; font-family: var(--f-mono); font-size: .64rem; letter-spacing: .08em; color: var(--slate-dim); background: color-mix(in srgb, var(--ink-2) 82%, transparent); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-soft); }
.solve-label.in { top: 12px; left: 12px; }
.solve-label.out { bottom: 12px; right: 12px; color: var(--trace); border-color: var(--trace-dim); }
.solve figcaption { padding: 12px 6px 4px; color: var(--slate-dim); font-size: .74rem; line-height: 1.5; }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 14px; background: var(--ink-raise); overflow: hidden; }
.stat { padding: 22px 18px; border-right: 1px solid var(--line-soft); }
.stat:last-child { border-right: none; }
.stat-n { display: block; font-family: var(--f-display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.stat-l { display: block; margin-top: 4px; font-size: .68rem; color: var(--slate-dim); letter-spacing: .05em; }

/* ============================================================
   PHILOSOPHY — transform ledger
   ============================================================ */
.transform { display: grid; gap: 12px; margin-top: 44px; }
.tf {
  display: grid; grid-template-columns: 1fr auto 1.2fr; align-items: center; gap: clamp(16px, 4vw, 48px);
  padding: 24px clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 12px; background: var(--ink-raise);
  transition: border-color .3s;
}
.tf:hover { border-color: var(--trace-dim); }
.tf-from { font-family: var(--f-display); font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--slate); text-decoration: line-through; text-decoration-color: var(--slate-dim); text-decoration-thickness: 1px; }
.tf-to { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.15rem, 2.2vw, 1.6rem); color: var(--chalk); }
/* the arrow is a right-angle trace, echoing the maze route */
.tf-arrow { position: relative; width: clamp(40px, 6vw, 76px); height: 20px; flex-shrink: 0; }
.tf-arrow::before { content: ''; position: absolute; inset: 9px 12px auto 0; height: 2px; background: var(--trace); border-radius: 2px; }
.tf-arrow::after { content: ''; position: absolute; right: 6px; top: 4px; width: 10px; height: 10px; border-top: 2px solid var(--trace); border-right: 2px solid var(--trace); transform: rotate(45deg); }

/* ============================================================
   EXPERTISE chips
   ============================================================ */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink-raise);
  font-size: .9rem; display: inline-flex; align-items: center; gap: 9px;
  transition: border-color .25s, transform .25s, color .25s;
}
.chip:hover { border-color: var(--trace); transform: translateY(-3px); }
.chip i { width: 6px; height: 6px; border-radius: 1px; background: var(--line-blue); transform: rotate(45deg); flex-shrink: 0; transition: background .25s; }
.chip:hover i { background: var(--trace); }

/* ============================================================
   SOLUTIONS
   ============================================================ */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 32px; }
.filter { padding: 9px 17px; border: 1px solid var(--line); border-radius: 9px; font-size: .85rem; color: var(--slate); font-family: var(--f-mono); transition: all .25s; }
.filter:hover { color: var(--chalk); border-color: var(--slate-dim); }
.filter.on { background: var(--trace); color: var(--on-trace); border-color: var(--trace); }
.sol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sol {
  position: relative; padding: 26px 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--ink-raise);
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.sol::before { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 2px; background: var(--trace); transition: width .45s var(--e); }
.sol:hover { border-color: var(--trace-dim); transform: translateY(-4px); }
.sol:hover::before { width: 100%; }
.sol.hide { display: none; }
.sol-ico { font-size: 1.4rem; }
.sol h3 { font-size: 1.04rem; font-weight: 600; }
.sol p { color: var(--slate); font-size: .88rem; flex: 1; }
.sol-out { font-family: var(--f-mono); font-size: .7rem; color: var(--trace); display: inline-flex; gap: 7px; align-items: center; }
.sol-out::before { content: '→'; }

/* ============================================================
   SAAS split
   ============================================================ */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(40px, 5vw, 72px); align-items: center; }
.split-copy .lede-h { margin-top: 14px; }
.spec { list-style: none; margin: 26px 0 30px; display: grid; gap: 13px; }
.spec li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: baseline; color: var(--slate); font-size: .93rem; }
.spec .mono { color: var(--trace); font-size: .74rem; letter-spacing: .04em; }

.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--ink-raise); padding: 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; color: var(--slate-dim); font-size: .72rem; margin-bottom: 18px; }
.dots-3 { display: inline-flex; gap: 5px; }
.dots-3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.panel-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.pk { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; background: var(--ink-2); }
.pk .mono { display: block; font-size: .64rem; color: var(--slate-dim); text-transform: uppercase; letter-spacing: .05em; }
.pk b { font-family: var(--f-display); font-size: 1.15rem; }
.pk span { font-size: .68rem; }
.up { color: var(--trace); } .flat { color: var(--slate-dim); }
.bars { display: flex; align-items: flex-end; gap: 7px; height: 120px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--ink-2); }
.bars span { flex: 1; height: var(--h); border-radius: 4px 4px 1px 1px; background: linear-gradient(to top, var(--trace-dim), var(--trace)); transform-origin: bottom; animation: grow 1s var(--e) backwards; }
.bars span:nth-child(2n) { animation-delay: .1s; } .bars span:nth-child(3n) { animation-delay: .2s; }
@keyframes grow { from { transform: scaleY(0); } }

/* ============================================================
   SERVICES tabs
   ============================================================ */
.tabs { display: flex; gap: 8px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 20px; font-family: var(--f-display); font-weight: 600; font-size: .92rem; color: var(--slate); position: relative; }
.tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--trace); transform: scaleX(0); transition: transform .3s var(--e); }
.tab:hover { color: var(--chalk); }
.tab.on { color: var(--chalk); }
.tab.on::after { transform: scaleX(1); }
.svc-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.svc { padding: 20px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--ink-raise); transition: border-color .25s, transform .25s; animation: rise .5s var(--e) both; }
.svc:hover { border-color: var(--trace-dim); transform: translateY(-3px); }
.svc b { display: block; font-family: var(--f-display); font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.svc span { font-size: .78rem; color: var(--slate-dim); }

/* ============================================================
   PRODUCTS rail
   ============================================================ */
.rail-wrap { margin-top: 12px; }
.rail { display: flex; gap: 14px; overflow-x: auto; scroll-behavior: smooth; padding: 8px calc((100vw - min(1200px, 92vw)) / 2) 22px; scrollbar-width: none; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.drag { cursor: grabbing; scroll-behavior: auto; }
.prod { flex: 0 0 290px; padding: 26px 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--ink-raise); display: flex; flex-direction: column; gap: 11px; transition: border-color .3s, transform .3s; }
.prod:hover { border-color: var(--trace-dim); transform: translateY(-5px); }
.prod-ico { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; font-size: 1.3rem; background: var(--ink-2); border: 1px solid var(--line); }
.prod h3 { font-size: 1.02rem; }
.prod p { color: var(--slate); font-size: .87rem; flex: 1; }
.prod-tag { font-family: var(--f-mono); font-size: .68rem; color: var(--trace); letter-spacing: .04em; }
.rail-nav { display: flex; gap: 9px; justify-content: flex-end; }
.rail-btn { width: 44px; height: 44px; font-size: 1.05rem; }

/* ============================================================
   INDUSTRIES
   ============================================================ */
.ind-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ind { padding: 20px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--ink-raise); display: flex; align-items: center; gap: 12px; transition: border-color .25s, transform .25s; }
.ind:hover { border-color: var(--trace); transform: translateY(-3px); }
.ind span { font-size: 1.25rem; }
.ind b { font-family: var(--f-display); font-weight: 600; font-size: .92rem; }

/* ============================================================
   WHY — ledger (no fake numbering)
   ============================================================ */
.ledger { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lg { display: grid; grid-template-columns: 240px 1fr; gap: clamp(16px, 3vw, 40px); padding: 26px clamp(20px, 3vw, 34px); border-bottom: 1px solid var(--line-soft); background: var(--ink-raise); transition: background .25s; }
.lg:last-child { border-bottom: none; }
.lg:hover { background: var(--ink-2); }
.lg-k { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; display: flex; align-items: flex-start; gap: 12px; }
.lg-k::before { content: ''; margin-top: 8px; width: 8px; height: 8px; flex-shrink: 0; border-radius: 1px; background: var(--trace); transform: rotate(45deg); }
.lg-v { color: var(--slate); font-size: .93rem; }

/* ============================================================
   PROCESS — the route
   ============================================================ */
.route { position: relative; max-width: 860px; margin-inline: auto; padding-left: 4px; }
.route::before { content: ''; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 2px; background: var(--line); }
.route-fill { position: absolute; left: 27px; top: 28px; width: 2px; background: var(--trace); box-shadow: 0 0 8px var(--trace); height: 0; transition: height .1s linear; }
.wp { display: grid; grid-template-columns: 56px 1fr; gap: 22px; padding: 16px 0; position: relative; }
.wp-node { width: 56px; height: 56px; display: grid; place-items: center; position: relative; z-index: 1; }
.wp-node::before { content: ''; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--ink-raise); transform: rotate(45deg); transition: all .35s var(--e); }
.wp-node span { position: relative; font-family: var(--f-mono); font-size: .78rem; color: var(--slate-dim); transition: color .35s; }
.wp.on .wp-node::before { border-color: var(--trace); background: var(--trace); box-shadow: 0 0 16px rgba(79,227,193,.5); }
.wp.on .wp-node span { color: var(--on-trace); font-weight: 500; }
.wp-body { padding-top: 12px; }
.wp-body h3 { font-size: 1.05rem; }
.wp-body p { color: var(--slate); font-size: .89rem; margin-top: 4px; max-width: 58ch; }

/* ============================================================
   CASES
   ============================================================ */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.case { padding: 28px 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink-raise); display: flex; flex-direction: column; gap: 13px; transition: border-color .3s, box-shadow .3s; }
.case:hover { border-color: var(--trace-dim); box-shadow: var(--shadow); }
.case-loc { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--line-blue); }
.case h3 { font-size: 1.22rem; }
.case p { color: var(--slate); font-size: .9rem; flex: 1; }
.case-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.case-nums b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; color: var(--trace); }
.case-nums span { font-size: .68rem; color: var(--slate-dim); line-height: 1.35; display: block; margin-top: 2px; }

/* ============================================================
   STACK
   ============================================================ */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack-col { padding: 24px 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--ink-raise); }
.stack-col h3 { font-family: var(--f-mono); font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--trace); margin-bottom: 15px; }
.stack-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.st { padding: 6px 12px; border: 1px solid var(--line-soft); border-radius: 7px; font-size: .78rem; background: var(--ink-2); color: var(--slate); transition: color .2s, border-color .2s; }
.st:hover { color: var(--trace); border-color: var(--trace-dim); }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quote { padding: 28px 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink-raise); display: flex; flex-direction: column; gap: 20px; transition: border-color .3s; }
.quote:hover { border-color: var(--trace-dim); }
.quote blockquote { color: var(--chalk); font-size: .95rem; flex: 1; position: relative; padding-left: 18px; }
.quote blockquote::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px; background: var(--trace); border-radius: 2px; }
.quote figcaption { display: flex; gap: 12px; align-items: center; }
.qa { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: .82rem; background: var(--ink-2); border: 1px solid var(--line); color: var(--trace); flex-shrink: 0; }
.quote figcaption b { display: block; font-family: var(--f-display); font-size: .9rem; }
.quote figcaption i { font-style: normal; font-size: .75rem; color: var(--slate-dim); }

/* ============================================================
   FAQ
   ============================================================ */
.faq { display: grid; gap: 10px; }
.qa-item { border: 1px solid var(--line); border-radius: 11px; background: var(--ink-raise); overflow: hidden; transition: border-color .25s; }
.qa-item.open { border-color: var(--trace-dim); }
.qa-q { width: 100%; text-align: left; padding: 19px 22px; display: flex; justify-content: space-between; gap: 16px; align-items: center; font-family: var(--f-display); font-weight: 600; font-size: 1rem; }
.qa-plus { flex-shrink: 0; width: 18px; height: 18px; position: relative; }
.qa-plus::before, .qa-plus::after { content: ''; position: absolute; background: var(--trace); border-radius: 2px; transition: transform .3s var(--e); }
.qa-plus::before { inset: 8px 0; height: 2px; }
.qa-plus::after { inset: 0 8px; width: 2px; }
.qa-item.open .qa-plus::after { transform: scaleY(0); }
.qa-a { max-height: 0; overflow: hidden; transition: max-height .4s var(--e); }
.qa-a p { padding: 0 22px 20px; color: var(--slate); font-size: .92rem; max-width: 68ch; }

/* ============================================================
   CTA
   ============================================================ */
.cta { background: var(--ink-2); border-top: 1px solid var(--line-soft); overflow: hidden; position: relative; }
.cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(ellipse 50% 60% at 50% 118%, rgba(79,227,193,.16), transparent 70%);
}
.cta-h { font-size: clamp(2.1rem, 4.8vw, 3.4rem); margin-top: 16px; }
.cta-p { margin-inline: auto; margin-top: 20px; }
.hero-actions.center { margin-top: 34px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink); border-top: 1px solid var(--line); padding-top: 64px; }
.foot-top { display: grid; grid-template-columns: 1.1fr 2fr; gap: 56px; padding-bottom: 44px; }
.foot-brand p { color: var(--slate); font-size: .89rem; margin: 16px 0 20px; max-width: 42ch; }
.social { display: flex; gap: 9px; }
.social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--slate); transition: all .25s; }
.social a:hover { border-color: var(--trace); color: var(--trace); transform: translateY(-2px); }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.foot-col h4 { font-family: var(--f-mono); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--slate-dim); margin-bottom: 14px; }
.foot-col a { display: block; padding: 4px 0; color: var(--slate); font-size: .88rem; transition: color .2s, transform .2s; }
.foot-col a:hover { color: var(--trace); transform: translateX(3px); }
.foot-news p { color: var(--slate); font-size: .84rem; margin-bottom: 13px; }
.news { display: flex; gap: 7px; }
.news input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink-raise); color: var(--chalk); font: inherit; font-size: .84rem; outline: none; transition: border-color .25s; }
.news input:focus { border-color: var(--trace); }
.news-ok { color: var(--trace); font-size: .84rem; margin-top: 9px; }
.foot-bottom { border-top: 1px solid var(--line-soft); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--slate-dim); }
.foot-bottom a { margin-left: 20px; transition: color .2s; }
.foot-bottom a:hover { color: var(--trace); }

/* ============================================================
   CHATBOT
   ============================================================ */
.bot { position: fixed; bottom: 24px; right: 24px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.bot-fab { width: 56px; height: 56px; border-radius: 14px; background: var(--ink-raise); border: 1px solid var(--line); color: var(--line-blue); display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .3s var(--e), border-color .3s; }
.bot-fab:hover { transform: translateY(-3px); border-color: var(--trace); }
.fab-mark { width: 28px; height: 28px; }
.bot-panel { width: min(360px, calc(100vw - 36px)); height: 470px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--ink-raise); box-shadow: var(--shadow); animation: rise .35s var(--e); }
.bot-head { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--line-soft); }
.bot-av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); }
.bot-av img { width: 26px; height: 26px; display: block; }
.bot-head b { display: block; font-family: var(--f-display); font-size: .9rem; }
.bot-head i { font-style: normal; font-size: .68rem; color: var(--slate-dim); }
.bot-x { margin-left: auto; color: var(--slate-dim); padding: 6px; }
.bot-x:hover { color: var(--chalk); }
.bot-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 12px; font-size: .85rem; line-height: 1.5; animation: rise .3s var(--e); }
.bot-msg { background: var(--ink-2); border: 1px solid var(--line-soft); align-self: flex-start; border-bottom-left-radius: 3px; }
.user-msg { background: var(--trace); color: var(--on-trace); align-self: flex-end; border-bottom-right-radius: 3px; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--slate-dim); margin-right: 3px; animation: typing 1s infinite; }
.typing span:nth-child(2){animation-delay:.15s} .typing span:nth-child(3){animation-delay:.3s}
@keyframes typing { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.bot-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bot-chips button { padding: 8px 12px; border-radius: 8px; font-size: .76rem; border: 1px solid var(--trace-dim); color: var(--trace); transition: all .2s; }
.bot-chips button:hover { background: var(--trace); color: var(--on-trace); }
.bot-input { display: flex; gap: 7px; padding: 12px; border-top: 1px solid var(--line-soft); }
.bot-input input { flex: 1; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink-2); color: var(--chalk); font: inherit; font-size: .85rem; outline: none; }
.bot-input input:focus { border-color: var(--trace); }
.bot-input button[type="submit"] { width: 40px; height: 40px; border-radius: 9px; background: var(--trace); color: var(--on-trace); display: grid; place-items: center; flex-shrink: 0; }

/* ============================================================
   REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--e), transform .8s var(--e); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   CONSULTATION MODAL
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
/* the scrim is what blurs the page behind the dialog */
.modal-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 62%, transparent); backdrop-filter: blur(9px); animation: fadeIn .25s var(--e); }
.modal-card { position: relative; width: min(660px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 34px 34px 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--ink-raise); box-shadow: var(--shadow); animation: rise .35s var(--e); }
@keyframes fadeIn { from { opacity: 0; } }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--slate); transition: color .2s, background .2s; }
.modal-x:hover { color: var(--chalk); background: var(--ink-2); }
.modal-h { font-size: 1.5rem; margin-top: 14px; }
.modal-intro { color: var(--slate); font-size: .9rem; line-height: 1.6; margin-top: 10px; }

.modal form { margin-top: 24px; display: grid; gap: 15px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .8rem; font-weight: 500; color: var(--chalk); }
.req { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--trace); margin-left: 5px; }
.field input, .field textarea { width: 100%; padding: 11px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink-2); color: var(--chalk); font: inherit; font-size: .88rem; outline: none; transition: border-color .25s; }
.field textarea { resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: var(--slate-dim); }
.field input:focus, .field textarea:focus { border-color: var(--trace); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--warn); }
.f-legend { font-size: .8rem; font-weight: 500; color: var(--chalk); margin-top: 4px; }
.err { color: var(--warn); font-size: .78rem; line-height: 1.45; }
.err-form { margin-top: 2px; }
.modal-actions { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 8px; }

/* the accent is applied to the icon and heading only — setting it on the
   container makes .btn inherit it, and its own colour resolves to inherit */
.modal-ok { text-align: center; padding: 16px 0 4px; }
.modal-ok > svg { margin: 0 auto; color: var(--trace); }
.modal-ok .modal-h { color: var(--trace); }
.modal-ok .modal-intro { text-align: center; margin-inline: auto; max-width: 42ch; }
.modal-ok .modal-actions { justify-content: center; }
.modal-fallback { font-size: .82rem; }
.modal-fallback a { color: var(--trace); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 560px) {
  .modal-card { padding: 30px 20px 24px; }
  .f-row { grid-template-columns: 1fr; }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page { padding-top: calc(70px + clamp(40px, 7vw, 84px)); }
.contact-h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.contact-grid { display: grid; grid-template-columns: minmax(260px, 5fr) 7fr; gap: clamp(28px, 4vw, 56px); margin-top: clamp(36px, 5vw, 64px); align-items: start; }
.contact-info { display: grid; gap: 30px; }
.ci-h { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--trace); }
.ci-block p { color: var(--slate); font-size: .9rem; line-height: 1.65; margin-top: 9px; }
.ci-mail { display: inline-block; margin-top: 9px; font-family: var(--f-display); font-weight: 600; font-size: 1.12rem; color: var(--chalk); border-bottom: 2px solid var(--trace); padding-bottom: 2px; transition: color .2s; }
.ci-mail:hover { color: var(--trace); }
.ci-steps { margin-top: 12px; display: grid; gap: 14px; padding-left: 0; list-style: none; counter-reset: step; }
.ci-steps li { position: relative; padding-left: 40px; color: var(--slate); font-size: .9rem; line-height: 1.6; counter-increment: step; }
.ci-steps li b { color: var(--chalk); }
.ci-steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--f-mono); font-size: .72rem; color: var(--trace); border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; background: var(--ink-raise); }
.contact-card { padding: clamp(24px, 3.4vw, 40px); border: 1px solid var(--line); border-radius: 18px; background: var(--ink-raise); box-shadow: var(--shadow); }
.contact-card form { margin-top: 24px; display: grid; gap: 15px; }
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-info { order: 2; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .solve { max-width: 560px; }
  .split { grid-template-columns: 1fr; }
  .sol-grid, .cases, .quotes { grid-template-columns: repeat(2, 1fr); }
  .svc-list, .stack { grid-template-columns: repeat(3, 1fr); }
  .ind-grid { grid-template-columns: repeat(3, 1fr); }
  .foot-top { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 1100px) {
  .nav-links { position: fixed; inset: 70px 0 auto 0; flex-direction: column; padding: 16px 4%; background: color-mix(in srgb, var(--ink) 94%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform .35s var(--e); z-index: 99; }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 12px; font-size: 1rem; }
  .burger { display: flex; }
  .nav-actions .btn { display: none; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(5) { grid-column: 1 / -1; border-right: none; }
  .tf { grid-template-columns: 1fr; gap: 10px; text-align: left; }
  .tf-arrow { transform: rotate(90deg); margin: 4px 0; }
  .sol-grid, .cases, .quotes, .svc-list, .stack, .ind-grid { grid-template-columns: 1fr; }
  .spec li { grid-template-columns: 1fr; gap: 3px; }
  .lg { grid-template-columns: 1fr; gap: 8px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .ind-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .foot-cols { grid-template-columns: 1fr; }
  .ind-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
