/* ============================================
   Automotive Insights — Speakeasy Theme
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --bg-card: #1e1e1e;
  --bg-input: #242424;
  --border-subtle: #2e2e2e;
  --border-input: #383838;
  --border-focus: #c9a96e;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #6a6a6a;
  --accent: #c9a96e;
  --accent-hover: #ddbf8a;
  --accent-glow: rgba(201, 169, 110, 0.15);
  --white: #ffffff;
  --success: #4ade80;
  --error: #f87171;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #0c1a3a 0%, #060e1f 25%, #020408 50%, #000000 75%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Background Grain Texture ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.03;
  pointer-events: none;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---------- Layout Utility ---------- */
.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav__logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav__logo-regular {
  font-weight: 400;
  color: var(--text-primary);
}

.nav__logo-bold {
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
  margin-left: 6px;
}

.nav__logo-img {
  height: 32px;
  width: auto;
  filter: invert(1);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav__link {
  position: relative;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
  padding: 4px 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #60A5FA;
  transition: width var(--transition-med);
}

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

.nav__link:hover::after {
  width: 100%;
}

.nav__link--active {
  color: var(--text-primary);
  font-weight: 500;
}

.nav__link--active::after {
  width: 100%;
}

/* Nav Login Button — exclusive pill with glow */
.nav__login-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 32px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #60A5FA;
  border: 1px solid rgba(80, 140, 220, 0.4);
  border-radius: 50px;
  background: rgba(60, 120, 200, 0.06);
  transition: all var(--transition-fast);
  z-index: 2;
}

.nav__login-btn:hover {
  color: #fff;
  border-color: rgba(100, 170, 255, 0.7);
  background: rgba(60, 120, 200, 0.12);
  box-shadow:
    0 0 20px rgba(80, 150, 255, 0.25),
    0 0 40px rgba(80, 150, 255, 0.1);
  transform: scale(1.03);
}

.nav__login-btn-text {
  position: relative;
  z-index: 1;
}

/* Nav Back Link (contact page) */
.nav__back {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
}

.nav__back:hover {
  color: #60A5FA;
}

/* Spark Canvas */
#spark-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* Mobile hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all var(--transition-fast);
}

/* ---------- Hero Section (Home) ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
}

#cycle-word {
  display: inline-block;
  min-width: 10ch;
  transition: opacity 0.4s ease;
}

#cycle-word.fade-out {
  opacity: 0;
}

.hero__heading {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.03em;
  max-width: 900px;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(30px);

  color: #ffffff;
  text-shadow:
    0 0 10px rgba(59, 130, 246, 0.4),
    0 0 30px rgba(59, 130, 246, 0.25),
    0 0 60px rgba(59, 130, 246, 0.15),
    0 0 100px rgba(59, 130, 246, 0.1);
  animation: heading-glow 5s ease-in-out infinite;
}

@keyframes heading-glow {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(59, 130, 246, 0.3),
      0 0 30px rgba(59, 130, 246, 0.15),
      0 0 60px rgba(59, 130, 246, 0.08),
      0 0 100px rgba(59, 130, 246, 0.04);
  }
  50% {
    text-shadow:
      0 0 15px rgba(59, 130, 246, 0.6),
      0 0 40px rgba(59, 130, 246, 0.35),
      0 0 80px rgba(59, 130, 246, 0.2),
      0 0 120px rgba(59, 130, 246, 0.12);
  }
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(20px);
}

.hero__cta {
  opacity: 0;
  transform: translateY(20px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 16px 48px;
  border-radius: 50px;
  transition: all var(--transition-fast);
}

.btn--outline {
  --border-width: 2px;

  color: var(--text-secondary);
  background: transparent;
  position: relative;
  border-radius: 50px;
  border: var(--border-width) solid transparent;
  isolation: isolate;
}

.btn--outline::before {
  content: '';
  position: absolute;
  inset: calc(var(--border-width) * -1);
  z-index: -1;
  border-radius: inherit;
  padding: var(--border-width);
  background: linear-gradient(90deg, #3B82F6, #0EA5E9, #06B6D4, #3B82F6);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-breathe 4s ease-in-out infinite;
}

@keyframes border-breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

.btn--outline:hover {
  color: var(--text-primary);
  box-shadow:
    0 0 15px rgba(59, 130, 246, 0.3),
    0 0 35px rgba(14, 165, 233, 0.15),
    0 0 60px rgba(6, 182, 212, 0.08);
  transform: scale(1.02);
}

.btn--outline:hover::before {
  opacity: 1;
}

.btn--primary {
  color: var(--bg-primary);
  background: #3B82F6;
  border: 1px solid #3B82F6;
}

.btn--primary:hover {
  background: #60A5FA;
  border-color: #60A5FA;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
  transform: scale(1.02);
}

.btn--block {
  width: 100%;
}

/* ---------- Contact Page ---------- */
.contact {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 90px 24px 30px;
}

