:root {
  --bg: #080808;
  --bg-soft: #111111;
  --card: #171717;
  --card-soft: #1c1c1c;
  --ink: #f6f7f9;
  --ink-soft: #a0a4ab;
  --ink-dim: #6c6f76;
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);

  --cyan: #00b7c8;
  --cyan-deep: #007e9b;
  --violet: #7a3fa1;
  --rose: #b44c89;
  --orange: #ff9f1c;
  --yellow: #ffc12c;

  --gradient: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 55%, var(--orange) 100%);
  --gradient-soft: linear-gradient(120deg, rgba(0,183,200,0.18) 0%, rgba(122,63,161,0.18) 55%, rgba(255,159,28,0.18) 100%);
  --accent-solid: #4a5fb8;
  --accent-solid-hover: #5a6fd1;

  --radius: 24px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 36px -18px rgba(0,0,0,0.65);
  --shadow-hover: 0 1px 0 rgba(255,255,255,0.06) inset, 0 28px 54px -20px rgba(0,0,0,0.75);
  font-family: "Manrope", "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before, body::after {
  content: "";
  position: fixed;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}
body::before {
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  top: -260px;
  left: -200px;
}
body::after {
  background: radial-gradient(circle, var(--orange), transparent 70%);
  bottom: -280px;
  right: -220px;
}

