/* ==========================================================================
   RUFEN PREMIUM LIGHT BLUE/ORANGE TECH DESIGN SYSTEM
   ========================================================================== */

/* --- Fonts & Variable System --- */
:root {
  /* The site is designed light-only. Declaring it stops phone browsers in
     dark mode (Chrome on Android, Samsung Internet) from auto-darkening the
     page and shifting its colours away from what desktop shows. */
  color-scheme: light only;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors - Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  
  --text-primary: #0f172a;   /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #94a3b8;     /* Slate 400 */

  /* Rufen Blue and Orange Accents */
  --accent-blue: #0062ff;     /* Royal Electric Blue */
  --accent-orange: #ff6b00;   /* Brand Orange */
  --accent-violet: #7c3aed;   /* Business Experiences / Rufen ExperienceHub, and the customer side of a transcript */
  --accent-green: #10b981;    /* Emerald Green */
  --accent-med: #0f5fa6;      /* Marketing pillar: Mediterranean blue */
  --accent-med-sea: #2a9fd6;  /* its lighter sea tone */
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, var(--accent-blue) 0%, #3b82f6 100%);
  --grad-orange: linear-gradient(135deg, var(--accent-orange) 0%, #ff8c00 100%);
  --grad-dark: linear-gradient(180deg, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0.04) 100%);

  /* UI Tokens */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(15, 23, 42, 0.05);
  --glass-border-hover: rgba(15, 23, 42, 0.12);
  --radius-lg: 12px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.25s ease;
  --surface-solid:#ffffff; --surface-raised:#ffffff; --surface-glass:rgba(255,255,255,.72); --surface-glass-strong:rgba(255,255,255,.85); --surface-sunken:#f8fafc; --band-alt:#f9fbff; --console:#070a13; --hairline:rgba(15,23,42,.06); --hairline-strong:rgba(15,23,42,.12); --tint-1:rgba(15,23,42,.02); --tint-2:rgba(15,23,42,.05); --blue-text:#0062ff; --orange-text:#ff6b00; --green-text:#10b981; --red-text:#ef4444; --violet-text:#7c3aed; --shadow-card:0 4px 20px rgba(15,23,42,.03); --shadow-hover:0 12px 32px rgba(15,23,42,.08); --shadow-pop:0 24px 60px -20px rgba(15,23,42,.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
  max-width: 100%;
}

/* `clip` stops sideways scroll exactly like `hidden`, but unlike `hidden` it
   doesn't turn html/body into scroll containers — which silently disabled
   every position: sticky (the card stacks, the More Services rail, the
   sandbox sidebar). */
@supports (overflow-x: clip) {
  :root,
  html > body {            /* outrank the plain html/body rules around this */
    overflow-x: clip;
  }
}

body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

/* --- Tech Grid Blueprint Background --- */
/* Grid made 15% stronger on 10 Nov 2026 (line alpha 0.02 -> 0.023). */
.tech-grid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.023) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.023) 1px, transparent 1px);
  pointer-events: none;
}

/* --- Ambient Glow Orbs (Soft Light Theme) --- */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}
.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 98, 255, 0.06) 0%, rgba(0,0,0,0) 70%);
  top: -150px;
  right: -100px;
  animation: floatOrb 12s infinite alternate ease-in-out;
}
.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.04) 0%, rgba(0,0,0,0) 70%);
  bottom: 10%;
  left: -150px;
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.03); }
}

/* --- Layout Elements --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

.grid {
  display: grid;
  gap: 24px;
}
.grid-2col { grid-template-columns: 1fr 1fr; }
.grid-3col { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
  .grid-2col, .grid-3col { grid-template-columns: 1fr; }
}

.text-center { text-align: center; }
.w-full { width: 100%; }
.divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.06);
  margin: 20px 0;
}

/* --- Glassmorphism Card System --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03), 0 0 0 1px rgba(15, 23, 42, 0.02);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: var(--grad-dark);
  pointer-events: none;
  z-index: 1;
}

.glass-card > * {
  position: relative;
  z-index: 2;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  gap: 8px;
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 98, 255, 0.15);
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(0, 98, 255, 0.25);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-1.5px);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-md {
  padding: 12px 24px;
  font-size: 0.95rem;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-xs {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* --- Typography Utilities --- */
.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header {
  margin-bottom: 40px;
}
.section-title {
  font-size: 2rem;
  margin-bottom: 8px;
}
.section-subtitle {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* --- Header --- */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100% !important;
  padding: 0 40px !important;
  box-sizing: border-box;
}

/* Shrink header scroll animation */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @keyframes shrinkHeader {
    to {
      height: 60px;
      background: rgba(255, 255, 255, 0.9);
      border-bottom: 1px solid rgba(15, 23, 42, 0.06);
      backdrop-filter: blur(16px);
    }
  }

  #main-header {
    animation: shrinkHeader auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 80px;
  }
}

.header-scrolled {
  height: 60px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(16px) !important;
}

.subpage-header {
  height: 60px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(16px) !important;
  animation: none !important;
}

.logo {
  display: flex;
  align-items: center;
}
.logo-image {
  height: 48px; /* Larger, clearly visible header logo */
  width: auto;
  object-fit: contain;
}
.logo-image.footer-logo {
  height: 40px; /* Balanced footer logo sizing */
}
.logo-text {
  display: none; /* Hidden since the new logo includes the name RUFEN */
}

/* Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  margin: 0;
  cursor: pointer;
  background: rgba(255, 107, 0, 0.06);
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid rgba(255, 107, 0, 0.12);
}
.status-chat-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-orange);
  transition: color 0.3s ease;
  flex-shrink: 0;
}
.status-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-orange);
}

#btn-agent-active {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
#btn-agent-active:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.2);
}
#btn-agent-active:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

@keyframes pulseOrange {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}


/* --- Header fit ladder -----------------------------------------------------
   The header is a three-column flex: .logo and .header-actions are both
   flex: 1 1 0% while .nav-menu is flex: 0 0 auto, so each side column gets
   (viewport - 80 - navWidth) / 2. A wide CTA therefore costs TWICE its width
   in viewport. Measured for the 7-item nav: 797px at gap 28/0.9rem needs
   1341px of viewport, 714px at 20/0.85rem needs 1258px, 643px at 14/0.8rem
   needs 1187px. Below 1200px there is no legible fit, so the drawer takes
   over. Each band carries 12-19px of slack.
   -------------------------------------------------------------------------- */
.nav-menu {
  display: flex;
  gap: 28px;                     /* >= 1360px */
}
.header-actions {
  display: flex;
  align-items: center;
  margin-left: 40px;
  flex-shrink: 0 !important;
  gap: 8px;
}
/* .header-actions is flex-shrink: 0 but the .btn inside it was not, so under
   pressure the CTA silently wrapped to two lines and overlapped the last nav
   link instead of pushing out. Fail visibly instead. */
.header-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 1270px) and (max-width: 1359px) {
  .nav-menu {
    gap: 20px !important;
  }
  .nav-link {
    font-size: 0.85rem !important;
  }
}
@media (min-width: 1200px) and (max-width: 1269px) {
  .nav-menu {
    gap: 14px !important;
  }
  .nav-link {
    font-size: 0.8rem !important;
  }
}

.nav-link {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  white-space: nowrap;
}
/* Only hover changes colour (orange). The current page (.active) keeps its
   normal colour and gets a short neutral underline, so it still reads as
   "you are here". The underline sits under the word, not the caret. */
.nav-link:hover {
  color: var(--accent-orange);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.6;
}

/* Home as a house icon in the bar; the drawer shows the word next to it. */
.nav-home { display: inline-flex; align-items: center; gap: 8px; }
.nav-home svg { width: 17px; height: 17px; }
@media (min-width: 1200px) {
  .nav-home-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-home.active::after { left: 50%; margin-left: -9px; }
}

/* --- Menu groups: Products and Build ----------------------------------------
   A .nav-group is a toggle button (styled as a .nav-link) plus a panel of
   .nav-sub links, each with an icon, a name and a one-line description.
   Desktop: the panel drops down on hover, keyboard focus or click.
   Drawer (below 1200px): the panel folds out in place under its toggle.
   The markup is written by tools/site_chrome.py; app.js toggles .open. */
.nav-group { position: relative; }
.nav-drawer-actions { display: none; }
.nav-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-caret { width: 14px; height: 14px; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-group-toggle:focus-visible,
.nav-sub:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 3px; border-radius: 6px; }

.nav-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px 7px 10px;   /* a little room to the right of the text */
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s ease;
}
/* Dropdown rows. Only hover changes colour: the icon tile takes a light
   orange tint. The current page keeps its colours and gets a small orange
   dot after its name. */
.nav-sub:hover .nav-sub-ico { color: var(--accent-orange); background: rgba(255, 107, 0, 0.1); }
.nav-sub.active .nav-sub-text strong::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
  margin-left: 8px;
  vertical-align: middle;
}
.nav-sub-ico {
  transition: color 0.2s ease, background 0.2s ease;
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(0, 98, 255, 0.08);
  color: var(--accent-blue);
}
.nav-sub-ico svg { width: 13px; height: 13px; }
.nav-sub-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
}
.nav-sub-text small {
  display: block;
  margin-top: 0;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--text-secondary);
}

@media (min-width: 1200px) {
  .nav-group-panel {
    position: absolute;
    top: calc(100% + 8px);   /* tucks a little over the header's bottom edge */
    left: 0;
    width: max-content;          /* hugs its longest row */
    min-width: 240px;
    max-width: 340px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.02);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    /* Closing waits a moment (0.12s) before it fades, so a slow or slightly
       wandering mouse on its way down doesn't lose the menu. Hidden panels
       are never hit-testable (visibility), so nothing reopens from below. */
    transition: opacity 0.2s ease 0.12s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) 0.12s, visibility 0s linear 0.32s;
    z-index: 200;
  }
  /* an invisible bridge over the gap, so moving the mouse down keeps it open.
     It overlaps the tab by a few pixels: an exact fit left a sub-pixel seam
     that a slow mouse could land in, and the menu closed. */
  .nav-group-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 26px; z-index: -1; }
  /* Opens on hover; for keyboard users, when focus is inside it. A mouse
     click doesn't count as keyboard focus, so a click never pins it open. */
  .nav-group:hover .nav-group-panel,
  .nav-group:has(:focus-visible) .nav-group-panel,
  .nav-group.open .nav-group-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 201;                  /* above a neighbour that is still closing */
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
  }
  /* every menu drops down left-aligned under its own tab (panels are slim
     enough that Resources and About still fit on a 1200px screen) */
  .nav-group:hover .nav-caret { transform: rotate(180deg); }
  /* The tab stays orange while its menu is open, also while the pointer is down in the panel */
  .nav-group:hover > .nav-group-toggle,
  .nav-group:has(:focus-visible) > .nav-group-toggle,
  .nav-group.open > .nav-group-toggle { color: var(--accent-orange); }
  /* every row one line high, so the rows are evenly spaced */
  .nav-group-panel .nav-sub-text small { white-space: nowrap; }
}
@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
  .nav-group-panel, .nav-caret { transition: none; }
}

/* --- Engineering: two rows that expand in place ------------------------------
   The drop-down looks like every other menu: two rows, Products and Build.
   Clicking a row (or Enter) slides its list open right under it and closes
   the other one; the chevron turns over and the row's left edge lights
   orange. The open list hangs off a muted tree line. Same in the drawer.
   The collapsed lists still count towards the panel's width, so the panel
   doesn't jump when one opens. app.js toggles .is-open. */
.nav-fly { position: relative; }
.nav-fly-toggle { position: relative; width: 100%; padding-right: 34px; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; align-items: center; }
/* the chevron sits at the same spot on every row, however long the text */
.nav-fly-caret { position: absolute; right: 10px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: var(--text-secondary); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.nav-fly-toggle::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px;
  background: transparent; transition: background 0.2s ease, box-shadow 0.2s ease;
}
.nav-fly.is-open > .nav-fly-toggle::before,
.nav-fly-toggle:focus-visible::before { background: var(--accent-orange); box-shadow: 0 0 8px rgba(255, 107, 0, 0.6); }
.nav-fly.is-open > .nav-fly-toggle .nav-sub-ico { color: var(--accent-orange); background: rgba(255, 107, 0, 0.1); }
.nav-fly.is-open > .nav-fly-toggle .nav-fly-caret { transform: rotate(180deg); }
.nav-fly-panel {
  display: block;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  margin-left: 22px;                       /* the line runs under the row's icon */
  padding-left: 6px;
  border-left: 1px solid rgba(15, 23, 42, 0.1);
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.35s, margin 0.35s ease;
}
/* "inherit", not "visible": an open list must stay hidden while its menu is
   closed. A "visible" child of a hidden panel still catches the mouse, so the
   invisible Products/Build links under the Engineering tab used to reopen the
   menu (and could be clicked) when the pointer passed below it. */
.nav-fly.is-open > .nav-fly-panel { max-height: 480px; opacity: 1; visibility: inherit; margin-top: 2px; margin-bottom: 6px; }
.nav-fly-panel .nav-sub { padding-top: 6px; padding-bottom: 6px; }
@media (min-width: 1200px) {
  .nav-fly:hover > .nav-fly-toggle .nav-sub-ico { color: var(--accent-orange); background: rgba(255, 107, 0, 0.1); }
  .nav-fly-panel .nav-sub-text small { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-fly-panel, .nav-fly-caret { transition: none; }
}



/* The three-column layout only applies where the horizontal nav does. */
@media (min-width: 1200px) {
  .header-container .logo {
    flex: 1 1 0%;
    display: flex;
    justify-content: flex-start;
  }
  .header-container .header-actions {
    flex: 1 1 0%;
    display: flex;
    justify-content: flex-end;
    margin-left: 0 !important;
  }
  .header-container .nav-menu {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 12px !important;
  }
  .header-actions {
    margin-left: 0;
    gap: 6px;
  }
  /* The CTA now survives all the way to the drawer breakpoint (1199px), so it
     is only hidden on phones where the hamburger and SANDBOX need the room. */
  .header-actions .btn {
    display: none !important;
  }
  .logo-image {
    height: 36px;
  }
}

/* --- Expanded Hero Section (Houses canvas, banner, and live stream console) --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 130px;
  padding-bottom: 110px;
  box-sizing: border-box;
}

/* Interactive Background Canvas (Spans entire Hero element height) */
#canvas-interactive-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-centered-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-blue);
}
.hero-badge i {
  width: 12px;
  height: 12px;
}

.badge-bracket,
.badge-dot {
  color: var(--accent-orange);
  font-weight: 700;
}
.badge-brand {
  color: var(--accent-blue);
  font-weight: 700;
}

.hero-text-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px; /* Lock height so typewriter layout does not shift button positions */
  margin-bottom: 96px; /* Pushes buttons lower as requested */
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero-actions .btn {
  width: 320px;
  justify-content: center;
  text-align: center;
}
@media (max-width: 768px) {
  .hero-section {
    /* the stable (small) viewport height: 100dvh grew as the phone's address bar slid away mid-scroll,
       pushing the whole page down, which felt like a snap (Mars, 25 Nov) */
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 100px;
    padding-bottom: 60px;
  }
  .hero-text-wrapper {
    min-height: 160px;
    margin-bottom: 24px;
  }
  .hero-actions {
    margin-top: 24px;
    flex-direction: column;
    align-items: center;
  }
  .hero-actions .btn {
    width: 100%;
    max-width: 320px;
  }
  .hero-title {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }
  .hero-subtitle {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
  }
  /* Heartbeat band — the canvas EKG is drawn here, clear of the heading, cursor and subtitle.
     Tall enough for a strong beat; the gaps below the subtitle are trimmed to
     pay for it, so both buttons still sit above the fixed footer bar. */
  .hero-text-wrapper .hero-ekg-zone {
    display: block;
    height: 130px;   /* calmer beat on phones (Mars, 23 Nov) */
  }
  .hero-text-wrapper .hero-subtitle {
    margin-top: 0 !important;
  }
  #hero .hero-text-wrapper { margin-bottom: 12px; }
  #hero .hero-actions { margin-top: 12px; }
}
.hero-ekg-zone { display: none; }

.hero-title {
  font-family: var(--font-display); /* Explicitly sans-serif ('Outfit') */
  font-size: clamp(2rem, 5vw, 3.8rem); /* Optimized scaling range to guarantee 2-line layout without wrapping */
  line-height: 1.15; /* Balanced spacing for multi-line layout */
  margin-bottom: 24px;
  font-weight: 400; /* Removed bold styling */
  max-width: 100%; /* Spans full width to let typewriter newline control wrapping */
  text-align: center;
}

/* Blinking typewriter cursor: app.js puts it right after the last typed
   letter, moves it to the tagline while that types, then removes it. */
.tw-caret {
  margin-left: 2px;
  animation: cursorBlink 0.9s infinite step-end;
  color: var(--accent-blue);
  font-weight: 300;
}

@keyframes cursorBlink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 90%;
  text-align: center;
  margin-bottom: 0px;
  min-height: 1.8em;
}

@media (min-width: 960px) {
  .hero-subtitle {
    max-width: 100%;
    white-space: nowrap; /* Forces one line instead of wrapping on desktop */
  }
}

.hero-ctas {
  display: flex;
  gap: 16px;
}

@media (max-width: 480px) {
  .hero-ctas { width: 100%; flex-direction: column; }
}

/* Live stream section layout wrapper */
.live-stream-section {
  padding: 90px 0;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(15, 23, 42, 0.03);
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}

.live-stream-layout {
  position: relative;
  z-index: 2;
}

/* --- High-Contrast Pitch Black Console styling --- */
.dark-theme-console {
  background: #090c15 !important; /* Pure black-blue base */
  border-color: rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45) !important;
}

.dark-theme-console::before {
  /* Override light gradient mask */
  background: linear-gradient(180deg, rgba(255,255,255,0.01) 0%, rgba(0,0,0,0) 100%) !important;
}

.dark-theme-console .console-flow-viz {
  background: rgba(0, 0, 0, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

.dark-theme-console .viz-node span {
  color: #8b949e !important;
}
.dark-theme-console .viz-node.active span {
  color: #ffffff !important;
}
.dark-theme-console .viz-line {
  background: rgba(255, 255, 255, 0.09) !important;
}

/* Pitch Black Logs Container */
.dark-theme-console .console-log-box {
  background: #020408 !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}
.dark-theme-console .console-log-header {
  color: #8b949e !important;
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}
.dark-theme-console .log-ts {
  color: #484f58 !important;
}
.dark-theme-console .log-txt {
  color: #e6edf3 !important;
}
.dark-theme-console .log-success {
  color: #39d353 !important; /* GitHub success green */
}
.dark-theme-console .console-log-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   Scroll-Driven Focus / Reveal popup Animation
   ========================================================================== */
.scroll-reveal-console {
  transform: scale(0.98) translateY(20px);
  opacity: 0.85;
  transform-origin: top center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.6s ease;
}

/* Fallback class toggled by JS intersectionObserver */
.scroll-reveal-console.in-focus {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

/* Native CSS ViewTimeline animation mapping (Progressive Enhancement) */
@supports (animation-timeline: view()) {
  @keyframes focusConsole {
    from {
      transform: scale(0.98) translateY(20px);
      opacity: 0.85;
    }
    to {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
  }

  .scroll-reveal-console {
    animation: focusConsole auto linear both;
    animation-timeline: view(block);
    animation-range: entry 5% cover 30%;
    transition: none; /* Let CSS timeline override standard transitions */
  }
}

/* --- Capabilities Section --- */
.capabilities-section {
  padding: 72px 0;
}

.capability-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border-color: rgba(15,23,42,0.04);
  background: rgba(255,255,255,0.7);
}

/* Cards as links */
a.capability-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
a.capability-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,98,255,0.10);
}
a.capability-card-link h3 { color: var(--text-primary); }

/* Punchy CTA line at bottom of card */
.card-punchy {
  display: block;
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 0.01em;
}

.card-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-blue { background: var(--accent-blue); box-shadow: 0 0 6px var(--accent-blue); }
.dot-orange { background: var(--accent-orange); box-shadow: 0 0 6px var(--accent-orange); }
.dot-green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dot-violet { background: var(--accent-violet); box-shadow: 0 0 6px var(--accent-violet); }

.indicator-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.capability-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.capability-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Scroll-pinned card stacks (phones; built by app.js) ---------------
   Home service cards and Industries sector cards. The track is made taller than the screen and the
   .cap-sticky panel pins inside it, so plain page scroll drives the cards in
   one by one. The front card carries its service colour (--cap-rgb, set per
   card from its indicator dot) as a top rule, tinted wash and glow. */
.cap-stack .cap-track {
  display: block !important;     /* was a grid of cards; now one tall track */
  position: relative;
}
.cap-sticky {
  position: sticky;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.cap-deck {
  position: relative;
  width: 100%;
}
.cap-deck .stack-card {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  transform-origin: 50% 0%;
  will-change: transform, opacity;
  /* Each card lands in one clean slide when its turn comes (app.js sets the
     end state; this eases it there). */
  transition:
    transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.4s ease,
    border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease !important;
  -webkit-tap-highlight-color: transparent;
}
.cap-deck .capability-card,
.cap-deck .capability-card:hover { background: #fff; }
.cap-deck .capability-card.is-focus {
  background:
    linear-gradient(180deg, rgba(var(--cap-rgb), 0.07) 0%, rgba(255, 255, 255, 0.96) 55%),
    #fff;
  border-color: rgba(var(--cap-rgb), 0.3);
  box-shadow:
    inset 0 3px 0 rgba(var(--cap-rgb), 0.9),
    0 18px 44px -16px rgba(var(--cap-rgb), 0.38),
    0 2px 6px rgba(15, 23, 42, 0.05);
}
.cap-deck .capability-card.is-focus::before { opacity: 0; }
.cap-deck .capability-card.is-focus .card-punchy { color: rgb(var(--cap-rgb)); }
/* In the stack the card's dot follows its stack colour too. */
.cap-deck .capability-card .indicator-dot {
  background: rgb(var(--cap-rgb));
  box-shadow: 0 0 6px rgb(var(--cap-rgb));
}
.cap-deck .stack-card:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* Three short bars that fill as each card arrives. */
.cap-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.cap-progress span {
  position: relative;
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}
.cap-progress span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(var(--cap-rgb));
  transform-origin: left center;
  transform: scaleX(var(--fill, 0));
  transition: transform 0.45s ease;
}

/* --- Interactive Sandbox --- */
.sandbox-section {
  padding: 80px 0;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(15, 23, 42, 0.02);
  border-bottom: 1px solid rgba(15, 23, 42, 0.02);
}

.sandbox-wrapper {
  padding: 0;
  border-color: rgba(15, 23, 42, 0.05);
  overflow: hidden;
  max-width: 100%;
}

.sandbox-tabs {
  display: flex;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(0,0,0,0.01);
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}
.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.015);
}
.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: #ffffff;
}
.tab-btn i {
  width: 14px;
  height: 14px;
}

