/* ==========================================================
   BAM LABS — DRIVE Landing Page
   ========================================================== */

/* --- Reset & Base --- */

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

:root {
  --bg-deep: #040810;
  --bg-navy: #0a1628;
  --bg-mid: #0e1f3a;

  --text-primary: #f0f2f5;
  --text-muted: rgba(220, 225, 235, 0.6);
  --text-dim: rgba(220, 225, 235, 0.35);

  --copper: #F4C15D;
  --copper-light: #F4C15D;
  --copper-glow: rgba(244, 193, 93, 0.15);

  --blue: #4FA3FF;
  --blue-soft: rgba(79, 163, 255, 0.12);
  --blue-glow: rgba(79, 163, 255, 0.08);

  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-glow: rgba(79, 163, 255, 0.04);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1120px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-deep);
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Noise / grain background --- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 60% 20%, rgba(79, 163, 255, 0.07), transparent 70%),
    radial-gradient(ellipse 60% 50% at 30% 80%, rgba(244, 193, 93, 0.05), transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-navy) 40%, var(--bg-mid) 100%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* --- Hexagon overlay — tech style with #4FA3FF --- */

.hex-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.08;
  background-repeat: repeat;
  background-size: 260px 225px;
  background-image: url("data:image/svg+xml,%3Csvg width='260' height='225' viewBox='0 0 260 225' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M65 4 L195 4 L258 112.5 L195 221 L65 221 L2 112.5 Z' fill='none' stroke='%234FA3FF' stroke-width='0.8'/%3E%3C/svg%3E");
  animation: hexDrift 300s linear infinite;
}

@keyframes hexDrift {
  from { background-position: 0 0; }
  to   { background-position: 520px 450px; }
}

/* Second hex layer — smaller hexagons */
.hex-overlay--layer2 {
  opacity: 0.06;
  background-size: 180px 156px;
  background-image: url("data:image/svg+xml,%3Csvg width='180' height='156' viewBox='0 0 180 156' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M45 3 L135 3 L178 78 L135 153 L45 153 L2 78 Z' fill='none' stroke='%234FA3FF' stroke-width='0.5'/%3E%3C/svg%3E");
  animation: hexDrift2 400s linear infinite;
}

@keyframes hexDrift2 {
  from { background-position: 90px 40px; }
  to   { background-position: -270px 352px; }
}

/* Layer 3 — large faint hexagons */
.hex-overlay--layer3 {
  opacity: 0.04;
  background-repeat: repeat;
  background-size: 400px 346px;
  background-image: url("data:image/svg+xml,%3Csvg width='400' height='346' viewBox='0 0 400 346' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M100 5 L300 5 L398 173 L300 341 L100 341 L2 173 Z' fill='none' stroke='%234FA3FF' stroke-width='0.6'/%3E%3C/svg%3E");
  animation: hexDrift3 500s linear infinite;
}

@keyframes hexDrift3 {
  from { background-position: 200px 100px; }
  to   { background-position: -200px 546px; }
}

/* Glow accents */
.hex-glow {
  position: fixed;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vh;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(244, 193, 93, 0.08) 0%, rgba(244, 193, 93, 0.03) 40%, transparent 70%);
  animation: glowPulse 8s ease-in-out infinite alternate;
}

/* Secondary glow — bottom left */
.hex-glow--bl {
  top: auto;
  right: auto;
  bottom: -15%;
  left: -10%;
  background: radial-gradient(ellipse at center, rgba(244, 193, 93, 0.06) 0%, rgba(244, 193, 93, 0.02) 40%, transparent 70%);
  animation-delay: 4s;
}

@keyframes glowPulse {
  from { opacity: 0.6; transform: scale(1); }
  to   { opacity: 1; transform: scale(1.08); }
}

/* --- Logo background animation --- */

.logo-bg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  width: 70vmin;
  height: 70vmin;
  max-width: 700px;
  max-height: 700px;
  animation: logoFloat 30s ease-in-out infinite;
  opacity: 0.04;
}

.logo-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(0.3) brightness(1.2);
}

@keyframes logoFloat {
  0%   { transform: translate(-50%, -50%) translateY(0) scale(1); }
  25%  { transform: translate(-50%, -50%) translateY(-18px) translateX(10px) scale(1.02); }
  50%  { transform: translate(-50%, -50%) translateY(8px) translateX(-8px) scale(0.99); }
  75%  { transform: translate(-50%, -50%) translateY(-12px) translateX(6px) scale(1.01); }
  100% { transform: translate(-50%, -50%) translateY(0) scale(1); }
}

/* --- Header --- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(4, 8, 16, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header__left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header__logo-icon {
  flex-shrink: 0;
}

.header__brand {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-light);
  text-shadow: 0 0 8px rgba(244, 193, 93, 0.5), 0 0 20px rgba(244, 193, 93, 0.25);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.header__link:hover {
  color: var(--text-primary);
}

/* --- Language toggle --- */

.lang-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: border-color 0.3s;
}

.lang-toggle:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-toggle__option {
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.3s;
}

.lang-toggle__option--active {
  color: var(--copper-light);
}

.lang-toggle__divider {
  color: var(--text-dim);
}

/* --- Hero --- */

.hero {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 40px 80px;
}