main, header, footer { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, .stat-num, .step-index {
  font-family: "Space Grotesk", "Manrope", system-ui, sans-serif;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Topbar (floating bento bar, part of the mosaic flow) ---------- */
.topbar {
  position: sticky;
  top: 16px;
  z-index: 50;
  margin: 16px 0 0;
  background: rgba(23,23,23,0.78);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.topbar__inner {
  padding: 8px 10px 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.topnav {
  display: flex;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
}
.topnav a {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s;
}
.topnav a:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.topbar__cta {
  background: var(--accent-solid);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(74,95,184,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.topbar__cta:hover { transform: translateY(-1px); background: var(--accent-solid-hover); box-shadow: 0 10px 26px -6px rgba(74,95,184,0.55); }

@media (max-width: 860px) {
  .topnav { display: none; }
}

/* ---------- Section heading ---------- */
.section { padding: 64px 0; }
.section--cta { padding: 8px 0; }
.section--tight { padding: 16px 0 8px; }
.section-tight-gap { padding: 8px 0; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient);
}
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--ink);
}
.section-head p {
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Bento base ---------- */
.bento {
  display: grid;
  gap: 16px;
}
.cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  color: var(--ink);
}
.cell::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.16;
  top: -110px;
  right: -110px;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
}
.cell:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.cell:hover::before { opacity: 0.26; }

.cell--dark {
  background: linear-gradient(160deg, #1a1a1a, #0d0d0d);
  border-color: rgba(255,255,255,0.16);
}
.cell--dark::before { background: var(--gradient); opacity: 0.16; width: 320px; height: 320px; }
.cell--dark .pill { background: rgba(255,255,255,0.1); color: var(--ink); }

.cell--teal { border-color: rgba(0,183,200,0.32); }
.cell--teal::before { background: radial-gradient(circle, var(--cyan), transparent 70%); }
.cell--coral { border-color: rgba(255,159,28,0.30); }
.cell--coral::before { background: radial-gradient(circle, var(--orange), transparent 70%); }
.cell--violet { border-color: rgba(155,90,210,0.40); }
.cell--violet::before { background: radial-gradient(circle, #9b5ad2, transparent 70%); }
.cell--amber { border-color: rgba(255,193,44,0.32); }
.cell--amber::before { background: radial-gradient(circle, var(--yellow), transparent 70%); }
.cell--noshadow { box-shadow: none; }

/* Color variants get a stronger, always-on glow so the grid reads as colorful, not just on hover */
.cell--teal::before, .cell--coral::before, .cell--violet::before, .cell--amber::before {
  width: 320px;
  height: 320px;
  opacity: 0.34;
}
.cell--teal:hover::before, .cell--coral:hover::before, .cell--violet:hover::before, .cell--amber:hover::before {
  opacity: 0.5;
}
.cell--teal::after, .cell--coral::after, .cell--violet::after, .cell--amber::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255,255,255,0.05), transparent 55%);
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  color: var(--ink-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 24px;
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
  position: relative;
  z-index: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--accent-solid);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(74,95,184,0.55);
}
.btn--primary:hover { background: var(--accent-solid-hover); box-shadow: 0 14px 30px -8px rgba(74,95,184,0.6); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn--ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); }
.btn--light { background: #fff; color: #0b0b0c; }
.btn--on-dark { background: #fff; color: #0b0b0c; }
.btn--on-dark:hover { filter: brightness(0.95); }

/* ---------- Hero ---------- */
.hero-grid {
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(120px, auto);
}
.hero-grid .cell--main { grid-column: span 4; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; padding: 44px; }
.hero-grid .cell--logo { grid-column: span 2; grid-row: span 2; display: flex; align-items: center; justify-content: center; overflow: visible; }
.hero-grid .cell--stat { grid-column: span 2; }

/* Wow intro: cards fade and rise into place.
   Previously used a 3D rotateX/scale tilt, but that transform can get stuck
   mid-animation when the browser throttles/pauses animations (tab visibility
   changes, viewport resize), leaving a card visibly offset and overlapping
   the content below it. A simple fade+rise can't get stuck like that, so it's
   used for all viewports, not just mobile. */
.hero-grid > .cell {
  opacity: 0;
  transform: translateY(32px);
  animation: card-intro 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-grid > .cell:nth-child(1) { animation-delay: 0.05s; }
.hero-grid > .cell:nth-child(2) { animation-delay: 0.15s; }
.hero-grid > .cell:nth-child(3) { animation-delay: 0.25s; }
.hero-grid > .cell:nth-child(4) { animation-delay: 0.32s; }
@keyframes card-intro {
  to { opacity: 1; transform: translateY(0); }
}
/* Safety net: if the animation gets paused/canceled by the browser before
   completing (e.g. tab backgrounded during load), JS removes the animation
   classes after a timeout and this forces the final, non-overlapping state. */
.hero-grid > .cell.intro-done {
  opacity: 1;
  transform: none;
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero-grid > .cell { animation: none; opacity: 1; transform: none; }
}

.hero-grid .cell--main h1 {
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero-grid .cell--main h1 em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-grid .cell--main p {
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 560px;
  margin: 0 0 26px;
}
.hero-grid .cell--main strong { color: var(--ink); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.logo-orb {
  width: 108px;
  height: 108px;
  border-radius: 28px;
  background: radial-gradient(circle at 30% 30%, rgba(0,183,200,0.35), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(255,159,28,0.3), transparent 60%),
              var(--card-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: orb-drift 7s ease-in-out infinite;
}
.logo-orb img { width: 62px; height: 62px; border-radius: 16px; position: relative; z-index: 1; }
@keyframes orb-drift {
  0%, 100% { background-position: 0% 0%, 100% 100%, 0 0; }
  50% { background-position: 20% 20%, 80% 80%, 0 0; }
}

.hero-network {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-network__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hero-network__lines line {
  stroke: rgba(255,255,255,0.16);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  animation: hero-line-flow 6s linear infinite;
}
@keyframes hero-line-flow {
  to { stroke-dashoffset: -200; }
}
.hero-node {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transform: translate(-50%, -50%);
  animation: hero-node-float 5s ease-in-out infinite;
  z-index: 1;
}
.hero-node svg { width: 18px; height: 18px; }
.hero-node {
  cursor: default;
  transition: transform 0.3s ease, border-color 0.2s ease, color 0.2s ease;
}
.hero-node::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0d0d0d;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
}
.hero-node::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #0d0d0d;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  rotate: 45deg;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
}
/* Each .hero-node is its own stacking context (z-index: 1), so its ::after
   tooltip (z-index: 3) only stacks above content *inside that node* — once
   the tooltip overflows the node's box, a later sibling node (same z-index: 1,
   later in paint order) draws over it. Bumping the whole node's z-index on
   hover/focus lifts the node and its tooltip together above every sibling. */
.hero-node:hover,
.hero-node:focus-visible,
.hero-node.is-tapped { z-index: 5; }
.hero-node:hover { border-color: var(--border-strong); color: var(--ink); }
.hero-node:hover::after,
.hero-node:focus-visible::after,
.hero-node.is-tapped::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.hero-node:hover::before,
.hero-node:focus-visible::before,
.hero-node.is-tapped::before { opacity: 1; }
.hero-node:nth-of-type(2) { animation-delay: 0.4s; }
.hero-node:nth-of-type(3) { animation-delay: 0.8s; }
.hero-node:nth-of-type(4) { animation-delay: 1.2s; }
.hero-node:nth-of-type(5) { animation-delay: 1.6s; }
.hero-node:nth-of-type(6) { animation-delay: 2s; }
@keyframes hero-node-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 6px)); }
}
.hero-network .logo-orb { position: relative; z-index: 2; }

.stat-num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; color: var(--ink); }

.pain-card--hero { display: flex; flex-direction: column; justify-content: center; text-decoration: none; }
.pain-card--hero h3 { font-size: 16px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -0.005em; color: var(--ink); font-family: "Manrope", sans-serif; font-weight: 700; }
.pain-card--hero .pain-card__link { font-size: 13px; font-weight: 700; border-bottom: 1px solid currentColor; padding-bottom: 1px; align-self: flex-start; position: relative; z-index: 1; }
.stat-label { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid .cell--main { grid-column: span 2; grid-row: auto; }
  .hero-grid .cell--logo { grid-column: span 2; grid-row: auto; min-height: 160px; }
  .hero-grid .cell--stat { grid-column: span 1; }
  .hero-grid .pain-card--hero { grid-column: span 2; }
}

/* ---------- Pains / self-identification ---------- */
.pains-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .pains-grid { grid-template-columns: repeat(2, 1fr); } }
.pain-card { display: flex; flex-direction: column; text-decoration: none; }
.pain-card h3 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; letter-spacing: -0.01em; color: var(--ink); }
.pain-card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 18px; flex: 1; position: relative; z-index: 1; }
.pain-card__link { font-size: 13.5px; font-weight: 700; border-bottom: 1px solid currentColor; padding-bottom: 1px; align-self: flex-start; position: relative; z-index: 1; }
@media (max-width: 800px) { .pains-grid { grid-template-columns: 1fr; } }

