/* ============================================================
   SILVA GLOBAL STYLES
   Shared across all pages. Import after tokens.css.
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
ol, ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font-family: inherit; }

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Typography utilities ── */
.display-xl { font-family: var(--font-display); font-size: 72px;  font-weight: 300; line-height: 1.05; letter-spacing: -0.025em; }
.display-lg { font-family: var(--font-display); font-size: 56px;  font-weight: 300; line-height: 1.1;  letter-spacing: -0.025em; }
.display-md { font-family: var(--font-display); font-size: 44px;  font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; }
.display-sm { font-family: var(--font-display); font-size: 32px;  font-weight: 300; line-height: 1.2;  letter-spacing: -0.015em; }
.body-lg    { font-family: var(--font-body);    font-size: 20px;  line-height: 1.6; }
.body-md    { font-family: var(--font-body);    font-size: 16px;  line-height: 1.65; }
.body-sm    { font-family: var(--font-body);    font-size: 14px;  line-height: 1.6; }
.label      { font-family: var(--font-body);    font-size: 11px;  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }

/* ── Section shared patterns ── */
.section-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 20px;
  text-wrap: balance;
}
.section-title em { font-style: italic; color: var(--accent); }
.section-lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.6;
  margin-bottom: 56px;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}
.btn-secondary {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--rule-mid);
  transition: border-color var(--duration-fast),
              color var(--duration-fast),
              transform var(--duration-fast);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
/* AI arm overrides */
body.ai-arm .section-tag { color: var(--orange); }
/* AI arm button variants */
body.ai-arm .btn-primary {
  background: var(--orange);
  border-color: var(--orange);
}
body.ai-arm .btn-primary:hover {
  background: var(--orange-bright);
  border-color: var(--orange-bright);
}
body.ai-arm .btn-secondary:hover {
  border-color: var(--orange);
  color: var(--orange-bright);
}

/* ── Glass base (hamburger + AI agent only) ── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── Site header — full-width on load, smart-hides on scroll ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule-soft);
  transform: translateY(0);
  transition: transform 0.35s var(--ease-in-out);
  will-change: transform;
}
.site-header.nav-hidden { transform: translateY(-100%); }

.site-header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-header-logo img {
  display: block;
  height: 32px;
  width: auto;
}
body.ai-arm .site-header-logo img { filter: brightness(0) invert(1); }

.site-header-nav {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.site-header-group {
  display: flex;
  align-items: center;
}
.site-header-group a {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 11px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color var(--duration-fast);
}

/* ── Top nav dropdown ── */
.top-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
/* Invisible bridge fills the gap so hover isn't lost crossing to the panel */
.top-nav-item::before {
  content: '';
  position: absolute;
  top: 100%;
  left: -16px;
  right: -16px;
  height: 8px;
}
.top-nav-item > a::after {
  content: ' ▾';
  font-size: 9px;
  opacity: 0.45;
}
.top-nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 190px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  padding: 6px 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast), transform var(--duration-fast);
  z-index: 920;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.top-nav-item:hover .top-nav-dropdown,