.hero__inner {
  max-width: 720px;
  text-align: center;
  position: relative;
  padding: 60px 48px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.hero__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, var(--card-glow), transparent 70%);
  pointer-events: none;
}

.hero__inner:hover {
  border-color: rgba(244, 193, 93, 0.15);
  box-shadow: 0 0 40px rgba(244, 193, 93, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero__headline {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
  color: var(--copper-light);
  text-shadow: 0 0 8px rgba(244, 193, 93, 0.5), 0 0 20px rgba(244, 193, 93, 0.25);
}

.hero__body {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 560px;
  margin: 0 auto;
  font-weight: 400;
}

/* --- Feature cards --- */

.features {
  position: relative;
  z-index: 10;
  padding: 40px 40px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 40px 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, var(--card-glow), transparent 70%);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(244, 193, 93, 0.15);
  box-shadow: 0 0 40px rgba(244, 193, 93, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card__icon {
  color: var(--copper);
  margin-bottom: 20px;
  opacity: 0.7;
}

.card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.card__body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 400;
}

/* --- Bottom / Early Access --- */

.access {
  position: relative;
  z-index: 10;
  padding: 60px 40px 80px;
  text-align: center;
}

.access__inner {
  max-width: 720px;
  margin: 0 auto;
}

.access__upcoming {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 16px;
}

.access__heading {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.access__products {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px 28px;
  min-width: 200px;
  text-align: center;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.3s;
}

.product-card:hover {
  border-color: rgba(244, 193, 93, 0.15);
  box-shadow: 0 0 40px rgba(244, 193, 93, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(-3px);
}

.product-card__name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper-light);
  margin-bottom: 8px;
}

.product-card__info {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.access__form {
  margin-bottom: 24px;
}

.access__form-row {
  display: flex;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.access__input {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.access__input::placeholder {
  color: var(--text-dim);
}

.access__input:focus {
  border-color: rgba(244, 193, 93, 0.4);
  box-shadow: 0 0 0 3px rgba(244, 193, 93, 0.08);
}

.access__btn {
  padding: 14px 28px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--copper), var(--copper-light));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.2s;
  white-space: nowrap;
}

.access__btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.access__btn:active {
  transform: translateY(0);
}

.access__disclaimer {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* --- Footer --- */

.footer {
  position: relative;
  z-index: 10;
  padding: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer__copy {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* --- Fade-in animation --- */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
  }

  .header__left {
    gap: 20px;
  }

  .header__brand {
    display: none;
  }

  .header__logo-icon {
    width: 36px;
    height: 36px;
  }

  .header__nav {
    gap: 20px;
  }

  .header__link {
    font-size: 11px;
  }

  .hero {
    padding: 120px 24px 60px;
    min-height: auto;
  }

  .hero__headline {
    margin-bottom: 20px;
  }

  .hero__inner {
    padding: 40px 24px;
  }

  .features {
    padding: 20px 24px 60px;
  }

  .features__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 32px 24px;
  }

  .access {
    padding: 40px 24px 60px;
  }

  .access__form-row {
    flex-direction: column;
  }

  .access__btn {
    width: 100%;
  }

  .logo-bg {
    width: 90vmin;
    height: 90vmin;
    opacity: 0.03;
  }

  .access__products {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .product-card {
    min-width: unset;
    width: 100%;
    max-width: 300px;
    padding: 20px 24px;
  }

  .footer {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .header__nav {
    gap: 14px;
  }

  .header__link {
    font-size: 10px;
    letter-spacing: 0.04em;
  }
}

/* --- Chat Widget --- */

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(244, 193, 93, 0.4);
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.95), rgba(14, 31, 58, 0.95));
  color: var(--copper-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(244, 193, 93, 0.1);
  transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chat-toggle:hover {
  transform: scale(1.08);
  border-color: rgba(244, 193, 93, 0.6);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 30px rgba(244, 193, 93, 0.15);
}

.chat-panel {
  display: none;
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-height: 480px;
  background: rgba(10, 22, 40, 0.97);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 163, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  flex-direction: column;
  animation: chatSlideIn 0.25s ease-out;
}

.chat-panel.open {
  display: flex;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--copper-light);
}

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  max-height: 340px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-panel__messages::-webkit-scrollbar {
  width: 4px;
}

.chat-panel__messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-panel__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
}

.chat-msg--bot {
  align-self: flex-start;
  background: rgba(79, 163, 255, 0.08);
  border: 1px solid rgba(79, 163, 255, 0.12);
  color: var(--text-primary);
}

.chat-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(244, 193, 93, 0.15), rgba(244, 193, 93, 0.08));
  border: 1px solid rgba(244, 193, 93, 0.2);
  color: var(--text-primary);
}

.chat-msg--typing {
  align-self: flex-start;
  background: rgba(79, 163, 255, 0.06);
  border: 1px solid rgba(79, 163, 255, 0.1);
  color: var(--text-muted);
  font-style: italic;
}

.chat-panel__form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-panel__input {
  flex: 1;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.3s;
}

.chat-panel__input::placeholder {
  color: var(--text-dim);
}

.chat-panel__input:focus {
  border-color: rgba(244, 193, 93, 0.4);
}

.chat-panel__send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--copper), var(--copper-light));
  color: var(--bg-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.15s;
}

.chat-panel__send:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.chat-panel__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: -8px;
    bottom: 64px;
    max-height: 400px;
  }
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }
}