/* ---------- Format pick ---------- */
.format-grid { grid-template-columns: repeat(2, 1fr); }
.format-grid .cell { padding: 36px; }
.format-grid h3 { font-size: 23px; margin: 0 0 10px; letter-spacing: -0.01em; color: var(--ink); position: relative; z-index: 1; }
.format-grid .audience { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 18px; position: relative; z-index: 1; }
.format-grid ul { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 9px; position: relative; z-index: 1; }
.format-grid li { font-size: 14.5px; display: flex; gap: 9px; align-items: flex-start; }
.format-grid li::before { content: "✦"; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; flex: none; margin-top: 1px; font-size: 12px; }
@media (max-width: 800px) { .format-grid { grid-template-columns: 1fr; } }

/* ---------- Cases ---------- */
.case-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; grid-auto-flow: dense; }
.case-grid .cell--big { grid-column: span 2; grid-row: span 2; }
.case-grid .cell--big h3 { font-size: 24px; margin: 14px 0 16px; letter-spacing: -0.01em; color: var(--ink); position: relative; z-index: 1; }
.case-fact { margin-bottom: 14px; position: relative; z-index: 1; }
.case-fact dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 3px; }
.case-fact dd { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 14px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}
.case-grid .cell h3.small-title { font-size: 18px; margin: 12px 0 10px; color: var(--ink); position: relative; z-index: 1; }
.case-grid .summary { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 12px; position: relative; z-index: 1; }
.case-grid .summary strong { color: var(--ink); }
@media (max-width: 900px) {
  .case-grid { grid-template-columns: 1fr; }
  .case-grid .cell--big { grid-column: 1; grid-row: auto; }
}