.top-nav-item:focus-within .top-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.top-nav-dropdown a {
  display: block;
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.top-nav-dropdown a:hover {
  color: var(--accent);
  background: var(--bg-panel);
  padding-left: 18px;
}
/* Silva AI dropdown — always orange regardless of which page arm you're on.
   Legal dropdown stays green via the default rules above. */
.top-nav-dropdown--ai { border-top-color: var(--orange); }
.top-nav-dropdown--ai a:hover { color: var(--orange-bright); background: rgba(200,105,42,0.06); }

.site-header-ai-links a { color: var(--ink-muted); }
.site-header-ai-links a:hover { color: var(--orange); }
.site-header-sep {
  width: 1px;
  height: 18px;
  background: var(--rule-mid);
  margin: 0 6px;
  flex-shrink: 0;
}
/* AI arm — site-header-ai-links prominence (separate AI-only group) */
body.ai-arm .site-header-ai-links a { color: var(--ink-soft); }
body.ai-arm .site-header-ai-links a:hover { color: var(--orange-bright); }

/* Section links hover their own colour, regardless of which page you're on */
.site-header-group a[href="/legal-services"]:hover { color: var(--accent-bright); }
.site-header-group a[href="/ai"]:hover { color: var(--orange-bright); }

/* Active page — green on legal arm, orange on AI arm */
.site-header-group a.is-active,
.nav-links a.is-active { color: var(--accent); }
body.ai-arm .site-header-group a.is-active,
body.ai-arm .nav-links a.is-active { color: var(--orange-bright); }

/* ── Cookie consent banner (small, neat; injected by cookie-consent.js) ── */
.cookie-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 200; width: calc(100% - 40px); max-width: 680px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-alt); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transition: opacity 0.25s var(--ease-in-out), transform 0.25s var(--ease-in-out);
}
body.ai-arm .cookie-banner { background: #23262E; border-color: rgba(240, 237, 230, 0.14); }
html.ai-light body.ai-arm .cookie-banner { background: #FFFFFF; border-color: var(--rule); }
.cookie-banner--out { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.cookie-banner-text { flex: 1; min-width: 240px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.cookie-banner-text a { color: var(--accent); }
body.ai-arm .cookie-banner-text a { color: var(--orange-bright); }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-md); cursor: pointer;
  border: 1px solid var(--rule-mid);
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}
.cookie-btn--ghost { background: transparent; color: var(--ink-soft); }
.cookie-btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.cookie-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cookie-btn--primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
body.ai-arm .cookie-btn--ghost:hover { border-color: var(--orange-bright); color: var(--orange-bright); }
body.ai-arm .cookie-btn--primary { background: var(--orange-bright); border-color: var(--orange-bright); }
@media (max-width: 600px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; transform: none; width: auto; max-width: none; }
  .cookie-banner--out { transform: translateY(12px); }
  .cookie-banner-actions { width: 100%; }
  .cookie-btn { flex: 1; }
}

/* ── International globe — a small moment of delight (contract pages) ── */
.intl-globe { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.intl-globe-copy .section-tag { color: var(--accent); display: block; margin-bottom: 14px; }
.intl-globe-copy h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 40px); line-height: 1.12; margin-bottom: 16px; max-width: 460px; }
.intl-globe-copy h2 em { font-style: italic; color: var(--accent); }
.intl-globe-copy p { font-size: 15px; color: var(--ink-soft); line-height: 1.7; max-width: 420px; margin-bottom: 24px; }
.intl-globe .globe-wrap { width: 100%; max-width: 380px; margin: 0 auto; cursor: grab; touch-action: none; }
.intl-globe .globe-wrap:active { cursor: grabbing; }
.intl-globe canvas.silva-globe { width: 100%; height: auto; display: block; }
@media (max-width: 860px) {
  .intl-globe { grid-template-columns: 1fr; gap: 24px; justify-items: center; text-align: center; }
  .intl-globe-copy h2, .intl-globe-copy p { margin-left: auto; margin-right: auto; }
}

/* Desktop: trigger invisible while header is showing; fades in when header hides */
@media (min-width: 1024px) {
  .site-header + .nav-trigger {
    opacity: 0;
    pointer-events: none;
  }
  .site-header.nav-hidden + .nav-trigger {
    opacity: 1;
    pointer-events: auto;
  }
}
/* Tablet / mobile: hide nav links, trigger always visible */
@media (max-width: 1023px) {
  .site-header-nav { display: none; }
}

/* ── Hamburger nav trigger — glass pill, tapered bars, lift on hover ── */
.nav-trigger {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 950;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  --ghi: rgba(255, 255, 255, 0.85);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(7px) saturate(1.7);
  -webkit-backdrop-filter: blur(7px) saturate(1.7);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08),
              inset 0 1px 2px var(--ghi),
              inset 0 -7px 11px rgba(255, 255, 255, 0.14);
  transition: transform 0.25s var(--ease-in-out),
              box-shadow 0.25s var(--ease-in-out),
              border-color var(--duration-fast),
              opacity 0.25s var(--ease-in-out);
}
body.ai-arm .nav-trigger {
  --ghi: rgba(255, 255, 255, 0.30);
  background: linear-gradient(160deg, rgba(96, 100, 110, 0.45), rgba(40, 43, 50, 0.18));
}
.nav-trigger:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16),
              inset 0 1px 2px var(--ghi),
              inset 0 -7px 11px rgba(255, 255, 255, 0.14);
}
body.ai-arm .nav-trigger:hover { border-color: var(--orange-bright); }

