/* AVIS DESIGN SYSTEM — Marketing Edition */

@font-face {
  font-family: 'Familjen Grotesk';
  src: url('./font/Familjen_Grotesk/FamiljenGrotesk-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'Mona Sans';
  src: url('./font/Mona_Sans/MonaSans-VariableFont_wdth,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

:root {
  --brand: #1E5CEF;
  --bg: #FFFFFF;
  --inv: #0F0F0F;
  --glass: rgba(255, 255, 255, 0.15);
  --section-y: clamp(5rem, 8vw, 8rem); /* 80px - 128px spacing for tighter UX */
}

body {
  font-family: 'Mona Sans', sans-serif;
  background-color: var(--bg);
  color: var(--inv);
  overflow-x: hidden;
}

h1, h2, h3, .font-display {
  font-family: 'Familjen Grotesk', sans-serif;
}

/* Custom Utilities */
.section-padding {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.glass-inv {
  background: rgba(15, 15, 15, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.grain-overlay {
  position: absolute;
  inset: 0;
  background-image: url("https://grainy-gradients.vercel.app/noise.svg");
  filter: contrast(150%) brightness(100%);
  pointer-events: none;
  z-index: 5;
}

.hero-video {
  filter: saturate(1.1) contrast(1.1);
}

.text-shadow-xl {
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.code-block pre {
  white-space: pre-wrap;
  word-break: break-all;
}

/* Custom Scrollbar for code blocks */
.code-block::-webkit-scrollbar {
  width: 4px;
}
.code-block::-webkit-scrollbar-thumb {
  background: rgba(30, 92, 239, 0.3);
  border-radius: 10px;
}

/* Custom Cursor */
#cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--inv);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-difference: difference;
}

#cursor-follower {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(15, 15, 15, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.1s ease-out;
}

/* Typography Reveal */
.reveal-mask {
  overflow: hidden;
  display: inline-block;
  padding-top: 0.1em;
  padding-bottom: 0.15em;
  margin-top: -0.1em;
  margin-bottom: -0.15em;
  vertical-align: top;
}

.reveal-mask span {
  display: inline-block;
  transform: translateY(100%);
}

/* Lenis */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* Premium Aspect Ratios */
.aspect-5-3 {
  aspect-ratio: 5 / 3;
}
.aspect-3-4 {
  aspect-ratio: 3 / 4;
}
.aspect-5-2 {
  aspect-ratio: 5 / 2;
}

/* App Store-style Blurry Overlay */
.appstore-blur {
  background: rgba(15, 15, 15, 0.35);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navigation Links (Magnific Style) */
#global-header nav a {
  transition: color 0.3s ease;
  color: rgba(255, 255, 255, 0.65) !important;
}
#global-header nav a:hover {
  color: var(--brand) !important;
}
#global-header nav a.active {
  color: #FFFFFF !important;
}

#global-header.scrolled nav a {
  color: rgba(0, 0, 0, 0.5) !important;
}
#global-header.scrolled nav a:hover {
  color: var(--brand) !important;
}
#global-header.scrolled nav a.active {
  color: #000000 !important;
}


/* Primary Button States (Avis UI Kit) */
.btn-primary {
  background-color: var(--brand);
  color: #FFFFFF;
  transition: all 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hover State */
.btn-primary:hover:not(:disabled):not(.is-loading) {
  background-color: #1446C2 !important; /* Darker blue */
  filter: brightness(1) !important;
}

/* Disabled State */
.btn-primary:disabled {
  background-color: #88B1F8 !important; /* Faded blue */
  color: rgba(255, 255, 255, 0.9) !important;
  cursor: not-allowed !important;
  opacity: 1 !important; /* Override default opacity if any */
  box-shadow: none !important;
  filter: brightness(1) !important;
}

/* Loading State */
.btn-primary.is-loading {
  background-color: #88B1F8 !important; /* Faded blue */
  color: transparent !important;
  cursor: wait !important;
  pointer-events: none !important;
  box-shadow: none !important;
  filter: brightness(1) !important;
}

.btn-primary.is-loading::after {
  content: "";
  position: absolute;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Theme overrides for bright backgrounds (e.g., Tab 2) */
body[data-theme="light"] #global-header:not(.scrolled) {
  color: #000000;
}
body[data-theme="light"] #global-header:not(.scrolled) nav a {
  color: rgba(0, 0, 0, 0.5) !important;
}
body[data-theme="light"] #global-header:not(.scrolled) nav a:hover {
  color: var(--brand) !important;
}
body[data-theme="light"] #global-header:not(.scrolled) nav a.active {
  color: #000000 !important;
}
body[data-theme="light"] #global-header:not(.scrolled) #nav-logo {
  filter: none !important;
}