.contact__heading {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
}

.contact__form {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  flex: 1;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}

.form-group label .required {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-textarea {
  min-height: 60px;
  resize: vertical;
}

.form-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.form-footer__privacy {
  font-size: 13px;
  color: var(--text-muted);
}

.form-footer__privacy a {
  color: #60A5FA;
  transition: color var(--transition-fast);
}

.form-footer__privacy a:hover {
  color: #93C5FD;
}

/* ---------- Contact Success Message ---------- */
.contact__success {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 40px 0;
}

.contact__success-icon {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.contact__success-heading {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.contact__success-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- reCAPTCHA ---------- */
.grecaptcha-badge {
  visibility: hidden;
}

.recaptcha-attribution {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  z-index: 1;
}

.recaptcha-attribution a {
  color: #60A5FA;
}

/* ---------- Success Toast ---------- */
.toast {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-med);
}

.toast--visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast__icon {
  width: 20px;
  height: 20px;
  color: var(--success);
  flex-shrink: 0;
}

.toast__message {
  font-size: 14px;
  color: var(--text-primary);
}

/* ---------- Privacy Page ---------- */
.privacy {
  flex: 1;
  padding: 100px 24px 60px;
}

.privacy__container {
  max-width: 800px;
  margin: 0 auto;
}

.privacy__effective {
  margin-bottom: 32px;
}

.privacy__last-updated {
  margin-top: 8px;
  color: var(--text-muted);
}

.privacy h1 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.privacy h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

.privacy h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 10px;
}

.privacy p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.privacy strong {
  color: var(--text-primary);
}

.privacy ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 14px;
}

.privacy li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

.privacy a {
  color: #60A5FA;
  transition: color var(--transition-fast);
}

.privacy a:hover {
  color: #93C5FD;
}

.privacy hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 32px 0;
}

/* ---------- Privacy Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.modal-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-med);
}

.modal-overlay--visible .modal {
  transform: translateY(0) scale(1);
}

.modal__close {
  float: right;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

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

.modal h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal .modal__date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: block;
}

.modal p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.modal strong {
  color: var(--text-primary);
}

/* ---------- Footer ---------- */
.footer {
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.footer__copyright {
  font-size: 13px;
  color: var(--text-muted);
}

.footer__privacy-link {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__privacy-link:hover {
  color: #60A5FA;
}

/* ---------- Animations ---------- */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
}

.animate-in--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-in--delay-1 { transition-delay: 0.1s; }
.animate-in--delay-2 { transition-delay: 0.2s; }
.animate-in--delay-3 { transition-delay: 0.35s; }
.animate-in--delay-4 { transition-delay: 0.5s; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav {
    padding: 0 20px;
  }

  .nav__links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    background: var(--bg-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
  }

  .nav__links--open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__link {
    font-size: 18px;
  }

  .nav__hamburger {
    display: flex;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero__heading {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .contact {
    padding: 100px 20px 60px;
  }

  .contact__form {
    max-width: 100%;
  }

  .form-row {
    gap: 12px;
  }

  .privacy {
    padding: 90px 20px 40px;
  }

  .footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 20px 24px;
  }

  .toast {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }

  .recaptcha-attribution {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .nav__logo {
    font-size: 15px;
  }

  .btn {
    padding: 14px 36px;
    font-size: 13px;
  }
}