.sandbox-content {
  padding: 28px;
  background: #ffffff;
}

/* All three tabs sit in the same grid cell, so the box is always as tall as the
   tallest tab and keeps one size whichever tab is open. The hidden ones stay laid
   out (that's what sets the size) but can't be seen, clicked or read out. */
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.sandbox-content { display: grid; }
.sandbox-content > .tab-pane {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  visibility: hidden;
  opacity: 0;            /* hides the whole layer at once; children with their own
                            transitions can't linger over the new tab */
  pointer-events: none;
}
.sandbox-content > .tab-pane > * { flex: 1; }
.sandbox-content > .tab-pane.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.sandbox-content > .tab-pane:not(.active) * { pointer-events: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .sandbox-content > .tab-pane.active { animation: paneIn 0.35s ease both; }
}
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Phones: the box fits the open tab instead of the tallest one, so the voice demo has no empty space under it (Mars, 23 Nov) */
@media (max-width: 767px) {
  .sandbox-content > .tab-pane:not(.active) { display: none; }
}

.pane-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 6px;
  margin-bottom: 20px;
}

/* Voice simulator specific styles */
.voice-simulator-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
}

@media (max-width: 768px) {
  .voice-simulator-layout { grid-template-columns: 1fr; }
  .sandbox-section .section-subtitle,
  .sandbox-wrapper .pane-desc,
  .preset-btn small {
    display: none !important;
  }

  /* Compact Sandbox Tabs & Padding */
  .sandbox-content {
    padding: 12px !important;
  }
  .tab-btn {
    padding: 10px 4px !important;
    gap: 6px !important;
    font-size: 0.72rem !important;
  }
  .tab-btn i {
    width: 14px !important;
    height: 14px !important;
  }

  /* Compact Voice Agent Simulator */
  .voice-log-console {
    height: 290px !important; /* Enlarged from 250px */
  }
  .console-body {
    padding: 8px 8px 40px !important;
    gap: 8px !important;
    font-size: 0.84rem !important;
  }
  .chat-bubble {
    padding: 8px 12px !important;
    max-width: 92% !important;
  }
  .chat-bubble .translation {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-top: 4px !important;
    padding-top: 4px !important;
  }
  .call-status-box {
    padding: 6px 10px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
  }
  .lang-selector-group {
    margin-bottom: 8px !important;
  }
  .lang-options {
    flex-direction: column !important;
    gap: 6px !important;
  }
  .lang-options button {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
    width: 100% !important;
  }
  .summary-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .summary-item-full {
    grid-column: span 1 !important;
  }
  .calc-results-pane {
    height: auto !important;
    padding-bottom: 16px !important;
  }
  .calc-results-body {
    padding: 16px 12px !important;
    gap: 12px !important;
  }
  .voice-simulator-layout,
  .workflow-simulator-layout,
  .calc-layout-inside {
    gap: 16px !important;
    grid-template-rows: auto 1fr; /* spare height goes to the lower panel, not a gap */
  }

  /* Compact Workflow Automator */
  .workflow-canvas-pane {
    min-height: 0 !important;
  }
  .canvas-nodes {
    padding: 12px !important;
    gap: 10px !important;
  }
  .node-block {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
  }
  .node-connector {
    height: 12px !important;
  }
  .preset-options {
    gap: 6px !important;
    margin-bottom: 12px !important;
  }
  .preset-btn {
    padding: 8px 10px !important;
  }

  /* Compact ROI Savings Calculator */
  .form-group.range-group {
    margin-bottom: 12px !important;
  }
  .slider-container {
    height: 24px !important;
  }
  .roi-comparison-card {
    padding: 12px !important;
    margin-bottom: 12px !important;
  }

  /* Compact & Mobile-Friendly Agentic Workflow Sandbox */
  #workflow-sandbox,
  #interactive-workflow-sandbox {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
  #workflow-sandbox .section-title,
  #interactive-workflow-sandbox .section-title {
    font-size: 1.4rem !important;
  }
  .sandbox-builder-wrapper {
    padding: 12px !important;
    margin-top: 15px !important;
    border-radius: 12px !important;
  }

  /* 1. Grid-Based Category Palette */
  .sandbox-palette {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    overflow-x: hidden !important;
    white-space: normal !important;
    margin-bottom: 12px !important;
    padding-bottom: 0 !important;
  }
  .palette-group {
    flex: none !important;
    width: 100% !important;
    padding: 8px !important;
    border-radius: 8px !important;
  }
  .palette-title {
    font-size: 0.72rem !important;
    margin-bottom: 8px !important;
  }
  .draggable-pills {
    gap: 6px !important;
  }
  .drag-pill {
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
    gap: 6px !important;
    border-radius: 6px !important;
  }
  .drag-pill i,
  .drag-pill svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* 2. Horizontal Fit flowchart targets */
  .sandbox-flowchart {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 10px 4px !important;
    margin-bottom: 20px !important;
    margin-top: 15px !important;
    border-radius: 8px !important;
  }
  .flow-node {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 12px 4px !important;
    border-radius: 8px !important;
  }
  .flow-node i[id^="icon-"],
  .flow-node svg[id^="icon-"] {
    width: 16px !important;
    height: 16px !important;
    margin-bottom: 4px !important;
  }
  .flow-node .node-title {
    font-size: 0.6rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .flow-node .node-type {
    font-size: 0.5rem !important;
    margin-top: 2px !important;
  }
  .flow-path-arrow {
    font-size: 0.65rem !important;
    margin: 0 !important;
  }
  .flow-path-arrow i,
  .flow-path-arrow svg {
    width: 10px !important;
    height: 10px !important;
  }
  .active-gear-indicator {
    top: 2px !important;
    right: 2px !important;
  }
  .active-gear-indicator i,
  .active-gear-indicator svg {
    width: 10px !important;
    height: 10px !important;
  }

  /* 3. Compact Result Card */
  .sandbox-result-box {
    padding: 12px !important;
    border-radius: 10px !important;
  }
  #workflow-result-title {
    font-size: 0.95rem !important;
  }
  .sandbox-badge {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
  }
  #workflow-result-desc {
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    margin-bottom: 12px !important;
  }
  .sandbox-result-box .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    padding: 10px 16px !important;
  }

  /* Horizontal scrolling Sandbox tabs */
  .sandbox-tabs {
    display: flex !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05) !important;
  }
  .sandbox-tabs .tab-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 8px 2px !important;
    font-size: 0.68rem !important;
    gap: 2px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    border-bottom-width: 2px !important;
  }
  .sandbox-tabs .tab-btn i {
    width: 14px !important;
    height: 14px !important;
    margin-bottom: 4px !important;
  }
  .sandbox-tabs .tab-btn span {
    display: block !important;
    max-width: 85px !important;
    font-weight: 600 !important;
  }

  /* Horizontal scrolling Workflow presets */
  .workflow-presets {
    flex-direction: row !important;
    display: flex !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }
  .workflow-presets .preset-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 8px 4px !important;
    text-align: center !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  .workflow-presets .preset-btn strong {
    font-size: 0.68rem !important;
    display: block !important;
    text-align: center !important;
    font-weight: 600 !important;
    max-width: 85px !important;
  }
  .workflow-presets .preset-btn span {
    display: none !important;
  }

  /* Keypad/Dialer compaction on mobile voice simulator */
  .dialer-panel {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .dialer-panel input {
    width: 100% !important;
    font-size: 0.85rem !important;
    padding: 8px 12px !important;
  }
  .dialer-panel button {
    width: 100% !important;
    font-size: 0.85rem !important;
    padding: 10px 16px !important;
  }
}

.voice-controls {
  display: flex;
  flex-direction: column;
}
.voice-controls h4 {
  font-size: 1.15rem;
}

.call-status-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15,23,42,0.02);
  border: 1px solid rgba(15,23,42,0.05);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.status-indicator-call {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-dot-active {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  z-index: 2;
  transition: background-color 0.3s ease;
}
.status-dot-active.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.pulse-ring {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent-green);
  border-radius: 50%;
  animation: ringPulse 1.5s infinite ease-out;
}
@keyframes ringPulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.status-header {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.status-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Light Mode Console Transcript */
.voice-log-console {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 500px;
  position: relative;
  overflow: hidden;
}

.console-header {
  background: rgba(15,23,42,0.02);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(15,23,42,0.05);
  display: flex;
  align-items: center;
  gap: 6px;
}
.console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.console-dot.red { background-color: #ef4444; }
.console-dot.yellow { background-color: #f59e0b; }
.console-dot.green { background-color: #10b981; }
.console-title {
  margin-left: 6px;
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-secondary);
}

.console-body {
  padding: 16px 16px 88px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
}
.console-body::-webkit-scrollbar {
  width: 4px;
}
.console-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 2px;
}

.system-msg {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin: auto 0;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  position: relative;
  line-height: 1.4;
  animation: fadeUpIn 0.3s ease forwards;
}

.chat-bubble.customer {
  align-self: flex-start;
  background: rgba(15,23,42,0.03);
  border: 1px solid rgba(15,23,42,0.03);
  border-bottom-left-radius: 2px;
  color: var(--text-primary);
}
.chat-bubble.agent {
  align-self: flex-end;
  background: rgba(0, 98, 255, 0.05);
  border: 1px solid rgba(0, 98, 255, 0.1);
  border-bottom-right-radius: 2px;
  color: var(--text-primary);
}

.chat-bubble .speaker {
  font-weight: 600;
  font-size: 0.7rem;
  margin-bottom: 2px;
  display: block;
}
.chat-bubble.customer .speaker { color: var(--accent-violet); }
.chat-bubble.agent .speaker { color: var(--accent-blue); }

.chat-bubble .translation {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(15,23,42,0.12);
  font-size: 0.92rem;
  color: #0f172a;
  font-weight: 600;
}

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.console-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px; /* default collapsed height */
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 14px 16px;
  font-size: 0.8rem;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  overflow-y: hidden;
}

/* Lang selector */
.lang-selector-group {
  margin-bottom: 20px;
}
.lang-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.lang-options {
  display: flex;
  gap: 8px;
}
.lang-btn {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 98, 255, 0.15);
}
.lang-btn.active {
  background: rgba(0, 98, 255, 0.06);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 600;
}

/* Voice Waveform animation */
.voice-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px dashed rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  padding: 0 10px;
}
.voice-waveform span {
  display: block;
  width: 3px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: height 0.08s ease, background-color 0.2s ease;
}
.voice-waveform.active span {
  background: var(--accent-blue);
}
.voice-waveform.active span:nth-child(even) {
  background: var(--accent-orange);
}

/* CRM Strip */
.crm-status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.05);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: all 0.2s ease;
}
.crm-status-strip i {
  width: 14px;
  height: 14px;
  stroke-width: 2px;
}
.crm-status-strip.active {
  background: rgba(0, 98, 255, 0.03);
  border-color: rgba(0, 98, 255, 0.1);
  color: var(--accent-blue);
}
.crm-status-strip.synced {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

/* Structured Post-call summary */
.structured-summary {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.voice-log-console.show-summary .console-footer {
  height: calc(100% - 37px); /* covers everything below header */
  background: #f8fafc;
  overflow-y: auto;
  border-top-color: transparent;
  padding: 16px 20px;
}
.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.summary-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  padding: 2px 8px;
  border-radius: 100px;
}
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
  animation: fadeUpIn 0.3s ease forwards;
}
.summary-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.04);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.summary-item-full {
  grid-column: span 2;
}
.summary-key {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.summary-val {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Transcript updates */
.lang-tag {
  display: inline-block;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.system-event {
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.02);
  border: 1px dashed rgba(15, 23, 42, 0.05);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin: 6px 0;
  animation: fadeUpIn 0.25s ease forwards;
}
.console-footer p {
  color: var(--text-secondary);
}

/* Workflow simulator layout */
.workflow-simulator-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
}
@media (max-width: 768px) {
  .workflow-simulator-layout { grid-template-columns: 1fr; }
}

.workflow-presets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-btn {
  background: rgba(15,23,42,0.015);
  border: 1px solid rgba(15,23,42,0.04);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.preset-btn:hover {
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.12);
}
.preset-btn.active,
.preset-btn.active:hover {
  background: rgba(255, 107, 0, 0.08);   /* muted Rufen orange */
  border-color: rgba(212, 128, 76, 0.45);
  color: var(--text-primary);
}
.preset-btn.active strong { color: #b8632f; }

.preset-btn strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.preset-btn span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.workflow-canvas-pane {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.canvas-header {
  background: rgba(15,23,42,0.02);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(15,23,42,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-secondary);
}

.canvas-nodes {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
}

.node-block {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 260px;
  max-width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.node-block i {
  width: 16px;
  height: 16px;
  color: var(--accent-blue);
}

.node-block span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.node-block.active {
  background: rgba(16, 185, 129, 0.05) !important;
  border-color: var(--accent-green) !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1) !important;
}
.node-block.active i {
  color: var(--accent-green);
}
.node-block.active span {
  color: var(--text-primary);
}

/* Connector Line between Node Blocks */
.node-connector {
  width: 2px;
  height: 16px;
  background: rgba(15, 23, 42, 0.08);
}
.node-connector.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Tab 3: ROI Calculator Embedded inside Sandbox Layout */
.calc-layout-inside {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 32px;
}
@media (max-width: 768px) {
  .calc-layout-inside { grid-template-columns: 1fr; }
}

.calc-controls h4 {
  font-size: 1.15rem;
}

.form-group.range-group {
  margin-bottom: 20px;
}
.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
}
.slider-container {
  position: relative;
  width: 100%;
  height: 24px;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}
.slider-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.container-staff .slider-label {
  color: var(--accent-blue);
}
.container-software .slider-label {
  color: var(--accent-orange);
}
.range-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Range sliders: a soft track that fills with the slider's colour up to a round handle.
   --c is the colour, --fill the filled share (set by app.js as the slider moves). */
.range-slider {
  --c: var(--accent-blue);
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
}
.range-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--c) 0 var(--fill, 10%), rgba(15, 23, 42, 0.09) var(--fill, 10%) 100%);
}
.range-slider::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(15, 23, 42, 0.09); }
.range-slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--c); }
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--c);
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--c);
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.range-slider:hover::-webkit-slider-thumb, .range-slider:active::-webkit-slider-thumb { transform: scale(1.12); }
.range-slider:hover::-moz-range-thumb, .range-slider:active::-moz-range-thumb { transform: scale(1.12); }
.range-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); }
.range-slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); }

#range-staff { --c: var(--accent-blue); }
#val-staff { color: var(--accent-blue); }
#range-software { --c: var(--accent-orange); }
#val-software { color: var(--accent-orange); }

.calc-results-pane {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}
.calc-results-pane .calc-assumptions {
  margin: 0 !important;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  opacity: 1 !important;
}

.calc-results-header {
  background: rgba(15,23,42,0.02);
  padding: 14px 20px;
  border-bottom: 1px solid rgba(15,23,42,0.05);
  font-size: 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.calc-results-body {
  padding: 24px 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.result-row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.result-row > span:first-child { flex: 1 1 0; min-width: 0; padding-right: 12px; }
.result-row > span:nth-child(2) { white-space: nowrap; }
/* Cost comparison bars: traditional is the full width, Rufen its share of it */
.cost-bar {
  flex-basis: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.cost-bar span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.cost-bar--legacy span { background: linear-gradient(90deg, #f87171, #ef4444); }
.cost-bar--agentic span { background: linear-gradient(90deg, #3b82f6, var(--accent-blue)); }
.cost-value {
  font-weight: 600;
  color: var(--text-primary);
}
.legacy-cost {
  color: #ef4444;
}
.agentic-cost {
  color: var(--accent-blue);
}
.divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 8px 0;
}
.total-savings-row {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.savings-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-green);
  text-shadow: 0 0 12px rgba(16,185,129,0.15);
}

/* --- Contact & Consultation Form --- */
.contact-section {
  padding: 80px 0 100px;
}

.contact-card {
  max-width: 600px;
  margin: 0 auto;
  border-color: rgba(15, 23, 42, 0.05);
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(15,23,42,0.04);
}

/* "Upgrade Your Infrastructure" card: a grey border glow that slowly
   breathes brighter and softer, so the white card stands off the page. */
.contact-section .contact-card {
  border: 1px solid rgba(100, 116, 139, 0.35);
  animation: contactGlow 3.2s ease-in-out infinite alternate;
}
@keyframes contactGlow {
  from {
    border-color: rgba(100, 116, 139, 0.25);
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.08), 0 0 10px 0 rgba(100, 116, 139, 0.12), 0 20px 40px rgba(15, 23, 42, 0.04);
  }
  to {
    border-color: rgba(100, 116, 139, 0.6);
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.2), 0 0 32px 4px rgba(100, 116, 139, 0.32), 0 20px 40px rgba(15, 23, 42, 0.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact-section .contact-card { animation: none; box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.15), 0 0 18px rgba(100, 116, 139, 0.2); }
}
/* The rain stays strictly behind the form: fields, select and textarea are
   solid white so no code runs across what someone is typing. */
.contact-card input,
.contact-card select,
.contact-card textarea {
  background-color: #fff !important;
}
/* Grey matrix rain filling the card (drawn by app.js). Behind the form and
   under the card's own sheen, faint enough that it reads as texture. */
.contact-card .matrix-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0 !important;
  opacity: 0.24;
  border-radius: inherit;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.has-tracer { overflow: visible !important; }
/* Numbered tracer (app.js): the badge rides the card's border on GPU
   transforms set every frame, snapped to whole pixels for crisp digits. */
.laser-badge {
  position: absolute !important;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}
.laser-badge {
  z-index: 4 !important;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}
.laser-badge.laser-blue   { background: var(--accent-blue);   box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.18), 0 0 10px rgba(0, 98, 255, 0.55); }
.laser-badge.laser-orange { background: var(--accent-orange); box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.18), 0 0 10px rgba(255, 107, 0, 0.55); }
.contact-header {
  margin-bottom: 32px;
}
.contact-header h2 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.custom-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row {
  gap: 20px;
}

.form-group {
  position: relative;
  width: 100%;
}

.form-group input, 
.form-group textarea {
  width: 100%;
  padding: 14px;
  background: rgba(15,23,42,0.015);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-group input:focus, 
.form-group textarea:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0, 98, 255, 0.1);
}
/* The ROI sliders sit in a .form-group but are not text boxes */
.form-group input.range-slider,
.form-group input.range-slider:focus { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }

/* Floating label mechanics */
.form-group label {
  position: absolute;
  left: 14px;
  top: 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition-fast);
  pointer-events: none;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -9px;
  left: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-blue);
  background: #ffffff;
  padding: 0 5px;
  border-radius: 4px;
}