/* ---------- Services ---------- */
.services-grid { grid-template-columns: repeat(3, 1fr); }
.services-grid .cell h3 { font-size: 19px; margin: 12px 0 10px; letter-spacing: -0.01em; color: var(--ink); position: relative; z-index: 1; }
.services-grid .cell .num {
  font-size: 13px; font-weight: 800; position: relative; z-index: 1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.services-grid p.problem { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 14px; position: relative; z-index: 1; }
.services-grid ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; position: relative; z-index: 1; }
.services-grid li { font-size: 13.5px; line-height: 1.5; padding-left: 16px; position: relative; color: var(--ink-soft); }
.services-grid li::before { content: "—"; position: absolute; left: 0; color: var(--ink-dim); }
.services-grid .more { font-size: 13.5px; font-weight: 700; border-bottom: 1px solid currentColor; padding-bottom: 1px; position: relative; z-index: 1; color: var(--ink); }
@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

/* ---------- Products ---------- */
.products-grid { grid-template-columns: repeat(3, 1fr); }
.products-grid .cell { display: flex; flex-direction: column; }
.products-grid h3 { font-size: 20px; margin: 0 0 10px; color: var(--ink); position: relative; z-index: 1; }
.products-grid .pitch { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 16px; position: relative; z-index: 1; }
.products-grid .format-tag { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 16px; position: relative; z-index: 1; }
.products-grid .format-tag span { display: block; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; margin-bottom: 3px; color: var(--ink-dim); }
.products-grid dl { margin: 0 0 20px; flex: 1; position: relative; z-index: 1; }
.products-grid .meta-row { margin-bottom: 10px; }
.products-grid dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-dim); margin-bottom: 2px; }
.products-grid dd { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 900px) { .products-grid { grid-template-columns: 1fr; } }

/* ---------- Process ---------- */
.process-grid { grid-template-columns: repeat(5, 1fr); }
.process-grid .cell { padding: 24px 22px; }
.process-grid .step-index {
  font-size: 30px; font-weight: 700; margin-bottom: 10px; position: relative; z-index: 1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0.85;
}
.process-grid h3 { font-size: 16.5px; margin: 0 0 12px; color: var(--ink); position: relative; z-index: 1; }
.process-grid .role { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--cyan); display: block; margin-bottom: 3px; position: relative; z-index: 1; }
.process-grid .role.client { color: var(--orange); }
.process-grid p.line { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 12px; position: relative; z-index: 1; }
@media (max-width: 1000px) { .process-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .process-grid { grid-template-columns: 1fr; } }

/* ---------- Blog ---------- */
.blog-grid { grid-template-columns: repeat(3, 1fr); }
.blog-grid .cell--big { grid-column: span 2; }
.blog-grid h3 { font-size: 19px; margin: 12px 0 10px; letter-spacing: -0.01em; color: var(--ink); position: relative; z-index: 1; }
.blog-grid .excerpt { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 16px; position: relative; z-index: 1; }
.blog-grid .tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-dim); position: relative; z-index: 1; }
.blog-grid .read { font-size: 13.5px; font-weight: 700; border-bottom: 1px solid currentColor; padding-bottom: 1px; position: relative; z-index: 1; color: var(--ink); }
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr; } .blog-grid .cell--big { grid-column: 1; } }

/* ---------- FAQ ---------- */
.faq-grid { grid-template-columns: repeat(2, 1fr); }
.faq-grid h3 { font-size: 17px; margin: 0 0 10px; letter-spacing: -0.01em; color: var(--ink); position: relative; z-index: 1; }
.faq-grid p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; position: relative; z-index: 1; }
@media (max-width: 800px) { .faq-grid { grid-template-columns: 1fr; } }