/* Three tapered bars drawn from the single <span> and its pseudo-elements */
.nav-trigger span {
  display: block;
  position: relative;
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: width 0.25s var(--ease-in-out), background 0.2s var(--ease-in-out);
}
.nav-trigger span::before,
.nav-trigger span::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: width 0.25s var(--ease-in-out), background 0.2s var(--ease-in-out);
}
.nav-trigger span::before { top: -6px; width: 22px; }
.nav-trigger span::after  { top: 6px;  width: 18px; }
.nav-trigger:hover span,
.nav-trigger:hover span::before,
.nav-trigger:hover span::after { width: 22px; background: var(--accent); }
body.ai-arm .nav-trigger:hover span,
body.ai-arm .nav-trigger:hover span::before,
body.ai-arm .nav-trigger:hover span::after { background: var(--orange-bright); }

/* ── AI: always-dark surface (hero bands) ──
   Add class "ai-dark-surface" to a section to keep it dark in both themes.
   Re-pins the flipping tokens to on-dark values for legible children. */
body.ai-arm .ai-dark-surface {
  background: var(--ai-hero-bg);
  color: var(--ink-on-dark);
  --bg:            var(--ai-hero-bg);
  --bg-raised:     #2A2E37;
  --bg-card:       #2E323B;
  --bg-card-hover: #343846;
  --ink:           var(--ink-on-dark);
  --ink-soft:      var(--ink-on-dark-soft);
  --ink-muted:     rgba(240, 237, 230, 0.45);
  --rule:          var(--rule-on-dark);
  --rule-soft:     var(--rule-on-dark);
  --rule-mid:      rgba(240, 237, 230, 0.18);
}

/* ── AI theme toggle (glass bulb, under the hamburger, AI pages only) ── */
.theme-toggle {
  position: fixed;
  top: 86px;
  right: 32px;
  z-index: 949;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  --ghi: rgba(255, 255, 255, 0.30);
  background: linear-gradient(160deg, rgba(96, 100, 110, 0.45), rgba(40, 43, 50, 0.18));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(7px) saturate(1.7);
  -webkit-backdrop-filter: blur(7px) saturate(1.7);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10),
              inset 0 1px 2px var(--ghi),
              inset 0 -7px 11px rgba(255, 255, 255, 0.10);
  transition: transform 0.25s var(--ease-in-out),
              box-shadow 0.25s var(--ease-in-out),
              border-color var(--duration-fast),
              opacity 0.25s var(--ease-in-out);
}
body.ai-arm .theme-toggle { display: flex; }
body.ai-arm.ai-force-dark .theme-toggle { display: none; }

/* In AI light mode the floating controls swap to light glass (so they don't
   read as dark lozenges over light content). The S.AI button already adapts
   via --glass-bg; the hamburger and bulb hardcode their gradient, so override. */
html.ai-light body.ai-arm .nav-trigger,
html.ai-light body.ai-arm .theme-toggle {
  --ghi: rgba(255, 255, 255, 0.85);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12));
}
.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--orange-bright);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18),
              inset 0 1px 2px var(--ghi),
              inset 0 -7px 11px rgba(255, 255, 255, 0.10);
}
.theme-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: rgba(240, 237, 230, 0.65);   /* dim — dark mode (bulb off) */
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s var(--ease-in-out), fill 0.2s var(--ease-in-out), filter 0.2s var(--ease-in-out);
}
/* Rays — hidden when dark (bulb off), shown when light (bulb on) */
.theme-toggle .bulb-rays { opacity: 0; transition: opacity 0.2s var(--ease-in-out); }
html.ai-light .theme-toggle .bulb-rays { opacity: 1; }

/* Light mode active — bulb lit */
html.ai-light .theme-toggle svg {
  stroke: #E07830;
  fill: rgba(224, 120, 48, 0.22);
  filter: drop-shadow(0 0 5px rgba(224, 120, 48, 0.55));
}
/* keep the open ray paths unfilled */
html.ai-light .theme-toggle .bulb-rays path { fill: none; }