/* Submit Consultation Button Loading State */
#btn-submit-form.loading {
  pointer-events: none;
  opacity: 0.8;
}

/* Success notification message styling */
.success-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-green);
}
.success-icon-wrapper i {
  width: 24px;
  height: 24px;
}
.form-success-message h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}
.form-success-message p {
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto;
  font-size: 0.9rem;
}

/* --- Closing section (every page's last section, id="contact") ---
   One glass card. Left: "Prefer to talk?" and the Book button. Right: the
   write-it-down form. A hairline divides the two equal halves on desktop;
   on phones they stack, talk first, then the form. */
.contact-section .closing-card {
  max-width: 980px;
}
.closing-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 56px;
  align-items: start;
  text-align: left;
}
.closing-half {
  min-width: 0;
}
.closing-half + .closing-half {
  position: relative;
}
.closing-half + .closing-half::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(15, 23, 42, 0.08);
}
.closing-half h3 {
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.closing-talk {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 6px;
}
.closing-talk > p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 24px;
}
.closing-form .custom-form {
  margin-top: 4px;
}
.closing-form .form-success-message {
  text-align: center;
}
@media (max-width: 768px) {
  .closing-two {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .closing-half + .closing-half {
    margin-top: 36px;
    padding-top: 36px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }
  .closing-half + .closing-half::before {
    display: none;
  }
  .closing-talk {
    padding-top: 0;
  }
}

/* Phones: a compact closing card (Mars, 23 Nov). Smaller heading and padding, "Prefer to talk?" as one row with the
   button beside it, name and email side by side, a shorter message box. Inputs are 16px so iPhones don't zoom in on tap. */
@media (max-width: 767px) {
  .contact-section { padding: 44px 0 56px; }
  .contact-section .contact-card.closing-card { padding: 22px 18px; }
  /* the heading is enough on a phone (Mars, 23 Nov): no subtitle and no "Prefer to talk?" / "Or just write it down"
     labels; just the heading, a full-width Book a call, then the form */
  .contact-section .contact-header { margin-bottom: 32px; }   /* a blank row under the heading (Mars, 23 Nov) */
  .contact-section .contact-header h2 { font-size: 1.45rem; line-height: 1.2; margin: 0; }
  .contact-section .contact-header .section-subtitle { display: none; }
  .contact-section .closing-talk h3, .contact-section .closing-talk > p, .contact-section .closing-form h3 { display: none; }
  .contact-section .closing-talk .btn { width: 100%; justify-content: center; padding: 13px 18px; font-size: 1rem; }
  .contact-section .closing-half + .closing-half { margin-top: 16px; padding-top: 16px; }
  .contact-section .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
  .contact-section .form-group input, .contact-section .form-group textarea { padding: 12px; font-size: 16px; }
  .contact-section .form-group label { top: 13px; left: 12px; font-size: 0.88rem; }
  .contact-section .form-group textarea { height: 88px; min-height: 0; }
  .contact-section #btn-submit-form { padding: 13px 18px; font-size: 1rem; margin-top: 4px; }
}
@media (max-width: 339px) { .contact-section .form-row { grid-template-columns: minmax(0, 1fr); } }

/* --- Footer --- */
footer {
  position: relative;
  z-index: 10;
  background: rgba(248, 250, 252, 0.75) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  padding: 60px 0 54px !important;
  /* Hardware acceleration to freeze layers and prevent scroll flicker */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, backdrop-filter;
}

/* The footer spans the same width as the header (full width, 40px sides),
   so the logo and the last column line up with the header's logo and
   buttons. Phones keep their own padding. */
@media (min-width: 769px) {
  footer > .container,
  .footer-bottom-bar > .container {
    max-width: 100%;
    padding: 0 40px;
  }
}
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  footer {
    padding: 16px 0 64px !important;
  }
  .footer-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
    text-align: left !important;
    align-items: start !important;
  }
  .footer-brand {
    text-align: left !important;
  }
  .footer-desc {
    font-size: 0.78rem !important;
    margin-top: 6px !important;
    line-height: 1.4 !important;
    max-width: none !important;
  }
  .footer-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    margin-left: 0 !important;
    column-gap: 20px !important;
    row-gap: 18px !important;
    align-items: start !important;
    text-align: left !important;
    width: auto !important;
  }

  .footer-col {
    text-align: left !important;
  }
  .footer-col h5 {
    margin-bottom: 8px !important;
  }
  .footer-col a,
  .footer-col span {
    margin-bottom: 4px !important;
    font-size: 0.78rem !important;
  }
  /* .footer-desc is hidden on mobile, so this sits directly under the logo. */
  .footer-brand-link {
    margin-top: 8px !important;
    font-size: 0.78rem !important;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

.footer-logo {
  margin-bottom: 12px;
  display: block;
  /* The "{" starts ~8px inside the SVG (x=12 of 50 at 40px tall, minus half its stroke),
     so pull the logo left to line its visible edge up with the text below. */
  margin-left: -8px;
}
.footer-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 280px;
}

/* Link groups sit in a fixed grid that wraps: a new group starts a new row
   under the first column instead of adding a column, so the footer never
   grows sideways (desktop: three across; phones: two, under the logo). */
.footer-links {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  column-gap: 56px;
  row-gap: 28px;
  align-items: start;
  /* Brand stays on the far left; the groups sit packed together on the
     right edge, with the free space in the middle. The 64px margin is the
     minimum gap from the brand. */
  margin-left: 64px;
}
/* Narrower desktops: tighter gaps so the columns still fit beside the brand
   without running past the right padding. */
@media (min-width: 769px) and (max-width: 1100px) {
  .footer-links {
    column-gap: 28px;
    margin-left: 32px;
  }
}
/* Every group sits shoulder to shoulder on one row. A column can hold a
   stack of groups, so a sixth group joins a stack instead of a new row. */
.footer-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-col h5 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.footer-col a, .footer-col span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.footer-col a:hover {
  color: var(--text-primary);
}

/* Standalone link in the footer brand column, sitting under the tagline. */
.footer-brand-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-blue);
  transition: color 0.3s ease;
}
.footer-brand-link:hover {
  color: var(--text-primary);
}
/* More Services sits directly under Industries, in Rufen orange. */
.footer-brand-link + .footer-brand-link {
  display: block;
  width: max-content;
  margin-top: 8px;
}
.footer-brand-link-more { color: var(--accent-orange); }
.footer-brand-link-more:hover { color: var(--text-primary); }
.footer-brand-link .footer-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.footer-brand-link:hover .footer-arrow {
  transform: translateX(4px);
}

/* Footer Links Hover Micro-Animations */
.footer-col a {
  position: relative;
  transition: color 0.3s ease;
}
.footer-col a svg {
  transition: transform 0.3s ease, stroke 0.3s ease;
  pointer-events: none;
}
.footer-col a:hover svg {
  stroke: var(--text-primary);
}

/* 1. Phone ring animation */
@keyframes footer-phone-ring {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}
.footer-col a:hover svg.lucide-phone {
  animation: footer-phone-ring 0.4s ease infinite;
}

/* 2. User bounce animation */
@keyframes footer-user-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.footer-col a:hover svg.lucide-user {
  animation: footer-user-bounce 0.6s ease infinite;
}

/* 3. Gear spin animation */
@keyframes footer-gear-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.footer-col a:hover svg.lucide-settings {
  animation: footer-gear-spin 1.5s linear infinite;
}

/* 4. More Services arrow slide */
.footer-col a .footer-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.footer-col a:hover .footer-arrow {
  transform: translateX(4px);
}


.footer-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(248, 250, 252, 0.82) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  z-index: 999;
  box-sizing: border-box;
  padding: 4px 0 !important;
  /* Hardware acceleration to prevent scroll flicker */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 0.78rem;
  color: #475569 !important; /* High visibility on desktop light background */
}
.footer-bottom p {
  margin: 0;
}
@media (max-width: 768px) {
  .footer-desc {
    display: none !important; /* Hide brand description to save space */
  }
  .footer-bottom-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: rgba(248, 250, 252, 0.82) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
    padding: 4px 16px !important; /* Vertically shrunk padding */
    z-index: 9999 !important;
  }
  .footer-bottom {
    display: flex !important;
    flex-direction: row !important; /* Side-by-side copyright and chat status indicator button */
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 !important;
    font-size: 0.72rem !important;
    color: #475569 !important; /* Same light contrast text color as desktop */
  }
  .footer-bottom p {
    margin: 0 !important;
    max-width: 100%;
    word-wrap: break-word;
  }
}


/* ============================================================
   Agentic Communications Network (Infrastructure as Code)
   ============================================================ */
.iac-section {
  padding: 80px 0;
  background: #fbfbfc; /* opaque: the blueprint grid shows only on white sections */
  position: relative;
}
.iac-diagram-card {
  padding: 32px;
  background: #070a13; /* Deep black space dashboard background */
  border: 1px solid rgba(0, 98, 255, 0.12); /* Subtle neon blue border */
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4), 
              0 0 50px rgba(0, 98, 255, 0.04) inset;
  margin-bottom: 24px;
  overflow: visible;
  position: relative;
  border-radius: 16px;
}

/* Scroll reveal disabled for the diagram to ensure 100% sharpness and readability at all times */
.iac-diagram-card.scroll-reveal-console {
  transform: none !important;
  opacity: 1 !important;
  filter: none !important;
  animation: none !important;
  transition: none !important;
}
@media (max-width: 768px) {
  /* Compact Agentic Infrastructure (RUFEN AI SYSTEMS) on mobile */
  .iac-section {
    padding: 20px 0 !important;
  }
  .iac-diagram-card {
    padding: 12px !important;
    margin-bottom: 12px !important;
  }
  .iac-tabs-panel {
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }
  .iac-tab-card {
    flex: 1 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 4px !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }
  .iac-tab-card .card-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    margin: 0 !important;
  }
  .iac-tab-card .card-icon i {
    width: 14px !important;
    height: 14px !important;
  }
  .iac-tab-card .card-content h4 {
    font-size: 0.7rem !important;
    margin: 0 !important;
  }
  .iac-tab-card .card-content p,
  .iac-tab-card .card-tags {
    display: none !important; /* Hide description & tags to compact completely */
  }
  .iac-svg-wrapper {
    max-height: 240px !important; /* Shrink SVG height on mobile */
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .iac-svg {
    max-height: 240px !important;
    width: auto !important;
  }
  .iac-label {
    margin-top: 8px !important;
    font-size: 0.65rem !important;
  }
}

/* Dashboard grid layout */
.iac-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 991px) {
  .iac-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Side tabs */
/* SVG Card Tab Triggers */
.iac-svg-card {
  cursor: pointer;
}
.iac-svg-card rect {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.iac-svg-card[data-target="iaas"]:hover rect,
.iac-svg-card[data-target="iaas"].active rect {
  fill: rgba(0, 98, 255, 0.06) !important;
  stroke: rgba(0, 98, 255, 0.45) !important;
  filter: drop-shadow(0 0 4px rgba(0, 98, 255, 0.2));
}
.iac-svg-card[data-target="workloads"]:hover rect,
.iac-svg-card[data-target="workloads"].active rect {
  fill: rgba(16, 185, 129, 0.06) !important;
  stroke: rgba(16, 185, 129, 0.45) !important;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2));
}
.iac-svg-card[data-target="assistants"]:hover rect,
.iac-svg-card[data-target="assistants"].active rect {
  fill: rgba(255, 107, 0, 0.06) !important;
  stroke: rgba(255, 107, 0, 0.45) !important;
  filter: drop-shadow(0 0 4px rgba(255, 107, 0, 0.2));
}

.iac-tabs-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.iac-tab-card {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 14px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.iac-tab-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.12);
}
.iac-tab-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s;
  flex-shrink: 0;
}
.iac-tab-card .card-content {
  flex: 1;
}
.iac-tab-card h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}
.iac-tab-card p {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  margin-bottom: 10px;
}
.iac-tab-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.iac-tab-card .card-tags span {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Card Active States with specific color codes */
.iac-tab-card[data-target="iaas"].active {
  border-color: var(--accent-blue);
  background: rgba(0, 98, 255, 0.06);
  box-shadow: 0 0 16px rgba(0, 98, 255, 0.12);
}
.iac-tab-card[data-target="iaas"].active .card-icon {
  background: var(--accent-blue);
  color: #fff;
  border-color: transparent;
}
.iac-tab-card[data-target="iaas"].active h4 {
  color: var(--accent-blue);
}

.iac-tab-card[data-target="workloads"].active {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.12);
}
.iac-tab-card[data-target="workloads"].active .card-icon {
  background: var(--accent-green);
  color: #fff;
  border-color: transparent;
}
.iac-tab-card[data-target="workloads"].active h4 {
  color: var(--accent-green);
}

.iac-tab-card[data-target="assistants"].active {
  border-color: var(--accent-orange);
  background: rgba(255, 107, 0, 0.06);
  box-shadow: 0 0 16px rgba(255, 107, 0, 0.12);
}
.iac-tab-card[data-target="assistants"].active .card-icon {
  background: var(--accent-orange);
  color: #fff;
  border-color: transparent;
}
.iac-tab-card[data-target="assistants"].active h4 {
  color: var(--accent-orange);
}

/* SVG telemetry classes */
.iac-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.glass-bg {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
}

