/* ============================================================
   NxGen — Infinite Canvas
   ============================================================ */

:root,
:root[data-theme="dark"] {
  --bg: #08080b;
  --bg-2: #0d0d12;
  --surface: #111117;
  --surface-2: #16161e;
  --surface-3: #1c1c26;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededf0;
  --text-2: #b8b8c2;
  --text-dim: #6e6e7a;
  --accent: #87ffa3;
  --accent-2: #00d4ff;
  --accent-warm: #ff8a5b;
  --gradient: linear-gradient(135deg, #87ffa3 0%, #00d4ff 100%);
  --gradient-warm: linear-gradient(135deg, #ff8a5b 0%, #ff4d8d 100%);

  /* Themed surfaces / glows */
  --feature-bg: linear-gradient(160deg, #0d2820 0%, #0a0e1a 60%);
  --feature-border: rgba(135, 255, 163, 0.18);
  --feature-glow: rgba(135, 255, 163, 0.18);
  --contact-bg: linear-gradient(160deg, #1a1212 0%, #0e0a16 60%);
  --contact-border: rgba(255, 138, 91, 0.18);
  --contact-glow: rgba(255, 138, 91, 0.18);
  --api-bg: linear-gradient(160deg, #0a2818 0%, #0a0e1a 60%);
  --api-border: rgba(74, 222, 128, 0.22);
  --api-glow: rgba(74, 222, 128, 0.22);
  --accent-api: #4ade80;
  --ma-bg: linear-gradient(160deg, #161028 0%, #0c0a14 60%);
  --ma-border: rgba(183, 139, 255, 0.20);
  --ma-glow: rgba(183, 139, 255, 0.20);
  --accent-violet: #b78bff;
  --bi-bg: linear-gradient(160deg, #2a2110 0%, #14110a 60%);
  --bi-border: rgba(255, 213, 102, 0.22);
  --bi-glow: rgba(255, 213, 102, 0.22);
  --accent-amber: #ffd966;
  --sap-bg: linear-gradient(160deg, #0a2030 0%, #0a0e1a 60%);
  --sap-border: rgba(95, 180, 240, 0.22);
  --sap-glow: rgba(95, 180, 240, 0.22);
  --accent-sap: #5fb4f0;
  --tile-glow: rgba(255, 255, 255, 0.04);
  --visual-bg: #0a0a0e;
  --noise-blend: overlay;
  --noise-opacity: 0.6;

  /* CTA */
  --cta-bg: #ededf0;
  --cta-text: #08080b;
  --cta-bg-hover: #87ffa3;

  /* Cursor mix */
  --cursor-blend: difference;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --cell-w: 360px;
  --cell-h: 260px;
  --gap: 14px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  --bg: #f5f5f1;
  --bg-2: #fbfbf7;
  --surface: #ffffff;
  --surface-2: #f6f6f1;
  --surface-3: #ededea;
  --border: rgba(8, 8, 11, 0.08);
  --border-strong: rgba(8, 8, 11, 0.18);
  --text: #08080b;
  --text-2: #4a4a52;
  --text-dim: #88888f;
  --accent: #00a878;
  --accent-2: #0091c0;
  --accent-warm: #d35932;
  --gradient: linear-gradient(135deg, #00a878 0%, #0091c0 100%);
  --gradient-warm: linear-gradient(135deg, #d35932 0%, #d63a6f 100%);

  --feature-bg: linear-gradient(160deg, #e3f7ec 0%, #f4faff 60%);
  --feature-border: rgba(0, 168, 120, 0.30);
  --feature-glow: rgba(0, 168, 120, 0.20);
  --contact-bg: linear-gradient(160deg, #fdeee5 0%, #fbf6f0 60%);
  --contact-border: rgba(211, 89, 50, 0.30);
  --contact-glow: rgba(211, 89, 50, 0.20);
  --api-bg: linear-gradient(160deg, #e0f5e7 0%, #f0fcf3 60%);
  --api-border: rgba(22, 163, 74, 0.30);
  --api-glow: rgba(22, 163, 74, 0.20);
  --accent-api: #16a34a;
  --ma-bg: linear-gradient(160deg, #efe7fb 0%, #f5f0fc 60%);
  --ma-border: rgba(120, 75, 220, 0.30);
  --ma-glow: rgba(120, 75, 220, 0.20);
  --accent-violet: #784bdc;
  --bi-bg: linear-gradient(160deg, #fcf3dc 0%, #fdf8ec 60%);
  --bi-border: rgba(180, 132, 46, 0.30);
  --bi-glow: rgba(180, 132, 46, 0.20);
  --accent-amber: #b48230;
  --sap-bg: linear-gradient(160deg, #def0fc 0%, #f0f7fc 60%);
  --sap-border: rgba(0, 113, 175, 0.30);
  --sap-glow: rgba(0, 113, 175, 0.20);
  --accent-sap: #0071af;
  --tile-glow: rgba(8, 8, 11, 0.05);
  --visual-bg: #f0f0eb;
  --noise-blend: multiply;
  --noise-opacity: 0.35;

  --cta-bg: #08080b;
  --cta-text: #f5f5f1;
  --cta-bg-hover: #00a878;

  --cursor-blend: difference;
}

/* Smooth color transitions when toggling theme */
:root,
.tile,
.nav,
.cta,
.recenter,
.theme-toggle,
.tile-arrow {
  transition: background-color 0.4s var(--ease),
              color 0.4s var(--ease),
              border-color 0.4s var(--ease);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

body {
  cursor: none;
  position: relative;
}

a, button {
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: none;
}

/* ============================================================
   Background ambience — radial glow + grain
   ============================================================ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 1200px 800px at 20% 20%, rgba(135, 255, 163, 0.06), transparent 60%),
    radial-gradient(ellipse 1000px 800px at 80% 80%, rgba(0, 212, 255, 0.05), transparent 60%),
    radial-gradient(ellipse 800px 600px at 60% 30%, rgba(255, 138, 91, 0.03), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: var(--noise-blend);
  opacity: var(--noise-opacity);
}

/* ============================================================
   Top bar
   ============================================================ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  padding: 6px 8px;
  margin: -6px -8px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 4px;
  background: rgba(17, 17, 23, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: 999px;
  padding: 6px;
}

.nav a {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: 999px;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

.cta:hover {
  background: var(--cta-bg-hover);
  transform: translateY(-1px);
}

.cta svg {
  transition: transform 0.3s var(--ease);
}

.cta:hover svg {
  transform: translateX(3px);
}

/* Theme toggle */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(127, 127, 138, 0.1);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: color 0.3s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  background: rgba(127, 127, 138, 0.18);
  border-color: var(--border-strong);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   Cursor
   ============================================================ */

.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              border-color 0.25s var(--ease), background 0.25s var(--ease),
              opacity 0.25s var(--ease);
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 4px;
  height: 4px;
  background: var(--text);
  border-radius: 50%;
  mix-blend-mode: difference;
}

.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  border-color: var(--accent);
  background: rgba(135, 255, 163, 0.06);
}

.cursor-ring.is-drag {
  width: 70px;
  height: 70px;
  border-color: var(--accent-2);
  background: rgba(0, 212, 255, 0.08);
}

@media (hover: none), (pointer: coarse) {
  .cursor-ring,
  .cursor-dot {
    display: none;
  }
  body, a, button {
    cursor: auto;
  }
}

/* ============================================================
   Canvas + Grid
   ============================================================ */

.canvas {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 2;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.canvas.is-dragging {
  cursor: none;
}

.grid {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.supercell {
  position: absolute;
  top: 0;
  left: 0;
}

/* ============================================================
   Tiles
   ============================================================ */

.tile {
  position: absolute;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px;
  transition: border-color 0.4s var(--ease), transform 0.5s var(--ease),
              background 0.4s var(--ease);
  will-change: transform;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    var(--tile-glow),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.tile:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.tile:hover::before {
  opacity: 1;
}

.tile-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: auto;
}

.tile-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-top: 16px;
}

.tile-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

.tile-arrow {
  margin-top: auto;
  align-self: flex-end;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease),
              color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.tile:hover .tile-arrow {
  transform: translate(2px, -2px) rotate(-12deg);
  background: var(--text);
  color: #0a0a0a;
  border-color: var(--text);
}

/* ---------- Hero tile ---------- */

.tile.hero {
  background: var(--bg-2);
  border-color: var(--border);
  padding: 36px;
  justify-content: space-between;
}

.tile.hero .hero-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tile.hero .hero-mark::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.tile.hero h1 {
  font-size: clamp(56px, 7vw, 96px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin-bottom: 18px;
}

.tile.hero h1 .accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  font-weight: 400;
}

.tile.hero p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 80%;
}

/* ---------- Tagline tile ---------- */

.tile.tagline {
  background: var(--bg-2);
}

.tile.tagline p {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
  font-weight: 400;
  margin: auto 0;
}

.tile.tagline p em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* ---------- Service tiles ---------- */

.tile.service {
  display: flex;
  flex-direction: column;
}

.tile.service .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: auto;
}

/* ---------- Feature tile (Power BI) ---------- */

.tile.feature {
  background: var(--feature-bg);
  border-color: var(--feature-border);
}

.tile.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at 80% 0%,
    var(--feature-glow),
    transparent 50%
  );
  pointer-events: none;
}

.tile.feature .tile-eyebrow {
  color: var(--accent);
}

.tile.feature .tile-title {
  font-size: 38px;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 2;
}

.tile.feature .tile-body {
  position: relative;
  z-index: 2;
  color: rgba(237, 237, 240, 0.85);
}

/* ---------- Quote tile ---------- */

.tile.quote {
  background: var(--bg-2);
  justify-content: space-between;
}

.tile.quote .quote-mark {
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 0.7;
  color: var(--accent);
  font-weight: 300;
  margin-bottom: 4px;
}

.tile.quote blockquote {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 400;
  font-style: italic;
}

.tile.quote cite {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-style: normal;
  margin-top: 16px;
  display: block;
}

/* ---------- Industries tile ---------- */

.tile.industries {
  display: flex;
  flex-direction: column;
}

.tile.industries .industry-list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: var(--text);
}

.tile.industries .industry-list span {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-mono);
  margin-right: 6px;
  margin-bottom: 6px;
  color: var(--text-2);
  transition: all 0.3s var(--ease);
}

.tile.industries:hover .industry-list span {
  border-color: rgba(135, 255, 163, 0.4);
  color: var(--text);
}

/* ---------- Approach tile ---------- */

.tile.approach {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
}

.tile.approach .steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile.approach .step {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  transition: padding-left 0.4s var(--ease);
}

.tile.approach:hover .step {
  padding-left: 8px;
}

.tile.approach .step:last-child {
  border-bottom: 1px solid var(--border);
}

.tile.approach .step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  width: 28px;
  flex-shrink: 0;
  letter-spacing: 0.1em;
}

.tile.approach .step-name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.tile.approach .step-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: auto;
}

/* ---------- Metrics tile ---------- */

.tile.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  gap: 0;
  padding: 0;
  background: var(--surface);
}

.tile.metrics .m-header {
  grid-column: span 2;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}

.tile.metrics .m-cell {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}

.tile.metrics .m-cell:nth-child(even) {
  border-right: none;
}

.tile.metrics .m-cell:nth-last-child(-n+2) {
  border-bottom: none;
}

.tile.metrics .m-cell:hover {
  background: var(--surface-2);
}

.tile.metrics .m-value {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tile.metrics .m-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 12px;
}

/* ---------- Contact tile ---------- */

.tile.contact {
  background: var(--contact-bg);
  border-color: var(--contact-border);
  justify-content: space-between;
  overflow: hidden;
}

.tile.contact::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    500px circle at 0% 100%,
    var(--contact-glow),
    transparent 50%
  );
  pointer-events: none;
}

.tile.contact .tile-eyebrow {
  color: var(--accent-warm);
  position: relative;
  z-index: 2;
}

.tile.contact h3 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.tile.contact .contact-info {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.tile.contact a,
.tile.contact span {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tile.contact a:hover {
  color: var(--accent-warm);
}

/* ---------- Visual / animated tile ---------- */

.tile.visual {
  background: var(--bg-2);
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  justify-content: space-between;
}

.visual-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.visual-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.visual-kpi-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.visual-kpi-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.visual-kpi-value {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  transition: opacity 0.4s var(--ease);
}

.visual-kpi-delta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.visual-spark-wrap {
  width: calc(100% + 48px);
  margin: 0 -24px;
  height: 80px;
  position: relative;
}

.visual-spark {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.visual-spark-line {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4));
}

.visual-spark-area { stroke: none; opacity: 0.85; }

.visual-spark-dot {
  filter: drop-shadow(0 0 6px var(--accent-2));
}

.visual-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  gap: 14px;
}

.visual-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.visual-mini-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.visual-mini-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

.visual-mini-delta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-left: 6px;
}

.visual-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-align: right;
  text-transform: uppercase;
}
.visual-foot strong { color: var(--text-2); font-weight: 500; }

/* ---------- Badge tile ---------- */

.tile.badge {
  background: var(--bg-2);
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px;
}

.tile.badge .b-top {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile.badge .b-bottom {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.tile.badge .b-bottom small {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-top: 6px;
}

/* ---------- Arrow tile ---------- */

.tile.arrow {
  background: var(--accent);
  color: #08080b;
  display: grid;
  place-items: center;
  border: none;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease);
}

.tile.arrow:hover {
  background: var(--accent-2);
  color: #f5f5f1;
}

.tile.arrow svg {
  width: 48px;
  height: 48px;
  transition: transform 0.4s var(--ease);
}

.tile.arrow:hover svg {
  transform: rotate(-15deg) scale(1.1);
}

/* ---------- SAP feature tile (SAP Business One) ---------- */

.tile.sap {
  background: var(--sap-bg);
  border-color: var(--sap-border);
}

.tile.sap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at 80% 0%,
    var(--sap-glow),
    transparent 50%
  );
  pointer-events: none;
}

.tile.sap .tile-eyebrow {
  color: var(--accent-sap);
}

.tile.sap .tile-title {
  font-size: 38px;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 2;
}

.tile.sap .tile-body {
  position: relative;
  z-index: 2;
}

/* ---------- BI feature tile (Microsoft Power BI) ---------- */

.tile.bi {
  background: var(--bi-bg);
  border-color: var(--bi-border);
}

.tile.bi::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at 80% 0%,
    var(--bi-glow),
    transparent 50%
  );
  pointer-events: none;
}