/* ── Nav overlay + panel ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-mid);
}
.nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
}
body.ai-arm .nav-backdrop { background: rgba(10, 10, 12, 0.6); }

.nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: var(--glass-bg);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 80px 48px 48px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-mid) var(--ease-out);
  overflow-y: auto;
}
.nav-overlay.open .nav-panel { transform: translateX(0); }

.nav-close {
  position: absolute;
  top: 28px;
  right: 32px;
  font-size: 24px;
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast);
}
.nav-close:hover { color: var(--accent); }
body.ai-arm .nav-close:hover { color: var(--orange-bright); }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.nav-section-label.ai { color: var(--orange-bright); }
body.ai-arm .nav-section-label { color: var(--orange-bright); }
body.ai-arm .nav-section-label.legal { color: var(--accent-bright); }

.nav-links { margin-bottom: 32px; }
.nav-links li { border-bottom: 1px solid var(--rule-soft); }
body.ai-arm .nav-links li { border-bottom-color: var(--rule); }
.nav-links a {
  display: block;
  padding: 13px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  transition: color var(--duration-fast), padding-left var(--duration-fast);
}
.nav-links a:hover { color: var(--accent); padding-left: 6px; }
body.ai-arm .nav-links a:hover { color: var(--orange-bright); }
.nav-links a.nav-ai   { font-size: 17px; color: var(--ink-soft); }
.nav-links a.nav-ai:hover { color: var(--orange-bright); }
body.ai-arm .nav-links a.nav-legal { font-size: 17px; color: var(--ink-soft); }
body.ai-arm .nav-links a.nav-legal:hover { color: var(--accent-bright); }

/* ── Side nav dropdown ── */
.nav-link-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-link-toggle-icon {
  flex-shrink: 0;
  padding: 13px 4px 13px 12px;
  font-size: 10px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: transform var(--duration-fast), color var(--duration-fast);
  line-height: 1;
}
.nav-link-toggle-icon.open { transform: rotate(180deg); color: var(--accent); }
.nav-link-toggle-icon--ai.open { color: var(--orange-bright); }
.nav-sub {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.nav-sub.open { max-height: 280px; }
.nav-sub li { border-bottom: none; }
.nav-sub a {
  display: block;
  padding: 8px 0 8px 16px !important;
  font-size: 14px !important;
  color: var(--ink-muted) !important;
  transition: color var(--duration-fast), padding-left var(--duration-fast) !important;
}
.nav-sub a:hover { color: var(--accent) !important; padding-left: 22px !important; }
/* AI sub-list — always orange regardless of which page arm you're on.
   Legal sub-list stays green via the default rule above. */
.nav-sub--ai a:hover { color: var(--orange-bright) !important; }

.nav-divider { height: 1px; background: var(--rule); margin: 16px 0 24px; }

.nav-contact a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
  transition: color var(--duration-fast);
}
.nav-contact a:hover { color: var(--accent); }
body.ai-arm .nav-contact a { color: var(--ink-muted); }
body.ai-arm .nav-contact a:hover { color: var(--ink); }