/* ---------- True bento mosaic: real CSS Grid, dense-packed, zero leftover cells ---------- */
/* Cases: 3 cols × 4 rows = 12 cells exactly. 1 big(2×2=4) + 2 wide(2×1=4) + 4 small(1×1=4) = 12. */
.case-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; grid-auto-flow: row; align-items: stretch; }
.case-grid .cell--wide { grid-column: span 2; }
.case-grid .cell { display: flex; flex-direction: column; }
.case-grid .cell .result-chip { margin-top: auto; align-self: flex-start; }
.case-grid .cell--big dl { flex: 1; }

/* Explicit placement (desktop): dense auto-flow can fragment when wide cards can't
   find two adjacent free cells, leaving holes. Pin every card to a known cell instead. */
@media (min-width: 901px) {
  #case-automation { grid-column: 1 / 3; grid-row: 1 / 3; }
  #case-social { grid-column: 3; grid-row: 1; }
  #case-voice { grid-column: 3; grid-row: 2; }
  #case-bodycam { grid-column: 1 / 3; grid-row: 3; }
  #case-calls { grid-column: 3; grid-row: 3; }
  #case-ecommerce { grid-column: 1 / 3; grid-row: 4; }
  #case-erp { grid-column: 3; grid-row: 4; }
}
@media (max-width: 900px) {
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid .cell--big { grid-column: span 2; }
  .case-grid .cell--wide { grid-column: span 2; }
}
@media (max-width: 600px) {
  .case-grid { grid-template-columns: 1fr; }
  .case-grid .cell--big, .case-grid .cell--wide { grid-column: 1; grid-row: auto; }
}

/* Blog: big spans full width row alone (zero risk of row mismatch), remaining 2 fill row 2 evenly. */
.blog-grid { grid-template-columns: repeat(2, 1fr); align-items: stretch; }
.blog-grid .cell--big { grid-column: span 2; }
@media (max-width: 700px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-grid .cell--big { grid-column: 1; }
}

/* Pains / Format / Services / Products / Process / FAQ already tile exactly (card count is a
   multiple of the column count), so plain CSS Grid with align-items:stretch keeps every row's
   height equal automatically — no masonry needed, no gaps, no offsets. */
.pains-grid, .format-grid, .services-grid, .products-grid, .process-grid, .faq-grid {
  align-items: stretch;
}

/* ---------- Full-width banner link (e.g. "Переглянути всі кейси") ---------- */
.cell--banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 18px 28px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.cell--banner svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
.cell--banner:hover svg { transform: translateX(4px); }
.cell--banner::before { width: 220px; height: 220px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* ---------- Final CTA ---------- */
.final-cta {
  background: linear-gradient(180deg, #131313, #0a0a0a);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 32px;
  padding: 56px;
  position: relative;
  overflow: hidden;
}
.final-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  padding: 1px;
  background: var(--gradient);
  opacity: 0.5;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.final-cta::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(0,183,200,0.3), transparent 70%);
  top: -200px;
  right: -150px;
  pointer-events: none;
}
.final-cta__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; position: relative; z-index: 1; }
.final-cta h2 { font-size: clamp(28px, 3.2vw, 38px); margin: 0 0 18px; letter-spacing: -0.02em; line-height: 1.12; position: relative; color: var(--ink); }
.final-cta h2 span { display: block; color: var(--ink-soft); font-weight: 600; font-size: 0.6em; margin-top: 8px; font-family: "Manrope", sans-serif; }
.final-cta p.lead { color: var(--ink-soft); font-size: 16px; max-width: 480px; line-height: 1.6; margin: 0 0 28px; position: relative; }
.final-cta ul.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.final-cta ul.trust li { font-size: 13.5px; color: var(--ink-soft); padding-left: 20px; position: relative; }
.final-cta ul.trust li::before { content: "✓"; position: absolute; left: 0; color: var(--cyan); font-weight: 700; }