/* Lines & flow pathways default */
.data-line {
  stroke-width: 1.5;
  opacity: 0.18;
  transition: all 0.3s ease;
}
.line-blue   { stroke: var(--accent-blue); }
.line-orange { stroke: var(--accent-orange); }
.line-green  { stroke: var(--accent-green); }
.line-muted  { stroke: #475569; }

/* Packet Flow Animation */
.packet {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.pkt-blue   { fill: var(--accent-blue); filter: url(#glow-blue); }
.pkt-orange { fill: var(--accent-orange); filter: url(#glow-orange); }
.pkt-green  { fill: var(--accent-green); filter: url(#glow-green); }

/* SVG highlight state modifier toggled by tab select script */
.iac-svg.highlight-iaas .path-iaas {
  opacity: 0.95;
  stroke-width: 2.2;
}
.iac-svg.highlight-iaas .data-line:not(.path-iaas) {
  opacity: 0.10;
}
.iac-svg.highlight-iaas .packet:not(.pkt-iaas) {
  opacity: 0.12;
}
.iac-svg.highlight-iaas #path-assistants-deepgram,
.iac-svg.highlight-iaas #path-assistants-pipecat {
  stroke: var(--accent-blue) !important;
}
.iac-svg.highlight-iaas #pkt-deepgram-voice,
.iac-svg.highlight-iaas #pkt-pipecat-voice {
  fill: var(--accent-blue) !important;
  filter: url(#glow-blue) !important;
}

.iac-svg.highlight-workloads .path-workloads {
  opacity: 0.95;
  stroke-width: 2.2;
}
.iac-svg.highlight-workloads .data-line:not(.path-workloads) {
  opacity: 0.10;
}
.iac-svg.highlight-workloads .packet:not(.pkt-workloads) {
  opacity: 0.12;
}

.iac-svg.highlight-assistants .path-assistants {
  opacity: 0.95;
  stroke-width: 2.2;
}
.iac-svg.highlight-assistants .data-line:not(.path-assistants) {
  opacity: 0.10;
}
.iac-svg.highlight-assistants .packet:not(.pkt-assistants) {
  opacity: 0.12;
}

/* Floating Animations */
.anim-floating {
  animation: diagFloat 6s ease-in-out infinite alternate;
}
.anim-floating-slow {
  animation: diagFloat 8s ease-in-out infinite alternate-reverse;
}

/* Core / Non-Core Labels */
.legend-node {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Tooltip fixes for dark mode */
.hotspot-tooltip rect {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

/* Bottom Label styling */
.iac-label {
  margin-top: 24px;
}
.iac-label span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #fff;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 24px;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}


/* Interactive hotspots */
.iac-hotspot {
  cursor: pointer;
}
.hotspot-pulse {
  fill: none;
  stroke-width: 2.5;
  animation: hotspotRing 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.hotspot-core {
  stroke-width: 1.5;
  stroke: #fff;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hotspot-translation .hotspot-pulse { stroke: var(--accent-blue); }
.hotspot-translation .hotspot-core  { fill: var(--accent-blue); }

.hotspot-calendar .hotspot-pulse { stroke: var(--accent-orange); }
.hotspot-calendar .hotspot-core  { fill: var(--accent-orange); }

.hotspot-workflow .hotspot-pulse { stroke: var(--accent-green); }
.hotspot-workflow .hotspot-core  { fill: var(--accent-green); }

@keyframes hotspotRing {
  0% { r: 6px; opacity: 1; stroke-width: 3; }
  100% { r: 18px; opacity: 0; stroke-width: 1; }
}

.iac-hotspot:hover .hotspot-core {
  transform: scale(1.22);
}

/* Hover tooltips */
.hotspot-tooltip {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}
.iac-hotspot:hover .hotspot-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}


/* ============================================================
   Gemini Chat Panel
   ============================================================ */
.gemini-chat-panel {
  position: fixed;
  bottom: 52px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.gemini-chat-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.chat-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.chat-panel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
  animation: pulseBlue 2s infinite;
}
.chat-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.chat-panel-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 4px;
}

.chat-msg {
  display: flex;
  max-width: 85%;
}
.chat-msg.user {
  align-self: flex-end;
}
.chat-msg.agent {
  align-self: flex-start;
}
.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.chat-msg.user .chat-msg-bubble {
  background: var(--accent-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.agent .chat-msg-bubble {
  background: rgba(15, 23, 42, 0.05);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chat-msg.agent .chat-msg-bubble.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 18px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.chat-input-bar input {
  flex: 1;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-input-bar input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.08);
}
.chat-input-bar input::placeholder {
  color: var(--text-muted);
}
.chat-send-btn {
  background: var(--accent-blue);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}
.chat-send-btn:hover {
  background: #0050cc;
  transform: scale(1.05);
}
.chat-send-btn:active {
  transform: scale(0.95);
}

/* ── Chat button: blue while the chat panel is open ─────────── */
.status-indicator.chat-active {
  background: rgba(0, 98, 255, 0.06);
  border-color: rgba(0, 98, 255, 0.20);
}
.status-indicator.chat-active .status-chat-icon {
  color: var(--accent-blue);
}
.status-indicator.chat-active .status-label {
  color: var(--accent-blue);
}
#btn-agent-active.chat-active:hover {
  box-shadow: 0 0 14px rgba(0, 98, 255, 0.25);
}

@keyframes pulseBlue {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

@media (max-width: 480px) {
  .gemini-chat-panel {
    width: calc(100% - 16px);
    right: 8px;
    height: 420px;
    border-radius: 14px 14px 4px 14px;
  }
}

/* Try Sandbox Header Button Style */
.btn-sandbox-header {
  background: transparent !important;
  color: var(--accent-orange) !important;
  border: none !important;
  padding: 5px 8px !important;
  border-radius: 30px !important;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin-left: 12px;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  vertical-align: middle;
}

.btn-sandbox-header .play-icon-circle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  background: var(--accent-orange) !important;
  color: #fff !important;
  border-radius: 50% !important;
  flex-shrink: 0;
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease !important;
  position: relative;
}

.btn-sandbox-header .play-icon-circle::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 1.5px solid rgba(255, 107, 0, 0.4);
  border-radius: 50%;
  animation: sandboxPulse 2s infinite;
  pointer-events: none;
}

.btn-sandbox-header .play-icon-circle svg,
.btn-sandbox-header .play-icon-circle i {
  width: 10px !important;
  height: 10px !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  transform: translateX(1px) !important; /* Visual adjustment for play icon centering */
}

.btn-sandbox-header .btn-text-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  line-height: 1.1 !important;
  text-align: left;
}

.btn-sandbox-header .btn-title {
  font-family: var(--font-display), 'Outfit', sans-serif;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  color: var(--accent-orange) !important;
  transition: color 0.3s ease !important;
}

.btn-sandbox-header .btn-subtitle {
  font-size: 0.6rem !important;
  font-weight: 500 !important;
  opacity: 0.8;
  color: var(--text-secondary) !important;
  transition: color 0.3s ease !important;
}

/* Hover States */
.btn-sandbox-header:hover,
.btn-sandbox-header.active {
  background: transparent !important;
  box-shadow: none !important;
  transform: translateY(-1px);
}

.btn-sandbox-header:hover .play-icon-circle,
.btn-sandbox-header.active .play-icon-circle {
  transform: scale(1.08);
}

.btn-sandbox-header:hover .play-icon-circle::after,
.btn-sandbox-header.active .play-icon-circle::after {
  animation-duration: 1.5s;
}

/* Pulse animation */
@keyframes sandboxPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .btn-sandbox-header {
    padding: 0;
  }
  .btn-sandbox-header .btn-title {
    display: none !important;
  }
}

/* Mobile Navigation Hamburger Menu */
.mobile-menu-toggle {
  display: none;
  background: none !important;
  border: none !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  padding: 8px;
  z-index: 1001; /* Stay above nav menu overlay */
  position: relative;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
}
.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-primary) !important;
  transition: transform 0.3s ease;
}
.mobile-menu-toggle .line-top,
.mobile-menu-toggle .line-mid,
.mobile-menu-toggle .line-bot {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.mobile-menu-toggle.active .line-mid {
  opacity: 0;
}
.mobile-menu-toggle.active .line-top {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-toggle.active .line-bot {
  transform: translateY(-6px) rotate(-45deg);
}

/* Nav drawer. Raised from 768px to 1199px: seven items cannot fit below
   1200px at any legible size. Tablet landscape (1024px) now gets the drawer.
   This block contains only nav / hamburger / overlay rules, so re-targeting it
   has no other effect. */
@media (max-width: 1199px) {
  .mobile-menu-toggle {
    display: flex !important;
  }

  .nav-menu {
    display: flex !important;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: rgba(248, 250, 252, 0.95) !important; /* Matches footer background but reduced transparency (95% opaque) */
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-left: 1px solid rgba(15, 23, 42, 0.06) !important; /* Matches footer border */
    flex-direction: column;
    padding: 100px 30px 40px;
    gap: 8px;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    align-items: flex-start;
    overflow-y: auto;
  }
  .nav-menu.mobile-open {
    right: 0;
  }
  .nav-link {
    font-size: 1.05rem;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06); /* Matches footer divider */
    text-align: left;
    color: var(--text-secondary) !important; /* Matches footer link color */
  }
  .nav-link:hover {
    color: var(--accent-orange) !important;
  }
  /* In the drawer the underline would hit the row divider, so the current
     item gets a 3px orange bar on the drawer's left edge instead. */
  .nav-link.active::after {
    top: 0;
    bottom: 0;
    left: -30px;
    width: 3px;
    height: auto;
    border-radius: 0 2px 2px 0;
    background: var(--text-secondary);
  }

  /* Menu groups fold out in place inside the drawer. */
  .nav-group { width: 100%; }
  .nav-group-toggle { justify-content: space-between; }
  .nav-group-panel {
    display: none;
    padding: 6px 0 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }
  .nav-group.open .nav-group-panel { display: block; }
  .nav-group.open .nav-group-toggle { border-bottom-color: transparent; }
  .nav-group.open > .nav-group-toggle { color: var(--accent-orange) !important; }   /* open in the drawer: orange */
  .nav-sub { padding: 9px 6px; }

  .nav-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 28px;
  }
  .nav-drawer-actions .btn { width: 100%; justify-content: center; }
  .nav-drawer-actions .btn-sandbox-header {
    width: 100%;
    margin: 0 !important;
    padding: 12px 0 !important;
    justify-content: center;
  }
  .nav-drawer-actions .btn-sandbox-header .btn-title { display: inline !important; }

  /* Mobile overlay backdrop */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
}





/* --- Mobile: white cards that read as cards ------------------------------
   On a phone the white cards sat on a white page with a 5% border and an
   almost-invisible shadow, so they blurred into one surface. Here they get a
   firmer hairline, a glass top highlight and a two-layer lift — a tight
   contact shadow plus a soft, faintly blue ambient one — so each card
   separates from the page without turning heavy. Backgrounds are left alone
   so the dark console cards are unaffected. Desktop is unchanged. */
@media (max-width: 768px) {
  :root {
    --glass-border: rgba(15, 23, 42, 0.09);
  }
  body .glass-card,
  body .usecase-item,
  body .contact-detail-card {
    border-color: rgba(15, 23, 42, 0.09);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 1px 2px rgba(15, 23, 42, 0.06),
      0 14px 30px -18px rgba(15, 23, 42, 0.30),
      0 6px 18px -12px rgba(0, 98, 255, 0.16);
  }
}

/* --- Mobile: Interactive Sandbox fits one screen ------------------------
   The voice tab ran ~760px tall on a phone, so the call button and the
   transcript never shared the screen. Status and waveform now share a row,
   the repeated heading goes (the tab already names it), and the tabs, CRM
   strip and transcript are tightened.

   The scenario picker was two loose pills stacked in a column: the active
   one read as "the" option and the other faded into the background. It is
   now a two-segment switch — both options side by side at equal weight in a
   shared track, the chosen one raised in white with a blue icon, the other
   in full-strength ink so it is plainly a second choice. */
@media (max-width: 768px) {
  .sandbox-section { padding: 28px 0 32px; }
  .sandbox-section .section-header { margin-bottom: 14px; }
  .sandbox-section .section-title { margin-bottom: 0; }

  .sandbox-tabs .tab-btn {
    padding: 7px 2px !important;
    line-height: 1.15 !important;
  }
  .sandbox-tabs .tab-btn i,
  .sandbox-tabs .tab-btn svg {
    margin-bottom: 2px !important;
  }

  .voice-controls {
    display: grid !important;
    grid-template-columns: 1fr auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
  }
  .voice-controls h4 { display: none; }
  .voice-controls .lang-selector-group,
  .voice-controls .crm-status-strip,
  .voice-controls #btn-trigger-call {
    grid-column: 1 / -1;
  }
  .voice-controls .lang-selector-group,
  .voice-controls .call-status-box,
  .voice-controls .crm-status-strip {
    margin-bottom: 0 !important;
  }
  .voice-controls .call-status-box { padding: 6px 10px !important; }
  .voice-controls .voice-waveform { margin: 0 !important; height: 30px; }
  .voice-controls .crm-status-strip { padding: 6px 10px; }
  .voice-controls #btn-trigger-call { padding-top: 11px; padding-bottom: 11px; }

  /* Scenario switch */
  .lang-label::after {
    content: ' · tap to switch';
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
  }
  .lang-options {
    flex-direction: row !important;
    gap: 4px !important;
    padding: 4px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 12px;
  }
  .lang-options .lang-btn {
    width: auto !important;
    flex: 1 1 0;
    min-height: 44px;
    padding: 6px 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: left;
    line-height: 1.2;
    font-size: 0.76rem !important;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
  }
  .lang-options .lang-btn i,
  .lang-options .lang-btn svg {
    flex-shrink: 0;
    margin-right: 0 !important;
    width: 15px !important;
    height: 15px !important;
    color: var(--text-secondary);
  }
  .lang-options .lang-btn.active {
    background: #fff;
    border-color: rgba(0, 98, 255, 0.35);
    color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
  }
  .lang-options .lang-btn.active i,
  .lang-options .lang-btn.active svg {
    color: var(--accent-blue);
  }

  .voice-log-console { height: 236px !important; }
}

/* --- Looping swipe carousels (phones; built by app.js from
   [data-loop-carousel] grids). One card centred, ~12px of each neighbour
   peeking at the edges, snapping one card at a time. ------------------- */
@media (max-width: 768px) {
  .loop-track {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding: 12px 16px 18px;
    margin: 0 -16px;                 /* bleed to the screen edges (container is 16px) */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .loop-track::-webkit-scrollbar { display: none; }
  .loop-track > * {
    flex: 0 0 calc(100vw - 56px) !important;   /* never shrink to fit the row */
    min-width: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    margin: 0 !important;
  }
  .loop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 2px;
  }
  .loop-arrow {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.12); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-primary); cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }
  .loop-dots { display: flex; gap: 6px; }
  .loop-dots button {
    width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px;
    background: rgba(15, 23, 42, 0.18); cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
  }
  .loop-dots button.is-active { width: 20px; background: var(--accent-blue); }
}

/* --- Footer icons that never sit still -----------------------------------
   Services column: the phone rings, the assistant bobs, the gear turns, the
   layers lift. Contact column: the calendar flips a page, the chat bubble
   pops. Small, slow and staggered so the footer feels alive, not busy. */
.footer-col a svg { transform-box: fill-box; transform-origin: 50% 50%; }
.footer-col a svg.lucide-phone          { animation: ftRing 2.6s ease-in-out infinite; }
.footer-col a svg.lucide-user           { animation: ftBob 2.2s ease-in-out infinite 0.3s; }
.footer-col a svg.lucide-settings       { animation: ftSpin 5s linear infinite; }
.footer-col a svg.lucide-layers         { animation: ftLift 2.4s ease-in-out infinite 0.6s; }
.footer-col a svg.lucide-calendar-days  { animation: ftFlip 3s ease-in-out infinite; }
.footer-col a svg.lucide-message-circle { animation: ftPop 2.4s ease-in-out infinite 0.8s; }
@keyframes ftRing { 0%, 50%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(-14deg); } 10%, 20%, 30% { transform: rotate(14deg); } }
@keyframes ftBob  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes ftSpin { to { transform: rotate(360deg); } }
@keyframes ftLift { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.08); } }
@keyframes ftFlip { 0%, 70%, 100% { transform: rotateX(0); } 80% { transform: rotateX(70deg); } 90% { transform: rotateX(0); } }
@keyframes ftPop  { 0%, 60%, 100% { transform: scale(1); } 70% { transform: scale(1.25); } 80% { transform: scale(0.95); } }
@media (prefers-reduced-motion: reduce) {
  .footer-col a svg { animation: none !important; }
}

/* Email / phone in the contact cards are real links now (mailto:, tel:) —
   they read exactly like the text they replaced. */
.detail-card-info p a,
.info-item p a {
  color: inherit;
  text-decoration: none;
}
.detail-card-info p a:hover,
.info-item p a:hover { color: var(--accent-blue); }

/* --- Tap hint (shared) ----------------------------------------------------
   A blue pointing hand that presses down, with ripples spreading from the
   fingertip. Used wherever a card does something on tap: the AIBA savings
   card (.tap-hint element) and the Who We Are flip cards (drawn with the
   faces' ::before / ::after). Always blue, and it stays — it marks the card
   as tappable every time, not just the first. */
.tap-hint {
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 6 !important;
}
.tap-hint::before {
  content: '';
  position: absolute;
  inset: 4px 0 0 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230062ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 14a8 8 0 0 1-8 8'/%3E%3Cpath d='M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2'/%3E%3Cpath d='M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1'/%3E%3Cpath d='M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10'/%3E%3Cpath d='M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 2px 4px rgba(0, 98, 255, 0.35));
  transform-origin: 35% 15%;
  animation: tapHand 2.4s ease-in-out infinite;
}
.tap-hint::after,
.tap-hint i {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0, 98, 255, 0.75);
  box-sizing: border-box;
  opacity: 0;
  animation: tapRing 2.4s ease-out infinite;
}
.tap-hint i { animation-delay: 0.22s; }
@keyframes tapHand {
  0%, 30%, 100% { transform: translate(0, 0) scale(1); }
  8%            { transform: translate(-1px, 3px) scale(0.86); }
  16%           { transform: translate(0, 0) scale(1); }
}
@keyframes tapRing {
  0%, 6% { transform: scale(0.3); opacity: 0; }
  10%    { transform: scale(0.6); opacity: 1; }
  50%    { transform: scale(2.6); opacity: 0; }
  100%   { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tap-hint::before, .tap-hint::after, .tap-hint i { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cap-deck .stack-card, .cap-progress span::after { transition: none !important; }
}

/* --- Header icons, mobile/tablet header: equal spacing --------------------
   Play and menu each get the same 8px tap padding (≈42px targets) and one
   shared gap, so the visible space between them is identical
   (4px gap + 8px + 8px padding = 20px). */
@media (max-width: 1199px) {
  .header-actions { gap: 4px !important; }
  .header-actions .btn + .btn-sandbox-header { margin-left: 0 !important; }
  .header-actions .btn-sandbox-header,
  .header-actions .mobile-menu-toggle {
    padding: 8px !important;
    margin: 0 !important;
  }
  /* The menu glyph is 24px, the round icons 26px: shave its leading pad so
     the visible gap still comes out at exactly 20px. */
  .header-actions .mobile-menu-toggle { padding-left: 6px !important; }
}

/* Phone stacks (app.js "flow" mode): the cards move with the scroll itself,
   so no easing on transform/opacity — it would lag behind the finger — and
   they recede around their centre. */
.cap-deck.cap-flow .stack-card {
  transform-origin: 50% 50%;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease !important;
}

/* Logo is inline SVG (so "RUFEN" uses the page's own Outfit 800 and looks
   the same on every device); size it by height and keep its proportions. */
svg.logo-image,
svg.chat-brand-logo {
  display: block;
  width: auto;
  aspect-ratio: 142 / 50;
  overflow: visible;
}

/* --- Phones: scroll-focus card lists (classes set by app.js) --------------
   Natural scrolling, no pinning. Like the "More than a website" peel, each
   card rises into place once as it reaches the middle of the screen — a
   short transition, not tied to the scroll position. The card at the centre
   (.is-focus) also takes its accent glow. */
@media (max-width: 768px) {
  .sf-card.is-focus {
    border-color: rgba(var(--cap-rgb), 0.35) !important;
    box-shadow: 0 18px 40px -18px rgba(var(--cap-rgb), 0.5), 0 0 0 1px rgba(var(--cap-rgb), 0.1) !important;
  }
  .sf-card.is-focus .card-punchy { color: rgb(var(--cap-rgb)); }
  #capabilities .sf-card .indicator-dot {
    background: rgb(var(--cap-rgb));
    box-shadow: 0 0 6px rgb(var(--cap-rgb));
  }
  /* Waiting just below, then one short rise into place when the card reaches
     the middle of the screen (app.js adds .is-shown). */
  .sf-card {
    opacity: 0.35;
    transform: translateY(26px) scale(0.96);
    transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.35s ease, box-shadow 0.35s ease !important;
  }
  .sf-card.is-shown { opacity: 1; transform: none; }
  /* Workflow steps on phones: a clean column, room above the copy for the
     water story, which plays on the card in focus. */
  #agentic-steps .workflow-arrow { display: none; }
  #agentic-steps .workflow-steps { flex-direction: column; gap: 16px; }
  #agentic-steps .workflow-step {
    min-height: 300px;
    justify-content: flex-end;
    background: #fff;
  }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .sf-card { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* --- Phones: performance --------------------------------------------------
   Desktop is untouched. On a phone, the costliest effects are swapped for
   cheap equivalents that look almost the same at this size:
   - the two background glow blobs (huge, heavily blurred, always animating)
     are hidden;
   - frosted-glass backdrop blur is off — cards are near-solid white anyway,
     and the header goes a touch more solid instead;
   - the contact card's breathing glow fades a pre-drawn halo's opacity (done
     by the GPU) instead of animating box-shadow (a repaint every frame). */
@media (max-width: 768px) {
  .glow-orb { display: none !important; }
  *, *::before, *::after {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #main-header { background: rgba(255, 255, 255, 0.97) !important; }

  .contact-section .contact-card {
    overflow: visible !important;            /* let the halo glow outside the edge */
    animation: none !important;
    border-color: rgba(100, 116, 139, 0.4);
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.12), 0 20px 40px rgba(15, 23, 42, 0.04);
  }
  .contact-section .contact-card::before { border-radius: inherit; }
  .contact-section .contact-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.25), 0 0 32px 4px rgba(100, 116, 139, 0.32);
    animation: contactGlowFade 3.2s ease-in-out infinite alternate;
  }
}
@keyframes contactGlowFade { from { opacity: 0.25; } to { opacity: 1; } }
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .contact-section .contact-card::after { animation: none; opacity: 0.6; }
}