/* ── AI agent float button ── */
.ai-agent {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 56px;
  height: 56px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.ai-agent:hover { border-color: var(--accent); }
body.ai-arm .ai-agent:hover { border-color: var(--orange-bright); }
.ai-agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: agent-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
body.ai-arm .ai-agent-dot { background: var(--orange-bright); }
@keyframes agent-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}
.ai-agent-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── AI agent chat panel — rises from just above the S.AI button ── */
.ai-agent-panel {
  position: fixed;
  right: 32px;
  bottom: 100px;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  z-index: 101;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity var(--duration-mid) var(--ease-out),
              transform var(--duration-mid) var(--ease-out);
}
.ai-agent-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }
.ai-agent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
}
body.ai-arm .ai-agent-panel-head { background: var(--orange-bright); }
.ai-agent-panel-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ai-agent-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--duration-fast);
}
.ai-agent-panel-close:hover { opacity: 1; }
.ai-agent-panel-body { width: 400px; max-width: 100%; height: min(600px, calc(100vh - 190px)); }
.ai-agent-panel-body zapier-interfaces-chatbot-embed {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
@media (max-width: 480px) {
  .ai-agent-panel { right: 16px; left: 16px; bottom: 92px; width: auto; max-width: none; }
  .ai-agent-panel-body { width: 100%; height: 68vh; }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Footer ── */
footer {
  background: var(--bg);
  border-top: 3px solid var(--accent);
  padding: 64px var(--gutter-x) 48px;
}
body.ai-arm footer { border-top-color: var(--orange); }
/* AI footer stays dark in BOTH light and dark modes.
   Re-pin the flipping tokens to on-dark values so all children stay legible. */
body.ai-arm footer {
  background: var(--ai-foot-bg);
  color: var(--ink-on-dark);
  --bg:        var(--ai-foot-bg);
  --bg-card:   #23262E;
  --ink:       var(--ink-on-dark);
  --ink-soft:  var(--ink-on-dark-soft);
  --ink-muted: rgba(240, 237, 230, 0.45);
  --rule:      var(--rule-on-dark);
  --rule-soft: var(--rule-on-dark);
  --rule-mid:  var(--rule-on-dark);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-logo {
  height: 28px;
  width: auto;
  margin-bottom: 16px;
}
.footer-prop {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 260px;
  margin-bottom: 20px;
}
.footer-social a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color var(--duration-fast);
}
.footer-social a:hover { color: var(--accent); }
body.ai-arm .footer-social a:hover { color: var(--orange); }

.footer-col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
body.ai-arm .footer-col-label { color: var(--orange); }

.footer-links li { margin-bottom: 8px; }
.footer-links a {
  font-size: 13px;
  color: var(--ink-soft);
  transition: color var(--duration-fast);
}
.footer-links a:hover { color: var(--accent); }
body.ai-arm .footer-links a:hover { color: var(--orange); }

.footer-newsletter {
  margin-top: 24px;
}
.footer-newsletter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.footer-newsletter-form {
  display: flex;
  gap: 0;
}
.footer-newsletter-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-right: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--duration-fast);
}
.footer-newsletter-input:focus { border-color: var(--accent); }
body.ai-arm .footer-newsletter-input {
  background: var(--bg-card);
  border-color: var(--rule-mid);
  color: var(--ink);
}
body.ai-arm .footer-newsletter-input:focus { border-color: var(--orange); }
.footer-newsletter-btn {
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  transition: background var(--duration-fast);
}
.footer-newsletter-btn:hover { background: var(--accent-dim); }
body.ai-arm .footer-newsletter-btn { background: var(--orange); }
body.ai-arm .footer-newsletter-btn:hover { background: var(--orange-bright); }

.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-legal-links { display: flex; gap: 24px; }
.footer-legal-links a { color: var(--ink-muted); transition: color var(--duration-fast); }
.footer-legal-links a:hover { color: var(--accent); }
body.ai-arm .footer-legal-links a:hover { color: var(--orange); }

/* ── Numbered list (no bullets ever) ── */
.numbered-list { counter-reset: item; }
.numbered-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.numbered-list li:last-child { border-bottom: none; }
.numbered-list li::before {
  content: counter(item, decimal-leading-zero);
  counter-increment: item;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-top: 2px;
}

/* ── Page section default padding ── */
.section { padding: 100px var(--gutter-x); }

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.6);
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox.active { display: flex; }
.lightbox-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--rule-mid);
  max-width: 600px;
  width: 100%;
  padding: 48px;
  max-height: 90vh;
  overflow-y: auto;
  animation: lightbox-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes lightbox-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 18px;
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.lightbox-close:hover { color: var(--accent); border-color: var(--accent); }
.lightbox h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.2;
}
.lightbox p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 16px;
}
.lightbox p:last-child { margin-bottom: 0; }
.lightbox ol {
  counter-reset: lb-item;
  margin: 16px 0;
}
.lightbox ol li {
  counter-increment: lb-item;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.lightbox ol li:last-child { border-bottom: none; }
.lightbox ol li::before {
  content: counter(lb-item, decimal-leading-zero);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-top: 3px;
}
/* Credibility cell click target */
.cred-cell {
  cursor: pointer;
}
.cred-cell:hover .cred-num { color: var(--accent-dim); }
.cred-trigger {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  transition: letter-spacing var(--duration-mid);
}
.cred-cell:hover .cred-trigger { letter-spacing: 0.2em; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .section { padding: 80px 48px; }
  footer { padding: 48px 48px 36px; }
  .footer-inner { gap: 32px; }
}
@media (max-width: 900px) {
  .section { padding: var(--gutter-x) 32px; }
  footer { padding: 48px 32px 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-panel { width: 320px; }
}
@media (max-width: 640px) {
  .nav-panel { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