.tile.bi .tile-eyebrow {
  color: var(--accent-amber);
}

.tile.bi .tile-title {
  font-size: 38px;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 2;
}

.tile.bi .tile-body,
.tile.bi .api-list {
  position: relative;
  z-index: 2;
}

.tile.bi .api-list span {
  border: 1px solid var(--bi-border);
  color: var(--text-2);
}

/* ---------- API feature tile (Custom API Development) ---------- */

.tile.api {
  background: var(--api-bg);
  border-color: var(--api-border);
}

.tile.api::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at 80% 100%,
    var(--api-glow),
    transparent 50%
  );
  pointer-events: none;
}

.tile.api .tile-eyebrow {
  color: var(--accent-api);
}

.tile.api .tile-title {
  font-size: 38px;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 2;
}

.tile.api .tile-body,
.tile.api .api-list {
  position: relative;
  z-index: 2;
}

.tile.api .api-list {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tile.api .api-list span {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid var(--api-border);
  border-radius: 999px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

/* ---------- Integrated Services tile (4x1 wide) ---------- */

.tile.integrated {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
}

.tile.integrated .int-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 20px;
}

.tile.integrated .int-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.tile.integrated .int-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.tile.integrated .int-item {
  padding: 18px 16px 4px 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tile.integrated .int-item:nth-child(2n) {
  border-right: 1px solid var(--border);
  padding-left: 16px;
}

.tile.integrated .int-item:last-child {
  border-right: none;
  padding-right: 0;
}

.tile.integrated .int-item-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.tile.integrated .int-item-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.tile.integrated .int-item-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ---------- M&A feature tile (4x2 wide) ---------- */

.tile.ma {
  background: var(--ma-bg);
  border-color: var(--ma-border);
}

.tile.ma::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    700px circle at 100% 0%,
    var(--ma-glow),
    transparent 50%
  );
  pointer-events: none;
}