.lead-form {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.lead-form label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.lead-form input, .lead-form textarea {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  resize: vertical;
}
.lead-form input::placeholder, .lead-form textarea::placeholder { color: var(--ink-dim); }
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: var(--cyan); }
.lead-form__consent {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 9px !important;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-dim);
  cursor: pointer;
}
.lead-form__consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  accent-color: var(--cyan);
  cursor: pointer;
}
.lead-form__consent a { color: var(--ink-soft); text-decoration: underline; }
.lead-form__consent a:hover { color: var(--cyan); }
.lead-form__submit { width: 100%; margin-top: 4px; border: none; cursor: pointer; }

/* ---------- Phone field with country code picker ---------- */
.phone-field { display: flex; gap: 8px; position: relative; }
.phone-field__code {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease;
}
.phone-field__code:hover, .phone-field__code:focus { outline: none; border-color: var(--cyan); }
.phone-field__code svg { width: 14px; height: 14px; opacity: 0.7; flex: none; }
.phone-field__flag { font-size: 15px; line-height: 1; }
.phone-field #phoneNumber { flex: 1; min-width: 0; }
.phone-field__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  max-height: 240px;
  overflow-y: auto;
  background: #0d0d0d;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  margin: 0;
  list-style: none;
  z-index: 30;
  box-shadow: var(--shadow-hover);
}
.phone-field__list li {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.phone-field__list li:hover { background: rgba(255,255,255,0.07); color: var(--ink); }
@media (max-width: 860px) { .final-cta__grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .final-cta { padding: 28px 18px; }
  .lead-form { background: none; border: none; padding: 0; gap: 16px; }
}

/* ---------- Catalog (all cases page) ---------- */
.catalog-h {
  grid-column: 1 / -1;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 28px 0 4px;
  color: var(--ink);
}
.catalog-grid .catalog-h:first-child { margin-top: 0; }
.catalog-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.catalog-grid .cell { padding: 22px; display: flex; flex-direction: column; }
.catalog-grid h4 { font-size: 15px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.005em; color: var(--ink); position: relative; z-index: 1; }
.catalog-grid p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 12px; position: relative; z-index: 1; }
.catalog-grid .card-result { margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.4; position: relative; z-index: 1; }

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; position: relative; z-index: 1; }
.tag-chip {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.08);
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
}

/* ---------- Filter bar ---------- */
.filter-bar-wrap {
  position: sticky;
  top: 73px;
  z-index: 40;
  background: var(--bg);
  padding: 4px 0 18px;
  margin-bottom: 8px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.filter-btn.active { background: var(--accent-solid); color: #fff; border-color: transparent; }
@media (max-width: 1100px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .catalog-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { padding: 8px 0 32px; }
.footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr; margin-bottom: 24px; align-items: stretch; }
.footer-grid .cell { display: flex; flex-direction: column; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--ink-soft); font-size: 14px; line-height: 1.55; max-width: 280px; margin: 0 0 16px; position: relative; z-index: 1; }
.footer-brand .btn { align-self: flex-start; margin-top: auto; position: relative; z-index: 1; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 14px; color: var(--ink-dim); font-family: "Manrope", sans-serif; font-weight: 700; position: relative; z-index: 1; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; position: relative; z-index: 1; }
.footer-col a { font-size: 14px; color: var(--ink-soft); }
.footer-col a:hover { color: var(--ink); }
.footer-col span { font-size: 14px; color: var(--ink-soft); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-dim); }
.footer-bottom ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.footer-bottom a:hover { color: var(--ink); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Mobile spacing ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .section { padding: 40px 0; }
  .section--tight { padding: 12px 0 5px; }
  .section-tight-gap { padding: 5px 0; }
  .section-head { margin-bottom: 24px; }
  .bento { gap: 10px; }
  .cell { padding: 20px; }
  .hero-grid .cell--main { padding: 28px; }
  .topbar { margin: 10px 0 0; top: 10px; }
}