/* Contact form: the line shown when a message fails to send. */
.form-error-message {
  margin: 0 0 14px;
  color: #b91c1c;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Visually hidden, still announced by screen readers. Use for a <label> whose
   visible design is a placeholder, icon or compact bar. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* "Persona" with a small AI mark top-right, the way ™ sits on a word. */
sup.ai-mark {
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.12em;
  text-transform: none;
}

/* ==========================================================================
   Dark mode (html[data-theme="dark"]). THE ONE DARK BLOCK FOR THE SHARED PARTS OF THE SITE.
   Design: docs/plans/dark-mode-design-system.md. Mechanism: the generated theme script (tools/site_chrome.py)
   sets html[data-theme], html.mkt-dark and the rufen-theme / mkt-theme events. Light mode is not touched by anything below.

   TOKENS FOR AREA DESIGNERS (declared on :root[data-theme="dark"]; Marketing re-declares them on body.pillar-marketing)
   Surfaces, lightest last (hue 263, brand ink-blue): --dk-deep (footer) < --dk-canvas (page) < --dk-s1 (card on canvas, band)
     < --dk-s2 (card in a band, window body) < --dk-s3 (menus, modals, window title bars and panels) < --dk-s4 (hover/pressed on s3).
   Lines (always lighter than the surface they sit on): --dk-line-1 (on canvas, s1), --dk-line-2 (on s2), --dk-line-3 (on s3, hover),
     --dk-edge (stage/window outer edge, on s4 and plates), --dk-edge-hi (1px top highlight), --dk-control (input boundary, 3:1).
   Text: --text-primary / --text-secondary / --text-muted (+ --dk-text-faint: disabled only). Never #fff.
   Accent tints for text, lines, icons: --blue-text --blue-text-hi --orange-text --green-text --violet-text --violet-text-hi
     --lime-text --red-text --red-text-hi --amber-text. (--accent-blue/orange/green stay the brand hex for SOLID fills with white ink.)
   Semantic tokens that light CSS already reads are re-pointed: --bg-primary --bg-secondary --band-alt --surface-* --glass-* --hairline*
     --tint-* --shadow-* (none). A card reads var(--glass-bg) and is automatically the right level; inside a band it steps up (see below).
   STAGE (always-dark showpiece, a lit object): --stage-top --stage-bot --stage-plate --stage-plate-hi --stage-inset --stage-face-* --stage-edge
     --stage-edge-hi --stage-active-edge. Hook: put a showpiece's selector in the shell list below, OR add class .dm-stage to its element.
     Inside: nested panels = --stage-plate (hover/active = --stage-plate-hi + accent edge); only the named displays may use --stage-inset.
   WINDOW (mock app UI that is white in light): tokens --win-rail (s1) --win-body (s2) --win-bar (s3) --win-line (line-3) --win-edge (edge)
     --win-recess (s1). Hook: add the window's selector to the window list below, OR class .dm-window. Apply them with the recipe in section 7.
   BUTTON tokens: --btn-blue --btn-blue-hi --btn-blue-lo (primary), --btn-lime* (Infrastructure), --btn-orange*, --btn-mkt*.
   Elevation by lightness only: no drop shadows, no glow, no backdrop blur on cards. Animations are never touched here.
   ========================================================================== */

:root[data-theme="dark"]{
  color-scheme: dark;

  /* surfaces (OKLCH in comments; every step 3.9 to 4.9 L) */
  --dk-deep:#000313;    /* 10.6% 0.044 260  footer, scrim base */
  --dk-canvas:#01061b;  /* 13.2% 0.049 263  page */
  --dk-s1:#04102b;      /* 18.1% 0.058 262  card on canvas, band */
  --dk-s2:#0c1a37;      /* 22.4% 0.060 263  card in a band, window body */
  --dk-s3:#172543;      /* 26.9% 0.059 264  menus, modals, window bars/panels, toggle disc */
  --dk-s4:#212f4d;      /* 30.8% 0.058 264  hover/pressed on s3 */
  --dk-line-1:#1f2c46;  /* 29.5% */
  --dk-line-2:#2a3953;  /* 34.3% */
  --dk-line-3:#364560;  /* 39.0% */
  --dk-edge:#465671;    /* 45.1% 0.049 261 */
  --dk-edge-hi:#5c6e8e; /* 53.6% 0.055 262 */
  --dk-control:#667694; /* 56.4% 0.050 263, 3:1 form boundary */
  --dk-light-top:rgba(190,210,255,.08);
  --dk-scrim:rgba(0,3,19,.72);
  --dk-header:rgba(1,6,27,.88);

  /* text */
  --text-primary:#d5dbe6;   /* 89% 0.016 263 */
  --text-secondary:#b0b8c5; /* 78.0% 0.021 260 */
  --text-muted:#9aa2b0;     /* 71.0% 0.022 262 */
  --dk-text-faint:#717884;  /* disabled/decoration only */
  --dk-placeholder:#8b91a0;

  /* accent tints (text, lines, icons) */
  --blue-text:#81aaf7;   --blue-text-hi:#93b8fa;
  --orange-text:#f39d5e;
  --green-text:#6bcf9d;
  --violet-text:#b09bee; --violet-text-hi:#bda9f3;
  --lime-text:#b2dc69;
  --red-text:#ea8885;    --red-text-hi:#f3a09d;
  --amber-text:#f8c655;
  --dk-link-hover:#a2c6fe;
  --dk-focus:#97bffe;

  /* buttons (the only place brand colour stays near full strength) */
  --btn-blue:#1a5cdf; --btn-blue-hi:#2063e6; --btn-blue-lo:#1756d1;
  --btn-lime:#acdf3f; --btn-lime-hi:#b8ed50; --btn-lime-lo:#a1d13c; --btn-lime-ink:#0c1503;
  --btn-orange:#fa7c20; --btn-orange-hi:#fd8638; --btn-orange-lo:#e8721c; --btn-orange-ink:#1a0d00;
  --btn-mkt:#096b95; --btn-mkt-hi:#1178a5; --btn-mkt-lo:#076289;

  /* stage (always-dark showpiece): three tones + one named display tone */
  --stage-top:#232e42;        /* 30.1% 0.040 262 */
  --stage-bot:#162032;        /* 24.3% 0.038 262 */
  --stage-plate:#2c384c;      /* 33.9% 0.039 260 */
  --stage-plate-hi:#364258;   /* 37.8% 0.041 262 */
  --stage-inset:#0d1627;      /* 20.1% 0.037 262, displays only */
  --stage-face-top:#323d52; --stage-face-bot:#273246;
  --stage-face-sel-top:#3b485f; --stage-face-sel-bot:#2e394e;
  --stage-edge:var(--dk-edge); --stage-edge-hi:var(--dk-edge-hi);

  /* window (mock app UI) */
  --win-rail:var(--dk-s1); --win-recess:var(--dk-s1); --win-body:var(--dk-s2); --win-bar:var(--dk-s3);
  --win-line:var(--dk-line-3); --win-edge:var(--dk-edge);

  /* semantic tokens the light CSS already reads */
  --bg-primary:var(--dk-canvas); --bg-secondary:var(--dk-s1); --band-alt:var(--dk-s1);
  --surface-solid:var(--dk-s1); --surface-glass:var(--dk-s1); --surface-glass-strong:var(--dk-s2);
  --surface-raised:var(--dk-s2); --surface-sunken:var(--dk-canvas); --console:var(--stage-bot);
  --glass-bg:var(--dk-s1); --glass-border:var(--dk-line-1); --glass-border-hover:var(--dk-line-3);
  --hairline:var(--dk-line-1); --hairline-strong:var(--dk-line-3);
  --tint-1:rgba(150,175,230,.05); --tint-2:rgba(150,175,230,.09);
  --grad-dark:linear-gradient(180deg,rgba(190,210,255,.025),rgba(190,210,255,0));
  --grad-primary:linear-gradient(var(--btn-blue),var(--btn-blue));
  --grad-orange:linear-gradient(var(--btn-orange),var(--btn-orange));
  --shadow-card:none; --shadow-hover:none; --shadow-pop:0 18px 40px -18px rgba(1,2,11,.7);
}

/* Bands: a section that paints --band-alt is s1, so the cards inside it step up one level (nested = next level up) */
:root[data-theme="dark"] :is(.iac-section,.service-alt,.home-section--alt,#voice-usecases,.sc-myths,.band-alt){
  --surface-solid:var(--dk-s2); --surface-glass:var(--dk-s2); --surface-glass-strong:var(--dk-s3);
  --surface-raised:var(--dk-s3); --surface-sunken:var(--dk-s1);
  --glass-bg:var(--dk-s2); --glass-border:var(--dk-line-2); --hairline:var(--dk-line-2);
}

/* Marketing: hue 241, its own five-level set. The generic names are re-pointed on body so every shared rule below follows it.
   (marketing.css keeps its own --mkt-* names for its page look; its area designer maps those onto these --dk-* tokens.) */
:root[data-theme="dark"] body.pillar-marketing{
  --dk-deep:#00030b; --dk-canvas:#000611; --dk-s1:#011422; --dk-s2:#081f2f; --dk-s3:#122a3b; --dk-s4:#1b3446;
  --dk-line-1:#173041; --dk-line-2:#223c4f; --dk-line-3:#2e495e;
  --dk-edge:#3b5a71; --dk-edge-hi:#5a7a92; --dk-control:#66808f; --dk-light-top:rgba(180,220,245,.08);
  --dk-scrim:rgba(0,3,11,.72); --dk-header:rgba(0,6,17,.88);
  --text-primary:#e4edf2; --text-secondary:#b2c0c9; --text-muted:#96a6af;
  --blue-text:#71c1e0; --blue-text-hi:#8ccce6; --dk-link-hover:#9ad4ea;
  --btn-blue:#096b95; --btn-blue-hi:#1178a5; --btn-blue-lo:#076289;
  --stage-top:#193243; --stage-bot:#0c2434; --stage-plate:#233c4e; --stage-plate-hi:#2d4759; --stage-inset:#041a28;
  --stage-face-top:#2a4256; --stage-face-bot:#1f3649; --stage-face-sel-top:#33506a; --stage-face-sel-bot:#284459;
  --tint-1:rgba(140,190,220,.05); --tint-2:rgba(140,190,220,.09);
  --grad-primary:linear-gradient(var(--btn-blue),var(--btn-blue));
  /* re-resolve everything that points at the tokens above */
  --bg-primary:var(--dk-canvas); --bg-secondary:var(--dk-s1); --band-alt:var(--dk-s1);
  --surface-solid:var(--dk-s1); --surface-glass:var(--dk-s1); --surface-glass-strong:var(--dk-s2);
  --surface-raised:var(--dk-s2); --surface-sunken:var(--dk-canvas); --console:var(--stage-bot);
  --glass-bg:var(--dk-s1); --glass-border:var(--dk-line-1); --glass-border-hover:var(--dk-line-3);
  --hairline:var(--dk-line-1); --hairline-strong:var(--dk-line-3);
  --stage-edge:var(--dk-edge); --stage-edge-hi:var(--dk-edge-hi);
  --win-rail:var(--dk-s1); --win-recess:var(--dk-s1); --win-body:var(--dk-s2); --win-bar:var(--dk-s3); --win-line:var(--dk-line-3); --win-edge:var(--dk-edge);
}
/* Marketing has no section bands (its tide runs under every section); its bands step up like the rest */
:root[data-theme="dark"] body.pillar-marketing :is(.iac-section,.service-alt,.home-section--alt,.band-alt){
  --surface-solid:var(--dk-s2); --surface-glass:var(--dk-s2); --surface-glass-strong:var(--dk-s3);
  --surface-raised:var(--dk-s3); --surface-sunken:var(--dk-s1); --glass-bg:var(--dk-s2); --glass-border:var(--dk-line-2); --hairline:var(--dk-line-2);
}
/* Infrastructure keeps the Engineering surfaces and swaps its own --inf-* tokens onto them (lime accent) */
:root[data-theme="dark"] body.pillar-infra{
  --inf-ink:var(--text-primary); --inf-ink-deep:var(--text-primary); --inf-ink-2:var(--text-secondary);
  --inf-lime-deep:var(--lime-text); --inf-tint:rgba(150,175,230,.05);
  --inf-line:var(--dk-line-1); --inf-line-strong:var(--dk-line-3);
}

/* ---- 1. Base, surface-only theme switch, focus, text rendering ---- */
:root[data-theme="dark"] body{ -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; background:var(--bg-primary); }
/* body type: antialiased off-white text. No global line-height rule (it would change layout); blog.css adds +0.05 for long reading. Fonts are static 400/700, so weights are unchanged. */
:root[data-theme="dark"] :focus-visible{ outline:2px solid var(--dk-focus); outline-offset:2px; }
/* Theme switch: surfaces fade for 200 ms, text/opacity/transform never (html.theme-switching is added by the toggle click only) */
html.theme-switching :where(*,*::before,*::after):not(.theme-toggle):not(.theme-toggle *){
  transition:background-color .2s ease-out,border-color .2s ease-out,box-shadow .2s ease-out,outline-color .2s ease-out,fill .2s ease-out,stroke .2s ease-out,filter .2s ease-out !important;
}
/* links in prose */
:root[data-theme="dark"] :is(.section-subtitle,.split-copy,.who-section,.sp-faq,.legal-body,.blog-body) p a:not(.btn){ color:var(--blue-text); text-underline-offset:3px; }
:root[data-theme="dark"] :is(.section-subtitle,.split-copy,.who-section,.sp-faq,.legal-body,.blog-body) p a:not(.btn):hover{ color:var(--dk-link-hover); }
/* images: dimmed, never inverted; SVG logos and icons are not filtered */
:root[data-theme="dark"] img:not([src$=".svg"]):not(.logo-image):not([data-keep]){ filter:brightness(.88) contrast(1.04) saturate(.92); transition:filter .25s; }
:root[data-theme="dark"] img:not([src$=".svg"]):not(.logo-image):not([data-keep]):is(:hover,:focus-visible){ filter:brightness(.96) contrast(1.04) saturate(.92); }
/* decorative layers: reduced, never removed (same size, so layout never moves) */
:root[data-theme="dark"] .tech-grid{ background-image:linear-gradient(to right,rgba(150,175,230,.04) 1px,transparent 1px),linear-gradient(to bottom,rgba(150,175,230,.04) 1px,transparent 1px); }
:root[data-theme="dark"] .orb-1{ background:radial-gradient(circle,rgba(0,98,255,.14) 0%,rgba(0,0,0,0) 70%); }
:root[data-theme="dark"] .orb-2{ background:radial-gradient(circle,rgba(255,107,0,.07) 0%,rgba(0,0,0,0) 70%); }
/* hero particles stay at full strength in dark: they are the signature animation, not background decoration (Mars, 23 Nov) */
:root[data-theme="dark"] .matrix-rain{ opacity:.35; }
:root[data-theme="dark"] .divider{ background:var(--hairline); }
/* tables, inline code */
:root[data-theme="dark"] th{ color:var(--text-secondary); background:var(--dk-s2); }
:root[data-theme="dark"] :is(td,th){ border-color:var(--dk-line-1); }
:root[data-theme="dark"] tbody tr:nth-child(even){ background:rgba(150,175,230,.03); }
:root[data-theme="dark"] :not(pre) > code{ background:var(--dk-s2); border:1px solid var(--dk-line-1); color:var(--text-primary); }
:root[data-theme="dark"] .range-slider::-webkit-slider-thumb,:root[data-theme="dark"] .range-slider::-moz-range-thumb{ background:var(--text-primary); box-shadow:none; }
:root[data-theme="dark"] .range-slider::-webkit-slider-runnable-track{ background:linear-gradient(90deg,var(--c) 0 var(--fill,10%),rgba(150,175,230,.16) var(--fill,10%) 100%); }
:root[data-theme="dark"] .range-slider::-moz-range-track{ background:rgba(150,175,230,.16); }
:root[data-theme="dark"] ::placeholder{ color:var(--dk-placeholder); opacity:1; }
:root[data-theme="dark"] ::-webkit-scrollbar-track{ background:var(--tint-1); }

/* ---- 2. Header ---- */
:root[data-theme="dark"] :is(.header-scrolled,.subpage-header){ background:var(--dk-header) !important; border-bottom-color:var(--dk-line-1) !important; }
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)){
  @keyframes shrinkHeaderDark{ to{ height:60px; background:var(--dk-header); border-bottom:1px solid var(--dk-line-1); backdrop-filter:blur(12px); } }
  :root[data-theme="dark"] #main-header{ animation-name:shrinkHeaderDark; }
}
@media (max-width:768px){ :root[data-theme="dark"] #main-header{ background:var(--dk-header) !important; } }
:root[data-theme="dark"] .logo-image text, :root[data-theme="dark"] svg.chat-brand-logo text{ fill:var(--blue-text); }
:root[data-theme="dark"] .nav-link:hover, :root[data-theme="dark"] .nav-group-toggle:hover{ color:var(--text-primary); }
/* mega menus, fly panels, dropdowns: s3 with a line-3 edge, one neutral ambient shadow */
@media (min-width:1200px){
  :root[data-theme="dark"] .nav-group-panel{ background:var(--dk-s3); border:1px solid var(--dk-line-3); box-shadow:var(--shadow-pop); }
}
:root[data-theme="dark"] .nav-fly-panel{ border-left-color:var(--dk-line-3); }
:root[data-theme="dark"] .nav-sub:hover, :root[data-theme="dark"] .nav-sub:focus-visible{ background:var(--dk-s4); }
:root[data-theme="dark"] .nav-sub-ico{ background:rgba(129,170,247,.14); color:var(--blue-text); }
:root[data-theme="dark"] .nav-sub-text strong{ color:var(--text-primary); }
:root[data-theme="dark"] .nav-sub-text small{ color:var(--text-muted); }
:root[data-theme="dark"] .nav-sub:hover .nav-sub-ico, :root[data-theme="dark"] .nav-fly.is-open > .nav-fly-toggle .nav-sub-ico{ background:rgba(243,157,94,.16); color:var(--orange-text); }
@media (min-width:1200px){ :root[data-theme="dark"] .nav-fly:hover > .nav-fly-toggle .nav-sub-ico{ background:rgba(243,157,94,.16); color:var(--orange-text); } }
:root[data-theme="dark"] .nav-fly.is-open > .nav-fly-toggle::before, :root[data-theme="dark"] .nav-fly-toggle:focus-visible::before{ background:var(--orange-text); box-shadow:none; }
:root[data-theme="dark"] .nav-group:hover > .nav-group-toggle, :root[data-theme="dark"] .nav-group.open > .nav-group-toggle{ color:var(--orange-text); }
@media (max-width:1199px){
  :root[data-theme="dark"] .nav-menu{ background:var(--dk-s3) !important; border-left-color:var(--dk-line-3) !important; }
  :root[data-theme="dark"] :is(.nav-link,.nav-group-panel){ border-bottom-color:var(--dk-line-2); }
}
:root[data-theme="dark"] .mobile-overlay{ background:var(--dk-scrim) !important; }
:root[data-theme="dark"] .hero-badge{ background:var(--tint-1); border-color:var(--dk-line-2); }
:root[data-theme="dark"] :is(.hero-badge span,.badge-brand){ color:var(--blue-text); }

/* ---- 3. Footer ---- */
:root[data-theme="dark"] footer{ background:var(--dk-deep) !important; border-top-color:var(--dk-line-1) !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
:root[data-theme="dark"] .footer-bottom-bar{ background:var(--dk-s1) !important; border-top-color:var(--dk-line-1) !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
:root[data-theme="dark"] .footer-bottom{ color:var(--text-secondary) !important; }
:root[data-theme="dark"] footer a{ color:var(--text-secondary); }
:root[data-theme="dark"] footer a:hover{ color:var(--text-primary); }
:root[data-theme="dark"] .footer-brand-link{ color:var(--blue-text); }
:root[data-theme="dark"] .footer-brand-link:hover{ color:var(--text-primary); }
:root[data-theme="dark"] .footer-brand-link.footer-brand-link-more{ color:var(--orange-text); }
:root[data-theme="dark"] .footer-brand-link.footer-brand-link-more:hover{ color:var(--text-primary); }
:root[data-theme="dark"] .status-indicator.chat-active :is(.status-chat-icon,.status-label){ color:var(--orange-text); }
:root[data-theme="dark"] .status-indicator.chat-active{ background:rgba(243,157,94,.14); border-color:rgba(243,157,94,.40); }

/* ---- 4. Chat panel ---- */
:root[data-theme="dark"] .gemini-chat-panel{ background:var(--dk-s3); border-color:var(--dk-edge); box-shadow:var(--shadow-pop),inset 0 1px 0 var(--dk-edge-hi); backdrop-filter:none; -webkit-backdrop-filter:none; }
:root[data-theme="dark"] :is(.chat-panel-header,.chat-input-bar){ border-color:var(--dk-line-3); }
:root[data-theme="dark"] .chat-msg.agent .chat-msg-bubble{ background:var(--dk-s4); color:var(--text-primary); }
:root[data-theme="dark"] .chat-msg.user .chat-msg-bubble{ background:var(--btn-blue); color:#fff; }
:root[data-theme="dark"] .chat-input-bar input{ background:var(--dk-s1); border:1px solid var(--dk-control); color:var(--text-primary); }
:root[data-theme="dark"] .chat-input-bar input:focus{ border-color:var(--blue-text); outline:2px solid var(--dk-focus); outline-offset:0; box-shadow:none; }
:root[data-theme="dark"] .chat-panel-close:hover{ background:var(--dk-s4); }

/* ---- 5. Buttons: no white or pale button in dark; hover is the next step lighter, never brightness() ---- */
:root[data-theme="dark"] .btn-primary{ background:var(--btn-blue); background-image:none; color:#fff; box-shadow:none; }
:root[data-theme="dark"] .btn-primary:hover{ background:var(--btn-blue-hi); box-shadow:none; }
:root[data-theme="dark"] .btn-primary:active{ background:var(--btn-blue-lo); }
:root[data-theme="dark"] .btn-primary:disabled{ background:rgba(26,92,223,.30); color:var(--dk-text-faint); }
:root[data-theme="dark"] .btn-secondary{ background:rgba(150,175,230,.05); border-color:var(--dk-line-3); color:var(--text-primary); }
:root[data-theme="dark"] .btn-secondary:hover{ background:rgba(150,175,230,.10); border-color:var(--dk-edge); }
:root[data-theme="dark"] .btn-secondary:active{ background:rgba(150,175,230,.03); }
/* Infrastructure: lime primary. Hero, closing card, #inf-nbn-go, #btn-submit-form and the pillar's .web-modal are all .btn-primary. */
:root[data-theme="dark"] body.pillar-infra :is(main,.web-modal) .btn-primary{ background:var(--btn-lime); background-image:none; color:var(--btn-lime-ink); border-color:var(--btn-lime); box-shadow:none; }
:root[data-theme="dark"] body.pillar-infra :is(main,.web-modal) .btn-primary:hover{ background:var(--btn-lime-hi); border-color:var(--btn-lime-hi); color:var(--btn-lime-ink); box-shadow:none; }
:root[data-theme="dark"] body.pillar-infra :is(main,.web-modal) .btn-primary:active{ background:var(--btn-lime-lo); border-color:var(--btn-lime-lo); }
:root[data-theme="dark"] body.pillar-infra :is(main,.web-modal) .btn-primary:disabled{ background:rgba(172,223,63,.25); color:var(--dk-text-faint); border-color:transparent; }
/* Marketing keeps its own primary: --btn-blue is already #096b95 on body.pillar-marketing */

/* ---- 6. Cards: lit top edge instead of a shadow; no backdrop blur; hover = +1 level ---- */
:root[data-theme="dark"] :is(.glass-card,.usecase-item,.contact-detail-card,.capability-card,.related-card,.rufen-collapse-card){
  background:var(--glass-bg); border-color:var(--glass-border); box-shadow:inset 0 1px 0 var(--dk-light-top);
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
:root[data-theme="dark"] .glass-card:hover{ background:var(--surface-raised); border-color:var(--glass-border-hover); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .usecase-item:hover{ background:var(--surface-raised); border-color:var(--glass-border-hover); }
:root[data-theme="dark"] :is(.service-cta-card,.ownership-block,.related-card,.workflow-step,.extended-service-block,.saas-bleed-card){ background:var(--glass-bg); border-color:var(--glass-border); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] :is(.workflow-step:hover,.workflow-step.is-focus,.agent-btn.active,.ownership-block:hover){ background:var(--surface-raised); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .agent-btn:hover{ box-shadow:none; background:var(--surface-raised); }
:root[data-theme="dark"] .agent-selector-list::-webkit-scrollbar-track{ background:var(--tint-1); }
:root[data-theme="dark"] .feature-card-front{ background:var(--glass-bg); }
:root[data-theme="dark"] .feature-card-wrapper:hover .feature-card-front{ box-shadow:none; background:var(--surface-raised); }
:root[data-theme="dark"] .saas-bleed-card{ color:var(--text-primary); }
:root[data-theme="dark"] .saas-bleed-card i, :root[data-theme="dark"] :is(.ticker-value,.legacy-cost,.form-error-message){ color:var(--red-text); }
:root[data-theme="dark"] :is(.saas-ticker-wrapper,.compare-head){ border-bottom-color:var(--hairline); }
:root[data-theme="dark"] :is(.compare-row + .compare-row,.sandbox-section-subpage,.who-section + .who-section){ border-top-color:var(--hairline); }

/* ---- 7. Forms (contact card is a window-like surface: its fields are recesses one level down) ---- */
:root[data-theme="dark"] .contact-card{ background:var(--dk-s1); border-color:var(--dk-line-2); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .contact-section .contact-card{ animation-name:contactBreatheDark; box-shadow:inset 0 1px 0 var(--dk-light-top); }
@keyframes contactBreatheDark{ from{ border-color:var(--dk-line-2); } to{ border-color:var(--dk-edge); } }   /* the slow border breathing stays; the grey glow goes */
@media (prefers-reduced-motion: reduce){ :root[data-theme="dark"] .contact-section .contact-card{ animation:none; box-shadow:inset 0 1px 0 var(--dk-light-top); } }
:root[data-theme="dark"] :is(.contact-card input,.contact-card select,.contact-card textarea){ background-color:var(--dk-canvas) !important; color:var(--text-primary); border-color:var(--dk-control); }
:root[data-theme="dark"] :is(.form-group input,.form-group textarea){ background:var(--surface-sunken); border-color:var(--dk-control); color:var(--text-primary); }
:root[data-theme="dark"] :is(.form-group input,.form-group textarea):focus{ background:var(--surface-sunken); border-color:var(--blue-text); outline:2px solid var(--dk-focus); outline-offset:0; box-shadow:none; }
:root[data-theme="dark"] .form-group label{ color:var(--text-secondary); }
:root[data-theme="dark"] :is(.form-group input:focus + label,.form-group input:not(:placeholder-shown) + label,.form-group textarea:focus + label,.form-group textarea:not(:placeholder-shown) + label){ color:var(--blue-text); background:var(--dk-s1); }   /* the light rule paints a white chip behind the floated label (R3) */
:root[data-theme="dark"] input:-webkit-autofill{ -webkit-box-shadow:0 0 0 1000px var(--dk-s2) inset; -webkit-text-fill-color:var(--text-primary); }
:root[data-theme="dark"] :is(input[type="checkbox"],input[type="radio"]){ accent-color:var(--btn-blue); }
:root[data-theme="dark"] .closing-half + .closing-half{ border-top-color:var(--dk-line-3); }
:root[data-theme="dark"] .form-error-message{ color:var(--red-text); }

/* ---- 8. Section bands ---- */
:root[data-theme="dark"] :is(.iac-section,.service-alt,.home-section--alt,#voice-usecases){ background:var(--band-alt); }
:root[data-theme="dark"] :is(.live-stream-section,.sandbox-section){ border-color:var(--dk-line-1); }
:root[data-theme="dark"] :is(.iac-section,.service-alt,.home-section--alt){ box-shadow:inset 0 1px 0 var(--dk-line-1),inset 0 -1px 0 var(--dk-line-1); }   /* the join line: inset, so no layout change */
:root[data-theme="dark"] .gradient-text{ background-image:linear-gradient(135deg,#d5dbe6 30%,#81aaf7 100%); text-shadow:none; }

/* ---- 9. STAGE: every always-dark showpiece is a lit object lighter than the page (design system section c). ----
   Hosts: canvas, a band (s1) or an s1 card. Never inside an s2+ host. Nothing inside is darker than --stage-inset (L 20.1).
   IDs never share an :is() list with classes that carry states (specificity ledger). */
/* accent scope: inside a stage or a window the three brand accents read as the soft tints, so every colour/stroke/fill that reads
   var(--accent-*) in an area's CSS is automatically right. (Solid fills with white ink must use the badge fills instead.) */
:root[data-theme="dark"] :is(.iac-diagram-card,.sandbox-console-wrapper,.sandbox-builder-wrapper,.inf-flow,.ip-console,.int-map,#ai-agents .esb-showcase,#our-pilot .esb-showcase,.aid-log,.bxa-room,.cta-shift,.ir-cabinet,.dm-stage,.ai-win,.ad-screen,.kt-app,#ac-console,.hs-con,#hr-log,.mkt-browser,.dm-window){
  --accent-blue:#81aaf7; --accent-orange:#f39d5e; --accent-green:#6bcf9d; --accent-violet:#b09bee;
  color:var(--text-primary);
}
/* 9.1 shells */
:root[data-theme="dark"] :is(.iac-diagram-card,.sandbox-console-wrapper,.sandbox-builder-wrapper,.inf-flow,.ip-console,.int-map,#ai-agents .esb-showcase,#our-pilot .esb-showcase,.aid-log,.bxa-room,.dm-stage){
  background-color:var(--stage-bot);
  background-image:linear-gradient(180deg,var(--stage-top) 0%,var(--stage-bot) 100%);
  border-color:var(--stage-edge);
  box-shadow:inset 0 1px 0 var(--stage-edge-hi);
  -webkit-backdrop-filter:none; backdrop-filter:none;
  color:var(--text-primary);
}
:root[data-theme="dark"] .cta-shift{ border-color:var(--stage-edge); box-shadow:inset 0 1px 0 var(--stage-edge-hi); }   /* the sky layers are its background */
/* 9.2 shells that have no border in light: ring, never a new border */
:root[data-theme="dark"] .ir-cabinet{
  background-color:var(--stage-bot);
  background-image:radial-gradient(circle,rgba(190,210,255,.22) 1.4px,transparent 1.8px),radial-gradient(circle,rgba(190,210,255,.22) 1.4px,transparent 1.8px),linear-gradient(180deg,var(--stage-top),var(--stage-bot));
  background-size:10px 12px,10px 12px,100% 100%;
  background-position:8px 6px,calc(100% - 8px) 6px,0 0;
  background-repeat:repeat-y,repeat-y,no-repeat;
  box-shadow:inset 0 0 0 1px var(--stage-edge),inset 0 1px 0 var(--stage-edge-hi);
}
:root[data-theme="dark"] .bxa-room{
  --ink:var(--stage-bot); --ink-2:var(--stage-plate); --ink-3:var(--stage-plate-hi);
  --bone:var(--text-primary); --brass:#d4a672; --hair:var(--dk-line-3);
  outline:1px solid var(--stage-edge); outline-offset:-1px; box-shadow:none;
}
/* 9.3 parts at rest: plates, lighter than the host. Every member is ONE class. */
:root[data-theme="dark"] :is(.iac-tab-card,.inf-stage-ico,.inf-stage-body,.ip-dev,.ip-stat,.palette-group,.int-mcp,.bxa-panel,.sandbox-console-header,.int-bubble-ai,.drag-pill){
  background:var(--stage-plate); border-color:var(--dk-edge); box-shadow:none;
}
:root[data-theme="dark"] :is(.inf-flow-bar,.inf-flow-foot,.ip-console-bar,.int-mcp-head,.aid-log-head){ background:var(--stage-plate); border-color:var(--dk-edge); }
:root[data-theme="dark"] .ir-unit{ background:linear-gradient(180deg,var(--stage-face-top),var(--stage-face-bot)); border-color:var(--dk-edge); box-shadow:none; }
:root[data-theme="dark"] .ir-screw{ background:radial-gradient(circle at 35% 35%,#aab4c8,#586888); }
/* 9.4 part states: one class heavier than rest (0,4,0 vs 0,3,0) */
:root[data-theme="dark"] :is(.iac-tab-card.active,.iac-tab-card:hover,.drag-pill:hover){ background:var(--stage-plate-hi); border-color:var(--stage-active-edge,var(--dk-edge-hi)); box-shadow:none; }
:root[data-theme="dark"] .inf-stage.is-active .inf-stage-ico{ background:var(--stage-plate-hi); border-color:var(--lime-text); color:var(--lime-text); box-shadow:0 0 0 1px rgba(178,220,105,.40); }
:root[data-theme="dark"] :is(.ir-unit:hover,.ir-unit[aria-selected="true"]){ background:linear-gradient(180deg,var(--stage-face-sel-top),var(--stage-face-sel-bot)); border-color:var(--lime-text); box-shadow:none; }
:root[data-theme="dark"] .ip-dev.is-warn{ background:rgba(248,198,85,.08); border-color:rgba(248,198,85,.45); }
:root[data-theme="dark"] .ip-dev.is-down{ background:rgba(234,136,133,.09); border-color:rgba(234,136,133,.50); }
:root[data-theme="dark"] .iac-tab-card[data-target="iaas"].active{ --stage-active-edge:#0062ff; }   /* How it all connects keeps its neon in dark (Mars, 23 Nov) */
:root[data-theme="dark"] .iac-tab-card[data-target="workloads"].active{ --stage-active-edge:#10b981; }
:root[data-theme="dark"] .iac-tab-card[data-target="assistants"].active{ --stage-active-edge:#ff6b00; }
:root[data-theme="dark"] .iac-tab-card h4{ color:#fff; }
:root[data-theme="dark"] .iac-tab-card.active h4{ color:#4d94ff; }
:root[data-theme="dark"] .iac-tab-card[data-target="workloads"].active h4{ color:#10b981; }
:root[data-theme="dark"] .iac-tab-card[data-target="assistants"].active h4{ color:#ff7a1a; }
/* tab card internals (home + sandbox diagram) */
:root[data-theme="dark"] .iac-tab-card .card-icon{ background:rgba(150,175,230,.10); border:1px solid var(--dk-line-3); color:#fff; box-shadow:none; }
:root[data-theme="dark"] .iac-tab-card.active .card-icon{ background:#0062ff; border-color:#0062ff; color:#fff; }
:root[data-theme="dark"] .iac-tab-card[data-target="workloads"].active .card-icon{ background:#10b981; border-color:#10b981; color:#fff; }
:root[data-theme="dark"] .iac-tab-card[data-target="assistants"].active .card-icon{ background:#ff6b00; border-color:#ff6b00; color:#fff; }
:root[data-theme="dark"] .iac-tab-card p{ color:#fff; }
:root[data-theme="dark"] .iac-tab-card .card-tags span{ background:rgba(150,175,230,.10); color:#fff; border-color:var(--dk-line-3); }
/* 9.5 displays (the only inset; IDs alone in their own rule) */
:root[data-theme="dark"] :is(#transcript-log,#result-box-container){ background:var(--stage-inset); border:1px solid var(--dk-line-2); box-shadow:inset 0 1px 3px rgba(1,2,11,.45); }
:root[data-theme="dark"] :is(.terminal-logs-window,.voice-waveform-container){ background:var(--stage-inset); border:1px solid var(--dk-line-2); box-shadow:inset 0 1px 3px rgba(1,2,11,.45); }
:root[data-theme="dark"] .flow-node{ background:var(--stage-inset); border-color:var(--dk-line-3); }
:root[data-theme="dark"] .dialer-panel input{ background:var(--stage-plate); border:1px solid var(--dk-control); color:var(--text-primary); }
/* 9.6 the diagram's SVG (home #how-it-connects and sandbox). Presentation attributes lose to CSS, so no HTML edit.
   Both spellings of every rgba(): the markup mixes "rgba(0, 98, 255, 0.15)" and "rgba(0,98,255,0.2)". */
:root[data-theme="dark"] .iac-svg :is(rect,path)[stroke^="rgba(255,255,255"]{ stroke:rgba(150,175,230,.30); }
:root[data-theme="dark"] .iac-svg path[stroke^="rgba(255, 255, 255"]{ stroke:rgba(150,175,230,.10); }
:root[data-theme="dark"] .iac-svg :is(rect,path,circle)[fill^="rgba(255,255,255,0.0"]{ fill:rgba(150,175,230,.07); }
:root[data-theme="dark"] .iac-svg circle[fill="#475569"]{ fill:#6c7e9d; }
:root[data-theme="dark"] .iac-svg circle[stroke="#475569"]{ stroke:#6c7e9d; }
:root[data-theme="dark"] .iac-svg text:is([fill="#fff"],[fill="rgba(255,255,255,0.85)"]){ fill:#fff; }   /* neon diagram: white labels, original strokes/packets/glows (Mars, 23 Nov) */
:root[data-theme="dark"] .iac-svg text:is([fill="#94a3b8"],[fill^="rgba(255,255,255,0.3"],[fill^="rgba(255,255,255,0.4"],[fill^="rgba(255,255,255,0.5"]){ fill:rgba(255,255,255,.85); }
:root[data-theme="dark"] .iac-svg .hotspot-tooltip rect{ fill:var(--stage-plate-hi); stroke:var(--dk-edge-hi); }
:root[data-theme="dark"] .line-muted{ stroke:#586a8a; }
/* How it all connects keeps the neon accents in dark: lines, packets and glows read the light accent values (Mars, 23 Nov) */
:root[data-theme="dark"] :is(.iac-diagram-card,.iac-svg){ --accent-blue:#0062ff; --accent-orange:#ff6b00; --accent-green:#10b981; }
:root[data-theme="dark"] .iac-svg .hotspot-core{ stroke:#fff; }

/* ---- 10. WINDOW (mock app UI that is white in light): three levels only. Area designers apply the tokens to their own parts. ----
   frame --win-edge + inset top highlight; body --win-body (s2); title bar/panels --win-bar (s3) with --win-line borders;
   rail, inputs and named recesses --win-recess (s1) with a --dk-line-2 or --dk-control border. Hover/selected are tints, never a 4th level.
   Window sits on canvas, a band (s1) or an s1 card; on an s2+ host shift it up one level (body s3, panels s4, recesses s2). */
:root[data-theme="dark"] .dm-window{ background:var(--win-body); border:1px solid var(--win-edge); box-shadow:inset 0 1px 0 var(--dk-edge-hi); color:var(--text-primary); }
:root[data-theme="dark"] .dm-win-bar{ background:var(--win-bar); border-bottom:1px solid var(--win-line); color:var(--text-primary); }
:root[data-theme="dark"] .dm-win-panel{ background:var(--win-bar); border:1px solid var(--win-line); color:var(--text-primary); }
:root[data-theme="dark"] .dm-win-recess{ background:var(--win-recess); border:1px solid var(--dk-line-2); color:var(--text-primary); }
:root[data-theme="dark"] .dm-win-input{ background:var(--win-recess); border:1px solid var(--dk-control); color:var(--text-primary); }
:root[data-theme="dark"] .dm-win-row{ border-bottom:1px solid var(--dk-line-2); }
:root[data-theme="dark"] .dm-win-row:hover{ background:rgba(129,170,247,.08); }
:root[data-theme="dark"] .dm-win-row.is-selected{ background:rgba(129,170,247,.14); box-shadow:inset 2px 0 0 var(--blue-text); }
/* status badges: the only solid saturated fills allowed in a window (white ink) */
:root[data-theme="dark"] :is(.dm-badge-ok){ background:#01764c; color:#fff; }
:root[data-theme="dark"] :is(.dm-badge-info){ background:#147175; color:#fff; }
:root[data-theme="dark"] :is(.dm-badge-alert){ background:#a8353a; color:#fff; }
:root[data-theme="dark"] :is(.dm-badge-warn){ background:#946903; color:#fff; }
:root[data-theme="dark"] .iac-tab-card.active .card-tags span{ color:var(--text-primary); }
/* the small "RUFEN AI SYSTEMS" caption under the diagram: a dark pill with white ink in light; here a plain raised label (no shadow) on the band */
:root[data-theme="dark"] .iac-label span{ background:var(--surface-raised); border-color:var(--hairline-strong); color:var(--text-primary); box-shadow:none; }

/* ---- 11. Theme toggle (light: blue moon on a pale blue disc; dark: yellow sun on a slate disc with a gold ring) ----
   Markup is generated (tools/site_chrome.py THEME_BTN, and functions/blog/render.js for the blog): both icons are always in the DOM
   (.ti-moon, .ti-sun with <g class="ti-rays">) and swap with a rotate + fade. The disc carries its own colours in every state,
   so it reads the same over a light header, a dark header and the Marketing hero. Geometry (36 / 32 / 26px) is unchanged. */
.theme-toggle{display:inline-grid;place-items:center;width:36px;height:36px;padding:0;margin:0;border-radius:50%;border:0;background:transparent;color:#0062ff;cursor:pointer;flex:none;transition:transform .15s ease}   /* no disc or ring: the moon/sun sits in the header itself (Mars, 23 Nov) */
.theme-toggle:hover{transform:translateY(-1px)}
.theme-toggle:focus-visible{outline:2px solid #0062ff;outline-offset:2px}
.theme-toggle svg{grid-area:1/1;width:20px;height:20px;display:block;transition:opacity .28s ease,transform .35s cubic-bezier(.3,1.2,.5,1)}
.theme-toggle .ti-moon{fill:rgba(0,98,255,.18);opacity:1;transform:rotate(0) scale(1)}
.theme-toggle:hover .ti-moon{transform:rotate(-14deg) scale(1.08)}
.theme-toggle .ti-sun{color:#ffcd46;fill:none;opacity:0;transform:rotate(-80deg) scale(.5)}
.theme-toggle .ti-sun circle{fill:#ffcd46}
.theme-toggle .ti-rays{transform-origin:center;transition:transform .3s ease}
/* Header fit: at 1200-1535px the nav has 9-95px of slack, so the toggle sits in the
   container's 40px right padding (6px gap, 26px circle, 8px to the edge) and takes no flow space. */
@media (min-width:1200px) and (max-width:1535px){
  .header-actions{position:relative}
  .header-actions .theme-toggle{position:absolute;left:calc(100% + 6px);top:50%;margin:-13px 0 0 0;width:26px;height:26px}
  .header-actions .theme-toggle svg{width:14px;height:14px}
}
/* Tablet/phone header (drawer): slightly smaller so sandbox + toggle + menu fit at 360px */
@media (max-width:1199px){.theme-toggle{width:32px;height:32px}.theme-toggle svg{width:16px;height:16px}}
:root[data-theme="dark"] .theme-toggle,
html:root[data-theme="dark"] body.pillar-marketing #main-header .theme-toggle{background:transparent;border:0;color:#ffcd46}
:root[data-theme="dark"] .theme-toggle:hover,
html:root[data-theme="dark"] body.pillar-marketing #main-header .theme-toggle:hover{background:transparent;color:#ffcd46}
:root[data-theme="dark"] .theme-toggle:focus-visible,
html:root[data-theme="dark"] body.pillar-marketing #main-header .theme-toggle:focus-visible{outline:2px solid #ffcd46;outline-offset:2px}
:root[data-theme="dark"] .theme-toggle .ti-moon{opacity:0;transform:rotate(80deg) scale(.5)}
:root[data-theme="dark"] .theme-toggle .ti-sun{opacity:1;transform:rotate(0) scale(1)}
:root[data-theme="dark"] .theme-toggle:hover .ti-rays{transform:rotate(20deg)}
@media (prefers-reduced-motion:reduce){.theme-toggle,.theme-toggle svg,.theme-toggle .ti-rays{transition:none !important}.theme-toggle:hover,.theme-toggle:hover .ti-moon{transform:none}}

/* ---- 12. Pages whose own CSS file is not in the foundation area (home, who we are, voice agents, infrastructure hero, sandbox demo).
   Kept here as the shared safety net, written with the tokens above. The area that owns the page's CSS may refine or replace them. ---- */
/* index: pillars, steps, links */
:root[data-theme="dark"] .pillar-card--eng{ --pillar-accent:var(--blue-text); }
:root[data-theme="dark"] .pillar-card--mkt{ --pillar-accent:#71c1e0; }
:root[data-theme="dark"] .pillar-card--inf{ --pillar-accent:var(--lime-text); }
:root[data-theme="dark"] .pillar-head--engineering .pillar-label{ color:var(--blue-text); }
:root[data-theme="dark"] .pillar-head--marketing .pillar-label{ color:#71c1e0; }
:root[data-theme="dark"] .pillar-head--infrastructure .pillar-label{ color:var(--lime-text); }
:root[data-theme="dark"] .home-step-num{ color:var(--blue-text); }
:root[data-theme="dark"] .home-section details a{ color:var(--blue-text); }
:root[data-theme="dark"] :is(.highlight-text,.tw-caret,.card-punchy,.container-staff .slider-label,#val-staff,.agentic-cost,.detail-card-info p a:hover,.info-item p a:hover){ color:var(--blue-text); }
:root[data-theme="dark"] .chat-bubble.agent .speaker{ color:var(--blue-text); }
:root[data-theme="dark"] .chat-bubble.customer .speaker{ color:var(--violet-text); }

/* index + sandbox: the tabbed demo is a WINDOW on the canvas: frame s2, bar s3, panels s3, recesses s1 */
:root[data-theme="dark"] .sandbox-wrapper{ background:var(--win-body); border-color:var(--win-edge); box-shadow:inset 0 1px 0 var(--dk-edge-hi); }
:root[data-theme="dark"] .sandbox-tabs{ background:var(--win-bar); border-bottom-color:var(--win-line); }
:root[data-theme="dark"] .tab-btn{ color:var(--text-secondary); }
:root[data-theme="dark"] .tab-btn:hover{ background:rgba(129,170,247,.08); color:var(--text-primary); }
:root[data-theme="dark"] .tab-btn.active{ background:var(--win-body); color:var(--blue-text); border-bottom-color:var(--blue-text); }
:root[data-theme="dark"] .sandbox-content{ background:var(--win-body); }
:root[data-theme="dark"] :is(.call-status-box,.crm-status-strip,.console-header,.canvas-header,.calc-results-header){ background:var(--win-bar); border-color:var(--win-line); }
:root[data-theme="dark"] .crm-status-strip.active{ color:var(--blue-text); }
:root[data-theme="dark"] :is(.voice-log-console,.workflow-canvas-pane,.calc-results-pane){ background:var(--win-bar); border-color:var(--win-line); }
:root[data-theme="dark"] :is(.console-footer,.voice-log-console.show-summary .console-footer){ background:var(--win-recess); border-top-color:var(--dk-line-2); }
:root[data-theme="dark"] .chat-bubble.customer{ background:var(--win-recess); border-color:var(--dk-line-2); }
:root[data-theme="dark"] .chat-bubble .translation{ color:var(--text-primary) !important; border-top-color:var(--dk-line-3); }
:root[data-theme="dark"] .lang-options{ background:var(--win-recess); border:1px solid var(--dk-line-2); }
:root[data-theme="dark"] .lang-btn{ background:var(--win-bar); border-color:var(--dk-line-3); color:var(--text-secondary); }
:root[data-theme="dark"] .lang-btn:hover{ background:var(--dk-s4); color:var(--text-primary); }
:root[data-theme="dark"] .lang-btn.active{ background:rgba(129,170,247,.14); color:var(--blue-text); border-color:rgba(129,170,247,.55); box-shadow:none; }
:root[data-theme="dark"] .lang-tag{ background:var(--tint-2); }
:root[data-theme="dark"] .voice-waveform{ background:var(--win-recess); border-color:var(--dk-line-2); }
:root[data-theme="dark"] :is(.summary-item,.system-event,.preset-btn){ background:var(--win-recess); border-color:var(--dk-line-2); }
:root[data-theme="dark"] .preset-btn:hover{ background:var(--dk-s4); border-color:var(--dk-line-3); }
:root[data-theme="dark"] .node-block{ background:var(--win-bar); border-color:var(--dk-line-3); box-shadow:none; }
:root[data-theme="dark"] .node-block i{ color:var(--blue-text); }
:root[data-theme="dark"] :is(.node-connector,.cost-bar,.cap-progress span){ background:var(--tint-2); }
:root[data-theme="dark"] .calc-results-pane .calc-assumptions{ border-top-color:var(--dk-line-2); }
:root[data-theme="dark"] .tab-btn.active i, :root[data-theme="dark"] .tab-btn.active svg{ color:var(--blue-text); }

/* Who we are: every page-level text colour set in who.css / who-extra.css / who-we-are.html */
:root[data-theme="dark"] :is(.who-hero h1,.who-lead,.who-section h3,.scroll-block h2,.who-step h3,.who-content-panel h2,.who-title-text h2,.wo-row-title){ color:var(--text-primary); }
:root[data-theme="dark"] :is(.who-body,.who-section p,.who-section .section-subtitle,.scroll-block p,.who-step p,.who-content-panel .section-subtitle,.who-title-text .section-subtitle,#sec-mission p){ color:var(--text-secondary); }
:root[data-theme="dark"] .who-role{ color:var(--blue-text) !important; }
:root[data-theme="dark"] .who-link{ color:var(--blue-text); }
:root[data-theme="dark"] #crew :is(.who-you .who-link,.who-you .who-role){ color:var(--orange-text) !important; }
:root[data-theme="dark"] .scroll-block .highlight-text{ color:var(--blue-text); }
:root[data-theme="dark"] .who-tag, :root[data-theme="dark"] .who-section sup.ai-mark{ color:var(--violet-text); }
:root[data-theme="dark"] .who-tag{ background:rgba(176,155,238,.12); border-color:rgba(176,155,238,.40); }
:root[data-theme="dark"] :is(.who-tag--person,#crew .who-you .who-tag--you){ color:var(--orange-text); background:rgba(243,157,94,.12); border-color:rgba(243,157,94,.40); }
:root[data-theme="dark"] .who-badge{ color:var(--blue-text); background:rgba(129,170,247,.10); border-color:rgba(129,170,247,.35); }
:root[data-theme="dark"] .who-badge-green{ color:var(--green-text); background:rgba(107,207,157,.10); border-color:rgba(107,207,157,.35); }
:root[data-theme="dark"] .who-badge-orange{ color:var(--orange-text); background:rgba(243,157,94,.10); border-color:rgba(243,157,94,.35); }
:root[data-theme="dark"] .who-badge-purple{ color:var(--violet-text); background:rgba(176,155,238,.10); border-color:rgba(176,155,238,.35); }
:root[data-theme="dark"] .canvas-legend{ background:var(--dk-s2); border-color:var(--dk-line-3); color:var(--text-secondary); }
/* mission flip cards: dark faces on desktop (front s1 on canvas, back one level up) */
:root[data-theme="dark"] .flip-card-front{ background:var(--dk-s1); border-color:var(--dk-line-3); color:var(--text-primary); }
:root[data-theme="dark"] .flip-card-back{ background:var(--dk-s2); border-color:var(--dk-line-3); color:var(--text-primary); }
:root[data-theme="dark"] .feature-item:hover .flip-card-front{ border-color:transparent; }
:root[data-theme="dark"] :is(.flip-card-front h5,.flip-card-back h5){ color:var(--text-primary); }
:root[data-theme="dark"] :is(.flip-card-front p,.flip-card-back p){ color:var(--text-secondary); }
:root[data-theme="dark"] :is(.flip-card-front,.flip-card-back) [style*="accent-blue"]{ color:var(--blue-text) !important; }
:root[data-theme="dark"] :is(.flip-card-front,.flip-card-back) [style*="accent-orange"]{ color:var(--orange-text) !important; }
@media (max-width:992px){   /* phone/tablet: the faces get a tinted body, blue at rest and orange when flipped; card 2 swaps */
  :root[data-theme="dark"] :is(.flip-card-front,.feature-grid .feature-item:nth-child(2) .flip-card-back){ background:linear-gradient(145deg,rgba(129,170,247,.16) 0%,rgba(129,170,247,.05) 100%),var(--dk-s2); border-color:rgba(129,170,247,.32); box-shadow:inset 0 1px 0 var(--dk-light-top); }
  :root[data-theme="dark"] :is(.flip-card-back,.feature-grid .feature-item:nth-child(2) .flip-card-front){ background:linear-gradient(145deg,rgba(243,157,94,.16) 0%,rgba(243,157,94,.05) 100%),var(--dk-s2); border-color:rgba(243,157,94,.34); box-shadow:inset 0 1px 0 var(--dk-light-top); }
  :root[data-theme="dark"] .feature-item:hover .flip-card-front{ border-color:rgba(129,170,247,.32); }
  :root[data-theme="dark"] .feature-grid .feature-item:nth-child(2):hover .flip-card-front{ border-color:rgba(243,157,94,.34); }
  :root[data-theme="dark"] :is(.flip-card-back,.feature-grid .feature-item:nth-child(2) .flip-card-front) :is(i,svg){ color:var(--orange-text) !important; }
  :root[data-theme="dark"] :is(.flip-card-front,.feature-grid .feature-item:nth-child(2) .flip-card-back) :is(i,svg){ color:var(--blue-text) !important; }
}
/* the crew: the office photo takes a navy wash; cards are dark */
:root[data-theme="dark"] .who-crew-bg::after{ background:linear-gradient(180deg,rgba(1,6,27,.88) 0%,rgba(1,6,27,.80) 45%,rgba(1,6,27,.90) 100%); }
:root[data-theme="dark"] .who-pip{ border-color:var(--dk-edge); box-shadow:none; filter:brightness(.8); }
:root[data-theme="dark"] #crew .who-crew-grid .who-agent{ background:var(--dk-s2); border-color:var(--dk-line-3); backdrop-filter:none; -webkit-backdrop-filter:none; }
:root[data-theme="dark"] #crew .who-crew-grid .who-agent.who-you{ background:linear-gradient(140deg,rgba(243,157,94,.16) 0%,var(--dk-s2) 55%); border-color:rgba(243,157,94,.55) !important; box-shadow:none; }
:root[data-theme="dark"] #crew .who-you::after{ background:linear-gradient(105deg,transparent 35%,rgba(190,210,255,.08) 50%,transparent 65%); background-size:250% 100%; background-position:130% 0; }
:root[data-theme="dark"] .who-you-mark{ border-color:var(--dk-line-3); color:var(--text-muted); }
:root[data-theme="dark"] #crew .who-agent > .who-you-mark{ color:var(--orange-text); border-color:rgba(243,157,94,.6); background:rgba(243,157,94,.10); }
:root[data-theme="dark"] :is(.wo-btn,.wo-all > summary){ background:var(--dk-s2); border-color:var(--dk-line-3); color:var(--text-primary); }
:root[data-theme="dark"] :is(.wo-btn:hover,.wo-all > summary:hover){ color:var(--blue-text); border-color:rgba(129,170,247,.5); background:var(--dk-s3); }
:root[data-theme="dark"] .wo-row-title{ color:var(--text-secondary); }
:root[data-theme="dark"] .wo-row-title::after{ background:var(--dk-line-3); }
:root[data-theme="dark"] .wo-stage :focus-visible{ outline-color:var(--dk-focus); }

/* Voice Agents: the phone-system panel is an always-dark object in light (graphite), so it is a stage here (host: canvas section) */
:root[data-theme="dark"] .va-base{ background-color:var(--stage-bot); background-image:linear-gradient(180deg,var(--stage-top),var(--stage-bot)); border-color:var(--stage-edge); box-shadow:inset 0 1px 0 var(--stage-edge-hi); color:var(--text-primary); }
:root[data-theme="dark"] .va-base:hover{ border-color:var(--blue-text); }
:root[data-theme="dark"] .va-base-list span{ color:var(--text-primary); }
:root[data-theme="dark"] :is(.va-base-list svg,.va-base-more){ color:var(--blue-text); }
:root[data-theme="dark"] .va-pipe{ background:linear-gradient(90deg,rgba(129,170,247,.55),rgba(129,170,247,.35)); }
:root[data-theme="dark"] .va-pipe-out{ background:linear-gradient(90deg,rgba(129,170,247,.35),rgba(107,207,157,.55)); }
:root[data-theme="dark"] .va-pipe-in i{ background:var(--blue-text); box-shadow:0 0 0 1px rgba(129,170,247,.40); }
:root[data-theme="dark"] .va-pipe-out i{ background:var(--green-text); box-shadow:0 0 0 1px rgba(107,207,157,.40); }
/* Voice Agents: use cases, use cases, the green "result" list (its colour is animated, so the keyframes need a dark twin) */
:root[data-theme="dark"] .va-layer-label{ color:var(--blue-text); }
:root[data-theme="dark"] :is(#voice-usecases .usecase-item,#voice-usecases .va-case,.va-out){ background:var(--surface-glass); border-color:var(--hairline); }
:root[data-theme="dark"] .va-out li{ color:var(--green-text); }
:root[data-theme="dark"] .log-line{ color:var(--text-secondary); }
@media (prefers-reduced-motion:no-preference){
  @keyframes vaOutDark{0%,100%{background:transparent;color:var(--text-secondary)}6%,30%{background:rgba(107,207,157,.10);color:#6bcf9d}40%{background:transparent;color:var(--text-secondary)}}
  @keyframes vaOutIcoDark{0%,100%{color:#9aa2b0}6%,30%{color:#6bcf9d}40%{color:#9aa2b0}}
  :root[data-theme="dark"] .va-out li{ animation-name:vaOutDark; }
  :root[data-theme="dark"] .va-out li svg{ animation-name:vaOutIcoDark; }
}

/* Infrastructure hero diagram: dark cards, light ink (several labels carry inline fills, hence !important) */
:root[data-theme="dark"] .inf-hero-art :is(.ih-card,.ih-cloud){ fill:var(--dk-s2); }
:root[data-theme="dark"] .inf-hero-art .ih-card:not([style]){ stroke:var(--dk-line-3); }
:root[data-theme="dark"] .inf-hero-art .ih-t{ fill:var(--text-secondary); }
:root[data-theme="dark"] .inf-hero-art .ih-s{ fill:var(--text-primary); }
:root[data-theme="dark"] .inf-hero-art .ih-m{ fill:var(--text-muted); }
:root[data-theme="dark"] .inf-hero-art text[style*="#0f172a"]{ fill:var(--text-primary) !important; }
:root[data-theme="dark"] .inf-hero-art :is(text[style*="#475569"],text[style*="#64748b"]){ fill:var(--text-secondary) !important; }
:root[data-theme="dark"] .inf-hero-art text[style*="#047857"]{ fill:var(--green-text) !important; }
:root[data-theme="dark"] .inf-hero-art :is([stroke="#0f172a"],.ih-sec){ stroke:var(--text-primary); }
:root[data-theme="dark"] .inf-hero-art [fill="#fff"]{ fill:var(--dk-s2); }
:root[data-theme="dark"] .inf-hero-art [style*="color:#0f172a"]{ color:var(--text-primary) !important; }
:root[data-theme="dark"] .inf-hero-art :is(g[style*="color:#475569"],g[style*="color:#334155"]){ color:var(--text-secondary) !important; }
:root[data-theme="dark"] .inf-hero-art .ih-link{ stroke:#586a8a; }
:root[data-theme="dark"] .inf-hero-art :is(svg[data-hl="internet-mobile"] .r-im.ih-card,svg[data-hl="networks-security"] .r-ns.ih-card,svg[data-hl="business-communications"] .r-bc.ih-card,svg[data-hl="hosting"] .r-ho.ih-card,svg[data-hl="internet-mobile"] .r-im.ih-link){ stroke:var(--lime-text); }
/* Infrastructure inline greys on the watch-it-work flow go to the muted token */
:root[data-theme="dark"] body.pillar-infra :is(.inf-flow-bar span:not(.inf-flow-eg),.inf-ticket-top span,.inf-flow-stat span,.inf-stage-meta,.inf-flow-eg){ color:var(--text-secondary); }
:root[data-theme="dark"] body.pillar-infra main .glass-card{ background:var(--glass-bg); }
:root[data-theme="dark"] body.pillar-infra main .glass-card:hover{ background:var(--surface-raised); }
:root[data-theme="dark"] body.pillar-infra .inf-prov-row{ background:var(--glass-bg); }
:root[data-theme="dark"] body.pillar-infra .ip-care{ background:var(--dk-s1); }

/* modals and info panels (the Rufen Infrastructure panel, websites.html #infrastructure, is the standard): scrim, s3 panel, --dk-edge frame, inner sections s2 */
:root[data-theme="dark"] .web-modal{ background:var(--dk-scrim); }
:root[data-theme="dark"] .web-modal-card{ background:var(--dk-s3); border-color:var(--dk-edge); box-shadow:inset 0 1px 0 var(--dk-edge-hi),var(--shadow-pop); }
:root[data-theme="dark"] .web-modal-card h3{ color:var(--text-primary); }
:root[data-theme="dark"] .web-infra-lead{ color:var(--text-secondary); }
:root[data-theme="dark"] .web-infra-list li{ color:var(--text-primary); }
:root[data-theme="dark"] .web-infra-list svg, :root[data-theme="dark"] .web-infra-more{ color:var(--blue-text); }
:root[data-theme="dark"] .web-infra-all, :root[data-theme="dark"] .web-modal-x{ color:var(--text-secondary); }
:root[data-theme="dark"] .web-modal-x:hover{ background:var(--dk-s4); color:var(--text-primary); }

/* ---- 12. Loop-2 fixes ---- (dark mode only; every rule keyed on :root[data-theme="dark"]) */

/* A. Infrastructure #inf-flow: nested panels lift to plate-hi, text uses tokens, red and lime pass contrast */
:root[data-theme="dark"] :is(.inf-msg,.inf-ticket){ background:var(--stage-plate-hi); border-color:var(--dk-edge); }
:root[data-theme="dark"] .inf-msg p{ color:var(--text-primary); }
:root[data-theme="dark"] .inf-ticket strong{ color:var(--text-primary); }
:root[data-theme="dark"] .inf-msg-who.is-agent{ color:var(--orange-text); }
:root[data-theme="dark"] .inf-msg-who.is-person{ color:var(--blue-text-hi); }
:root[data-theme="dark"] .inf-ticket ul{ color:var(--text-secondary); }
:root[data-theme="dark"] .inf-ticket li::before{ color:var(--lime-text); }
:root[data-theme="dark"] body.pillar-infra .inf-ticket-top .inf-tag.is-high{ background:rgba(234,136,133,.16); color:#ffd2d0; }
:root[data-theme="dark"] body.pillar-infra .inf-ticket-top .inf-tag.is-done{ background:rgba(178,220,105,.14); color:#d6f0a0; }
:root[data-theme="dark"] .inf-row{ color:var(--text-secondary); }
:root[data-theme="dark"] .inf-row b{ color:var(--text-primary); }
:root[data-theme="dark"] .inf-row::before{ background:var(--dk-control); }
:root[data-theme="dark"] .inf-row.is-bad::before{ background:var(--red-text); box-shadow:0 0 0 1px rgba(234,136,133,.40); }
:root[data-theme="dark"] .inf-row.is-bad b{ color:var(--red-text-hi); }
:root[data-theme="dark"] .inf-row.is-good::before{ background:var(--lime-text); box-shadow:0 0 0 1px rgba(178,220,105,.40); }
:root[data-theme="dark"] .inf-row.is-good b{ color:var(--lime-text); }
:root[data-theme="dark"] .inf-flow-stat strong{ color:var(--lime-text); }
:root[data-theme="dark"] .inf-flow-stat strong.is-open{ color:var(--red-text-hi); }
:root[data-theme="dark"] .inf-term{ color:var(--text-secondary); }
:root[data-theme="dark"] .inf-term .is-cmd{ color:var(--text-secondary); }
:root[data-theme="dark"] .inf-term .is-ok{ color:var(--lime-text); }
:root[data-theme="dark"] .inf-flow-live{ color:var(--lime-text); }
:root[data-theme="dark"] .inf-flow-live::before{ background:var(--lime-text); box-shadow:0 0 0 1px rgba(178,220,105,.40); }
:root[data-theme="dark"] .inf-flow-wire{ background:repeating-linear-gradient(90deg,rgba(150,175,230,.28) 0 6px,transparent 6px 12px); }
:root[data-theme="dark"] .inf-flow-wire-lit{ background:var(--lime-text); box-shadow:none; }
:root[data-theme="dark"] .inf-flow-pk{ background:var(--red-text); box-shadow:0 0 0 1px rgba(234,136,133,.40); }
:root[data-theme="dark"] .inf-flow.is-resolved .inf-flow-pk{ background:var(--lime-text); box-shadow:0 0 0 1px rgba(178,220,105,.40); }
:root[data-theme="dark"] .inf-stage{ opacity:.78; }
:root[data-theme="dark"] :is(.inf-stage.is-active,.inf-stage.is-done){ opacity:1; }
@media (max-width:900px){ :root[data-theme="dark"] .inf-stage{ opacity:1; } }
:root[data-theme="dark"] .inf-stage-lead{ color:var(--text-secondary); }
:root[data-theme="dark"] .inf-stage-head h3{ color:var(--text-primary); }
:root[data-theme="dark"] .inf-stage-ico{ color:var(--text-secondary); }
:root[data-theme="dark"] .inf-stage.is-done .inf-stage-ico{ background:#b2dc69; border-color:#b2dc69; color:#0b0f17; }
:root[data-theme="dark"] .inf-stage.is-active .inf-stage-body{ border-color:rgba(178,220,105,.55); }

/* B. Voice Agents: flat call cards and flat step rings (the coloured elevation shadows go) */
:root[data-theme="dark"] body #voice-usecases .va-case .va-call{ border-color:rgba(129,170,247,.40); box-shadow:none; }
:root[data-theme="dark"] body #voice-usecases .cta-steps li:nth-child(1) svg{ animation-name:ctaStepIcon1D; }
:root[data-theme="dark"] body #voice-usecases .cta-steps li:nth-child(2) svg{ animation-name:ctaStepIcon2D; }
:root[data-theme="dark"] body #voice-usecases .cta-steps li:nth-child(3) svg{ animation-name:ctaStepIcon3D; }

/* C. Glass blur off in dark (the header keeps its blur) */
:root[data-theme="dark"] :is(.canvas-legend,.feature-card-front,.feature-card-back,.flip-card-front,.flip-card-back,.agent-btn,.agent-btn.active,.sp-faq details){ -webkit-backdrop-filter:none; backdrop-filter:none; }
:root[data-theme="dark"] body.pillar-marketing :is(.mkt-flow-stage .mkt-fl-node,.sp-faq details,.btn-secondary,#mkt-ask,#tab-yarrabrook,#tab-ja-brooks){ -webkit-backdrop-filter:none; backdrop-filter:none; }

/* D. Marketing hero skeleton: the shimmer is a Marketing-blue tint, not white */
:root[data-theme="dark"] body.pillar-marketing .mkt-sk{ background:rgba(113,193,224,.16); }
:root[data-theme="dark"] body.pillar-marketing .mkt-sk--hero{ background:linear-gradient(90deg,rgba(113,193,224,.30),rgba(113,193,224,.18)); }
@media (prefers-reduced-motion:no-preference){
  :root[data-theme="dark"] body.pillar-marketing .mkt-tiles--js .mkt-tv--web :is(.mkt-sk,.mkt-sk-btn){
    background-image:linear-gradient(90deg,rgba(113,193,224,0) 0%,rgba(113,193,224,.42) 50%,rgba(113,193,224,0) 100%);
    background-size:200% 100%; background-repeat:no-repeat;
  }
  :root[data-theme="dark"] body.pillar-marketing .mkt-tiles--js .mkt-tv--web .mkt-sk--hero{ background-color:rgba(113,193,224,.24); }
}

/* E. Accent halos in dark: 1px rings only, colours untouched */
:root[data-theme="dark"] :is(.dot-blue,.dot-orange,.dot-green,.dot-violet){ box-shadow:0 0 0 1px rgba(190,210,255,.30); }
:root[data-theme="dark"] .chat-panel-dot{ box-shadow:0 0 0 1px rgba(129,170,247,.40); }
:root[data-theme="dark"] .laser-badge.laser-blue{ background:var(--btn-blue); box-shadow:0 0 0 1px rgba(129,170,247,.45); }
:root[data-theme="dark"] .laser-badge.laser-orange{ background:var(--btn-orange); color:var(--btn-orange-ink); box-shadow:0 0 0 1px rgba(243,157,94,.45); }

/* F. Infrastructure leftovers outside #inf-flow: ring rules, no glow */
:root[data-theme="dark"] body.pillar-infra .inf-nbn-ico{ box-shadow:inset 0 0 0 1px rgba(178,220,105,.35); }
:root[data-theme="dark"] .inf-spine-pk{ box-shadow:0 0 0 1px rgba(178,220,105,.40); }
:root[data-theme="dark"] .inf-spine-pk.is-data{ box-shadow:0 0 0 1px rgba(243,157,94,.45); }
:root[data-theme="dark"] .inf-port{ box-shadow:0 0 0 1px rgba(178,220,105,.40); }

/* G2. Status-light and accent glows that the pillar overrides and inline demo styles still carry (rings only; hue kept) */
:root[data-theme="dark"] body.pillar-infra .indicator-dot.dot-blue{ box-shadow:0 0 0 3px rgba(178,220,105,.14); }
:root[data-theme="dark"] body.pillar-marketing .indicator-dot.dot-blue{ box-shadow:0 0 0 1px rgba(113,193,224,.40); }
@media (prefers-reduced-motion:no-preference){
  @keyframes infLedDark{ 50%{ box-shadow:0 0 0 5px rgba(178,220,105,.10); } }
  :root[data-theme="dark"] body.pillar-infra .indicator-dot.dot-blue{ animation-name:infLedDark; }
}
:root[data-theme="dark"] body.pillar-marketing :is(.mkt-speed-bar--fast,.mkt-flow-track i){ box-shadow:0 0 0 1px rgba(113,193,224,.35); }
:root[data-theme="dark"] body.pillar-marketing .mkt-rise-end{ filter:none; }
/* the voice-agent demo lights carry inline box-shadow glows (synced demo markup), so these two need !important */
:root[data-theme="dark"] :is(.panel-light,.agent-dot){ box-shadow:0 0 0 1px rgba(150,175,230,.35) !important; }

/* H. Footer chat pill and mobile contact-card halo: rings only, no blurred glow */
:root[data-theme="dark"] #btn-agent-active:hover{ box-shadow:0 0 0 1px rgba(243,157,94,.45); }
:root[data-theme="dark"] #btn-agent-active.chat-active:hover{ box-shadow:0 0 0 1px rgba(129,170,247,.45); }
:root[data-theme="dark"] .contact-section .contact-card::after{ box-shadow:0 0 0 1px var(--dk-line-2); }
@media (max-width:768px){
  :root[data-theme="dark"] .contact-section .contact-card{ border-color:var(--dk-line-2); box-shadow:0 0 0 1px var(--dk-line-1); }
}

/* ---- Phones: "How it all connects" as a vertical flow instead of the shrunk drawing (Mars, 23 Nov) ----
   index.html .iac-mflow (styles in styles.css so the Sandbox gets them too), copied to the Sandbox by tools/sandbox_sync.py. The set for the active tab shows (:has),
   a dot runs down each link, and the colours follow the tab: blue voice, green workloads, orange assistants
   (neon in dark, because the diagram card carries the neon accents there). */
.iac-mflow { display: none; }
@media (max-width: 767px) {
  .iac-diagram-card .iac-svg-wrapper { display: none !important; }
  .iac-mflow { display: block; margin-top: 18px; }
  .iac-mflow-set { display: none; flex-direction: column; align-items: center; --flow: var(--accent-blue); }
  .iac-mflow-set[data-flow="workloads"] { --flow: var(--accent-green); }
  .iac-mflow-set[data-flow="assistants"] { --flow: var(--accent-orange); }
  .iac-grid:has(.iac-tab-card.active[data-target="iaas"]) .iac-mflow-set[data-flow="iaas"],
  .iac-grid:has(.iac-tab-card.active[data-target="workloads"]) .iac-mflow-set[data-flow="workloads"],
  .iac-grid:has(.iac-tab-card.active[data-target="assistants"]) .iac-mflow-set[data-flow="assistants"] { display: flex; animation: mflowIn 0.4s ease both; }
  .iac-mnode {
    width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 14px; text-align: center;
    border-radius: 12px; border: 1px solid color-mix(in srgb, var(--flow) 55%, transparent);
    background: color-mix(in srgb, var(--flow) 8%, rgba(255, 255, 255, 0.04));
  }
  .iac-mnode b { display: inline-flex; align-items: center; gap: 8px; font: 700 0.78rem/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }   /* the diagram card is dark in both themes */
  .iac-mnode b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--flow); box-shadow: 0 0 8px var(--flow); }
  .iac-mnode span { font-size: 0.86rem; line-height: 1.45; color: #dfe6f0; }
  .iac-mnode--kernel { width: auto; padding: 14px 22px; border-radius: 999px; border-width: 1.5px; border-color: var(--flow); }
  .iac-mlink { position: relative; display: block; width: 2px; height: 30px; background: color-mix(in srgb, var(--flow) 35%, transparent); overflow: visible; }
  .iac-mlink::after {
    content: ""; position: absolute; left: 50%; top: 0; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
    background: var(--flow); box-shadow: 0 0 8px var(--flow); animation: mflowDot 1.6s linear infinite;
  }
  .iac-mlink + .iac-mnode + .iac-mlink::after { animation-delay: 0.5s; }
  .iac-mlink--fan + .iac-mouts { margin-top: 0; }
  .iac-mouts { list-style: none; margin: 0; padding: 12px 0 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    border-top: 2px solid color-mix(in srgb, var(--flow) 35%, transparent); }
  .iac-mouts li {
    padding: 9px 10px; border-radius: 10px; text-align: center; font: 600 0.8rem/1.25 var(--font-display); color: #fff;
    border: 1px solid color-mix(in srgb, var(--flow) 30%, transparent); background: rgba(255, 255, 255, 0.04);
  }
  .iac-mouts li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@keyframes mflowDot { 0% { transform: translateY(-4px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(27px); opacity: 0; } }
@keyframes mflowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .iac-mlink::after { animation: none; top: 11px; } .iac-mflow-set { animation: none !important; } }

/* ---- Phones: a compact footer, after textmagic.com's (Mars, 23 Nov) ----
   Logo with Industries and More Services on the same row. The menu groups fold into
   plain rows that open on tap (app.js adds the button role, aria-expanded and .is-open). Legal is one line of small
   links, then Contact, open, at the bottom. Same markup on every page and the blog (tools/site_chrome.py, functions/blog/render.js):
   the last stack is Contact, the one before it is Legal. */
@media (max-width: 768px) {
  /* logo on the left, Industries and More Services stacked on the right */
  footer .footer-brand { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; row-gap: 6px; }
  footer .footer-brand .footer-logo { grid-column: 1; grid-row: 1 / span 2; margin-bottom: 0 !important; }
  footer .footer-brand .footer-desc { display: none !important; }
  footer .footer-brand-link { grid-column: 2; display: inline-flex !important; justify-content: flex-end; gap: 4px; margin: 0 !important; font-size: 0.8rem !important; }
  footer .footer-links { grid-template-columns: minmax(0, 1fr) !important; row-gap: 0 !important; }
  footer .footer-stack { gap: 0; }
  /* Contact last, open, two columns (Mars, 23 Nov: contact at the bottom of the footer) */
  footer .footer-stack:last-child { order: 1; }
  footer .footer-stack:last-child .footer-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; padding-top: 72px; }   /* two rows clear of the Legal line (Mars, 23 Nov; one more row 26 Nov) */
  footer .footer-stack:last-child .footer-col h5 { grid-column: 1 / -1; }
  /* Book a call and Chat on the left, the email and the number on the far right (Mars, 26 Nov) */
  footer .footer-stack:last-child .footer-col > a:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  footer .footer-stack:last-child .footer-col > a:nth-of-type(2) { grid-column: 1; grid-row: 3; }
  footer .footer-stack:last-child .footer-col > a:nth-of-type(3) { grid-column: 2; grid-row: 2; justify-self: end; text-align: right; }
  footer .footer-stack:last-child .footer-col > a:nth-of-type(4) { grid-column: 2; grid-row: 3; justify-self: end; text-align: right; }
  /* the menu groups: plain rows with a chevron, no dividers */
  footer .footer-stack:nth-last-child(n+3) .footer-col h5 {
    display: flex; align-items: center; justify-content: space-between; margin: 0 !important; padding: 10px 0;
    font-size: 0.95rem !important; font-weight: 600; letter-spacing: 0 !important; text-transform: none !important;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  footer .footer-stack:nth-last-child(n+3) .footer-col h5::after {
    content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform 0.25s ease;
  }
  footer .footer-stack:nth-last-child(n+3) .footer-col.is-open h5::after { transform: rotate(-135deg) translateY(-2px); }
  footer .footer-stack:nth-last-child(n+3) .footer-col > :not(h5) { display: none !important; }
  footer .footer-stack:nth-last-child(n+3) .footer-col.is-open { padding-bottom: 8px; }
  footer .footer-stack:nth-last-child(n+3) .footer-col.is-open > :not(h5) { display: block !important; padding: 5px 0 5px 12px; font-size: 0.86rem !important; }
  /* Legal: one line of small links */
  footer .footer-stack:nth-last-child(2) .footer-col { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 14px; margin-top: 8px; border-top: 1px solid rgba(15, 23, 42, 0.08); text-align: center; }   /* the four links spread evenly across the line (Mars, 23 Nov) */
  footer .footer-stack:nth-last-child(2) .footer-col h5 { display: none; }
  footer .footer-stack:nth-last-child(2) .footer-col a { margin: 0 !important; font-size: 0.78rem !important; }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) { footer .footer-col h5::after { transition: none; } }
:root[data-theme="dark"] footer .footer-stack:nth-last-child(2) .footer-col { border-top-color: var(--dk-line-2); }

/* ---- Phones: the call simulator gives the conversation the room (Mars, 23 Nov) ----
   app.js puts .is-live on the voice layout while a call runs and .is-done after it. During the call the scenario
   switch and the big button step aside, leaving the status, waveform and CRM line, and the transcript gets most of
   the screen with no summary strip over its bottom. After the call the summary gets the same tall box and the
   scenario switch and "Simulate Another Call" come back. Shared by the home page and the Sandbox. */
@media (max-width: 767px) {
  .voice-simulator-layout.is-live .lang-selector-group,
  .voice-simulator-layout.is-live #btn-trigger-call { display: none !important; }
  .voice-simulator-layout.is-live .voice-controls { gap: 8px !important; }
  .voice-simulator-layout.is-live .voice-log-console,
  .voice-simulator-layout.is-done .voice-log-console { height: min(64vh, 500px) !important; }
  .voice-simulator-layout.is-live .console-footer { display: none !important; }
  .voice-simulator-layout.is-live .console-body { padding-bottom: 14px !important; }
  .voice-simulator-layout.is-live .chat-bubble { max-width: 96% !important; }
  .voice-simulator-layout.is-live .status-value { font-size: 0.9rem !important; line-height: 1.3 !important; }
  .voice-simulator-layout #btn-toggle-transcript { padding: 6px 10px !important; font-size: 0.78rem !important; min-height: 0 !important; white-space: nowrap; }
}

/* Contact card on phones: one warm line above Book a call, on every page (Mars, 23 Nov). Desktop keeps "A free 30-minute call. No obligation." */
.closing-perk { display: none; }
@media (max-width: 767px) {
  .contact-section .closing-talk > p.closing-perk {
    display: flex; align-self: stretch; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px;
    font: 600 1rem/1.3 var(--font-display); color: var(--text-primary); text-align: center;
  }
  .contact-section .closing-perk svg { width: 19px; height: 19px; color: var(--accent-orange); flex: none; }
}
:root[data-theme="dark"] .contact-section .closing-perk svg { color: #ff7d28; }

/* ---- Phones: a compact ROI Savings tab (Mars, 25 Nov) ----
   Same figures and the same assumptions, set tighter: a slimmer header strip, smaller result rows, a smaller
   savings line and smaller assumptions text. Home page and Sandbox. Desktop unchanged. */
@media (max-width: 767px) {
  #tab-roi-calculator .calc-layout-inside { gap: 12px !important; }
  #tab-roi-calculator .calc-controls h4 { margin-bottom: 4px; font-size: 1.05rem; }
  #tab-roi-calculator .form-group.range-group { margin-bottom: 6px !important; }
  #tab-roi-calculator .calc-results-header { padding: 8px 14px; font-size: 0.68rem; }
  #tab-roi-calculator .calc-results-body { padding: 12px 14px !important; gap: 8px !important; }
  #tab-roi-calculator .result-row { font-size: 0.8rem; line-height: 1.3; row-gap: 5px; }
  #tab-roi-calculator .result-row > span:first-child { padding-right: 8px; }
  #tab-roi-calculator .cost-bar { height: 6px; }
  #tab-roi-calculator .divider { margin: 2px 0; }
  #tab-roi-calculator .total-savings-row { font-size: 0.92rem; }
  #tab-roi-calculator .savings-value { font-size: 1.2rem; }
  #tab-roi-calculator .calc-results-pane { padding-bottom: 0 !important; }
  #tab-roi-calculator .calc-assumptions { padding: 10px 14px 12px; font-size: 0.7rem !important; line-height: 1.45 !important; }
}

/* Phones (Mars, 26 Nov): [data-phone-pager] stacks (app.js), one card at a time with arrows and dots */
.ph-pager { display: none; }
@media (max-width: 767px) {
  .ph-pager { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 6px; margin: 0 0 12px; }
  .ph-pager-arrow {
    display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.12); background: rgba(255, 255, 255, 0.7); color: var(--text-primary);
  }
  .ph-pager-arrow svg { width: 16px; height: 16px; }
  .ph-pager-arrow:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
  .ph-pager-dots { display: flex; justify-content: center; gap: 5px; }
  .ph-pager-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted, #94a3b8); opacity: 0.4; transition: width .25s ease, opacity .25s ease; }
  .ph-pager-dots i.is-on { width: 14px; border-radius: 3px; opacity: 1; background: var(--accent-blue); }
  .ph-paged { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
  .ph-paged > * { grid-area: 1 / 1; margin: 0 !important; }
  .ph-paged > :not(.is-cur) { visibility: hidden; pointer-events: none; }
}
:root[data-theme="dark"] .ph-pager-arrow { background: var(--dk-s3); border-color: var(--dk-line-3); }
:root[data-theme="dark"] .ph-pager-dots i.is-on { background: var(--blue-text); }

/* Phones, dark (Mars, 26 Nov): the header is solid. Its colour is 88% opaque and phones have the blur turned
   off (performance), so the page showed through it as you scrolled ("Try the demo" behind the logo). */
:root[data-theme="dark"] { --dk-header-solid: #01061b; }
:root[data-theme="dark"] body.pillar-marketing { --dk-header-solid: #000611; }
@media (max-width: 768px) {
  :root[data-theme="dark"] #main-header { background: var(--dk-header-solid) !important; }
}

/* Short phones (Mars, 26 Nov): on a screen under 700px tall (a phone with its browser bars showing) every hero
   still ends with its buttons above the bottom bar: the line under the heading is a size smaller, the buttons
   slimmer, and the picture band may shrink further. Marketing heroes start under the header like the rest. */
@media (max-width: 767px) and (max-height: 700px) {
  :is(.service-hero, .lsh, #hero) :is(.service-hero-sub, .lsh-sub, .hero-subtitle) { font-size: 0.9rem !important; line-height: 1.5 !important; }
  :is(.service-hero-actions, .lsh-actions, .hero-actions) { gap: 10px !important; }
  :is(.service-hero-actions, .lsh-actions, .hero-actions) .btn { padding-top: 11px !important; padding-bottom: 11px !important; }
  .service-hero:has(.mobile-animation-spacer) .mobile-animation-spacer,
  .lsh .mobile-animation-spacer { min-height: 92px !important; }
  #hero .hero-text-wrapper .hero-ekg-zone { min-height: 104px !important; }
  body.pillar-marketing .service-hero.mkt-hero { padding-top: 88px !important; padding-bottom: 52px !important; }
  body.pillar-infra .service-hero :is(.inf-hero-art, .ip-hero-art) { min-height: 96px; }
}

/* ===================== Phones: even spacing between sections (Mars, 26 Nov) =====================
   Every section is as tall as its content with 48px above and below it, so the gap between any two sections
   is the same 96px on every page. (Before, most sections filled at least a screen with their content centred,
   so short sections sat in big, uneven gaps, and on some pages the questions ran into the contact card.)
   Only sections that follow something in <main> (the hero is always first, or inside a wrapper that is), so the
   hero keeps its one-screen layout; the pinned Agentic Workflows steps and one-line strips keep theirs. */
@media (max-width: 767px) {
  html body main > * ~ section:not(.service-hero):not(.hero-section):not(.lsh):not(.wf-pinned):not(.rep-proof),
  html body main > div > section:not(.service-hero):not(.hero-section):not(.wf-pinned):not(.rep-proof) {
    min-height: 0 !important;
    padding-top: 48px !important;
    padding-bottom: 48px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  html body main > section#voice-sandbox { padding-top: 48px !important; padding-bottom: 48px !important; }   /* its own ID rule outranks the one above */
  html body main > * ~ section:not(.service-hero):not(.hero-section):not(.lsh):not(.wf-pinned):not(.rep-proof) > .container > :first-child { margin-top: 0 !important; }
  html body main > * ~ section:not(.service-hero):not(.hero-section):not(.lsh):not(.wf-pinned):not(.rep-proof) > .container > :last-child { margin-bottom: 0 !important; }
}

/* Desktop (Mars, 27 Nov): after a particle hero the sections alternate band, plain, band... (app.js adds
   .sec-band / .sec-plain), so the one right after the hero always has the band background and the particle
   field ends at a clear edge. Overrides each page's own alternation; phones keep one background. */
@media (min-width: 768px) {
  /* the band is a clearly different colour from the cards on it (Mars, 27 Nov): a bluer band, cards a step darker */
  main section.sec-band { background: #eef3fb !important; }
  main section.sec-plain { background: transparent !important; box-shadow: none !important; }
  /* dark: a light-touch band, barely off the page colour, edged by a hairline; the cards on it are lifted a step,
     so they read apart from the band (Mars: #0f2350 and #071634 were too heavy) */
  :root[data-theme="dark"] main section.sec-band { background: #030b22 !important; box-shadow: inset 0 1px 0 var(--dk-line-1), inset 0 -1px 0 var(--dk-line-1) !important; }
  :root[data-theme="dark"] main section.sec-band {
    --surface-solid:#0a1733; --surface-glass:#0a1733; --surface-glass-strong:var(--dk-s2);
    --surface-raised:var(--dk-s2); --surface-sunken:var(--dk-s1);
    --glass-bg:#0a1733; --glass-border:var(--dk-line-1); --hairline:var(--dk-line-1);
  }
  /* Home: the pillar cards sit in the middle of their band, not against its top edge */
  #capabilities.pillars-section.sec-band { padding-top: 72px !important; padding-bottom: 72px !important; }
  :root[data-theme="dark"] main section.sec-plain {
    --surface-solid:var(--dk-s1); --surface-glass:var(--dk-s1); --surface-glass-strong:var(--dk-s2);
    --surface-raised:var(--dk-s2); --surface-sunken:var(--dk-canvas);
    --glass-bg:var(--dk-s1); --glass-border:var(--dk-line-1); --hairline:var(--dk-line-1);
  }
}

/* Phones (Mars, 27 Nov): Contact sits right under the Resources row, above the Privacy / Terms line */
@media (max-width: 768px) {
  footer .footer-stack:last-child { order: 1; }
  footer .footer-stack:nth-last-child(2) { order: 2; }
  footer .footer-stack:last-child .footer-col { padding-top: 18px; padding-bottom: 14px; }
}