.tile.ma .tile-eyebrow {
  color: var(--accent-violet);
  position: relative;
  z-index: 2;
}

.tile.ma .tile-title {
  font-size: 46px;
  letter-spacing: -0.035em;
  position: relative;
  z-index: 2;
  max-width: 60%;
  margin-top: 14px;
  line-height: 1;
}

.tile.ma .tile-body {
  position: relative;
  z-index: 2;
  max-width: 56%;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-2);
}

.tile.ma .ma-pillars {
  margin-top: auto;
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.tile.ma .ma-pillar {
  padding: 0 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile.ma .ma-pillar:first-child { padding-left: 0; }
.tile.ma .ma-pillar:last-child  { padding-right: 0; border-right: none; }

.tile.ma .ma-pillar-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-violet);
}

.tile.ma .ma-pillar-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.tile.ma .ma-pillar-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ---------- Presence tile (global regions) ---------- */

.tile.presence {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  position: relative;
}

.tile.presence .presence-tag {
  position: absolute;
  top: 22px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tile.presence .presence-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.tile.presence .presence-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.tile.presence .presence-region {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  border-right: 1px solid var(--border);
}
.tile.presence .presence-region:first-child { padding-left: 0; }
.tile.presence .presence-region:last-child  { padding-right: 0; border-right: none; }

.tile.presence .presence-code {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.tile.presence .presence-name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-transform: none;
}

/* ---------- Stack tile (replaces marquee) ---------- */

.tile.stack {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.tile.stack .stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tile.stack .stack-list span {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.tile.stack:hover .stack-list span {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Deployment / Stat tile ---------- */

.tile.deploy {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile.deploy .deploy-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.tile.deploy .deploy-list span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tile.deploy .deploy-list span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Closing tagline tile ---------- */

.tile.closing {
  background: var(--gradient);
  color: #08080b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  overflow: hidden;
}

.tile.closing h4 {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 70%;
}

.tile.closing .closing-arrow {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #08080b;
  color: #f5f5f1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease);
}

.tile.closing:hover .closing-arrow {
  transform: rotate(-12deg) scale(1.05);
}

.tile.closing svg {
  width: 22px;
  height: 22px;
}

/* ============================================================
   HUD
   ============================================================ */

.hud {
  position: fixed;
  bottom: 24px;
  left: 28px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-coords {
  gap: 16px;
  color: var(--text-2);
}

.hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

/* Recenter button */

.recenter {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(17, 17, 23, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.3s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease);
}

.recenter:hover {
  color: var(--text);
  background: rgba(28, 28, 38, 0.85);
  border-color: var(--border-strong);
}

.recenter svg {
  transition: transform 0.5s var(--ease);
}

.recenter:hover svg {
  transform: rotate(180deg);
}

/* ============================================================
   First-load hint
   ============================================================ */

.hint {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 30;
  opacity: 1;
  transition: opacity 0.6s var(--ease);
}

.hint.hidden {
  opacity: 0;
}

.hint-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: bob 3s ease-in-out infinite;
}

.hint-inner svg {
  color: var(--accent);
  opacity: 0.8;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --cell-w: 280px;
    --cell-h: 220px;
    --gap: 10px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .nav {
    display: none;
  }

  .cta {
    padding: 9px 14px;
    font-size: 12px;
  }

  .brand {
    font-size: 16px;
  }

  .tile {
    padding: 20px;
  }

  .tile.hero {
    padding: 24px;
  }

  .tile.hero h1 {
    font-size: clamp(40px, 12vw, 64px);
  }

  .tile-title {
    font-size: 22px;
  }

  .tile.feature .tile-title {
    font-size: 28px;
  }

  .hud {
    left: 16px;
    bottom: 16px;
    font-size: 9.5px;
  }

  .recenter {
    right: 16px;
    bottom: 16px;
    padding: 8px 12px;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
