/* Auto Center Bern — Light/Dark Design System */

/* Default: light theme */
:root, :root[data-theme="light"] {
  --logo-filter: none;
  --logo-blend: multiply;
  --bg: #fafaf8;
  --bg-1: #ffffff;
  --bg-2: #f3f3f0;
  --bg-3: #eaeae6;
  --line: #e6e6e2;
  --line-2: #d4d4ce;
  --fg: #0a0b0d;
  --fg-dim: #5a606b;
  --fg-mute: #8a8f98;
  --accent: #2c2c2e;
  --accent-hi: #141212;
  --accent-glow: rgba(44,44,46,0.10);
  --danger: #c11d2a;
  --ok: #16a34a;
  --hero-grad: linear-gradient(180deg, #f5f6f4 0%, #eaeae6 100%);
  --ph-bg: linear-gradient(180deg, #ececea 0%, #dfe0dc 100%);
  --ph-stripe: rgba(0,0,0,0.035);
  --ph-dash: rgba(0,0,0,0.08);
  --ph-label-bg: rgba(255,255,255,0.7);
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 30px 80px -24px rgba(10,20,40,0.18);
  --shadow-sm: 0 2px 8px -2px rgba(10,20,40,0.08);
  --grid-gap: clamp(16px, 2vw, 28px);
  --container: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Dark theme overrides */
:root[data-theme="dark"] {
  --logo-filter: invert(1);
  --logo-blend: screen;
  --bg: #0a0b0d;
  --bg-1: #0f1115;
  --bg-2: #14171c;
  --bg-3: #1a1e24;
  --line: #22262d;
  --line-2: #2c313a;
  --fg: #f5f6f7;
  --fg-dim: #a7adb6;
  --fg-mute: #6c727c;
  --accent: #c0c8d0;
  --accent-hi: #d8e0e6;
  --accent-glow: rgba(192,200,208,0.15);
  --ok: #22c55e;
  --hero-grad: linear-gradient(180deg, #0f1115 0%, #0a0b0d 100%);
  --ph-bg: linear-gradient(180deg, #15181d 0%, #0f1115 100%);
  --ph-stripe: rgba(255,255,255,0.018);
  --ph-dash: rgba(255,255,255,0.06);
  --ph-label-bg: rgba(10,11,13,0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,0.6);
  --shadow-sm: 0 4px 12px -2px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.05; }
.display { font-size: clamp(44px, 7vw, 112px); font-weight: 500; letter-spacing: -0.04em; line-height: 0.95; }
.h1 { font-size: clamp(36px, 5vw, 72px); letter-spacing: -0.03em; }
.h2 { font-size: clamp(28px, 3.4vw, 48px); letter-spacing: -0.025em; }
.h3 { font-size: clamp(20px, 1.6vw, 26px); letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--fg-mute);
}
.lead { font-size: clamp(16px, 1.15vw, 19px); color: var(--fg-dim); max-width: 60ch; text-wrap: pretty; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Multilingual overflow safety ── */
/* Prevent long French/Italian/English words from breaking card and nav layouts */
.h1, .h2, .h3, h1, h2, h3, h4 {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.lead {
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* Nav links: allow natural wrapping but prevent overflow */
.hdr-nav a { overflow-wrap: break-word; min-width: 0; }
/* Buttons: allow wrapping on very small screens instead of overflowing */
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; }
}
/* Cards: prevent long words from breaking card width */
.v-body, .v-title, .why-item, .sell-opt p, .fin-step, .team-body {
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Topbar: hide overflow gracefully on narrow screens */
.topbar-left span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
/* Section heads with long translated text */
.section-head h2, .section-head .h1, .section-head .h2 {
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* Form labels in other languages */
label { overflow-wrap: break-word; }
/* Footer links */
.footer-col a, .footer-col p { overflow-wrap: break-word; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn .arr { transition: transform .25s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 10px 30px -10px rgba(10,20,40,0.3);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--fg-mute); }
.btn-white { background: var(--bg-1); color: var(--fg); border: 1px solid var(--line); }
.btn-white:hover { background: var(--bg-2); }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-lg { padding: 18px 28px; font-size: 16px; }

/* Cards */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }

/* Placeholder imagery */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      var(--ph-stripe) 0 2px,
      transparent 2px 10px
    ),
    var(--ph-bg);
  color: var(--fg-mute);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
}
.ph::before {
  content: "";
  position: absolute; inset: 10px;
  border: 1px dashed var(--ph-dash);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
}
.ph span {
  position: relative;
  padding: 6px 10px;
  background: var(--ph-label-bg);
  backdrop-filter: blur(6px);
  border-radius: 4px;
}

/* Divider */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Utils */
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; } .gap-4 { gap: 32px; }
.hide-mobile { }
@media (max-width: 820px) {
  .hide-mobile { display: none !important; }
}

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

/* Scroll marquee */
.marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track { display: flex; gap: 64px; width: max-content; animation: marquee 40s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-mute); }

/* Input */
input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 10px;
  font: inherit;
  transition: border-color .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--fg); outline: none; }
label { font-size: 13px; color: var(--fg-dim); display: block; margin-bottom: 6px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }

/* Reveal on scroll — animate IN, but always default to visible if JS never toggles */
.reveal { opacity: 1; transition: opacity .7s ease, transform .7s ease; }
.js-reveal-active .reveal:not(.in) { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: none; }

/* ═══════════════════════════════════════════════════════════
   Theme Toggle
   ═══════════════════════════════════════════════════════════ */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, border-color .2s ease, transform .3s ease;
}
.theme-toggle:hover { background: var(--bg-2); border-color: var(--fg-mute); transform: rotate(12deg); }

/* .accent-text is defined in pages.css */

/* ═══════════════════════════════════════════════════════════
   Brand Logo Badges
   ═══════════════════════════════════════════════════════════ */
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--fg);
  transition: border-color .2s ease, transform .2s ease, color .2s ease;
  flex-shrink: 0;
}
.brand-badge:hover { border-color: var(--fg); transform: translateY(-2px); }
.brand-badge-inner {
  display: flex; align-items: center; justify-content: center;
  color: var(--fg);
}
.brand-strip {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 28px 0;
}
.brand-strip .brand-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-align: center;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Chatbot
   ═══════════════════════════════════════════════════════════ */
.chat-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px -8px rgba(10,20,40,0.4);
  z-index: 200;
  transition: transform .25s ease, background .2s ease;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.chat-fab.open { background: var(--bg-2); color: var(--fg); border: 1px solid var(--line-2); }
.chat-dot {
  position: absolute; top: 10px; right: 10px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--bg);
  animation: chat-pulse 2s ease-in-out infinite;
}
@keyframes chat-pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.6;transform:scale(1.2);} }

.chat-panel {
  position: fixed;
  bottom: 92px; right: 24px;
  width: min(380px, calc(100vw - 48px));
  height: min(560px, calc(100vh - 120px));
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(10,20,40,0.3);
  z-index: 199;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: chat-in .25s ease-out;
}
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--fg); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.chat-close {
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--fg-dim);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.chat-close:hover { background: var(--bg-2); color: var(--fg); }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
}
.chat-msg { display: flex; gap: 8px; max-width: 90%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--fg); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.chat-msg.bot .chat-bubble {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
  color: var(--fg);
}
.chat-msg.user .chat-bubble {
  background: var(--fg);
  color: var(--bg);
  border-top-right-radius: 4px;
}
.chat-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-mute);
  animation: typing 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.chat-quick button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-body);
  transition: border-color .15s ease, background .15s ease;
}
.chat-quick button:hover { border-color: var(--fg); background: var(--bg-2); }

.chat-input {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.chat-input input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 999px;
}
.chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.chat-send:hover { transform: scale(1.05); }

/* ═══════════════════════════════════════════════════════════
   Live Feed Indicator
   ═══════════════════════════════════════════════════════════ */
.live-indicator {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.live-indicator::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  animation: chat-pulse 1.5s ease-in-out infinite;
}
