@tailwind base;
@tailwind components;
@tailwind utilities;

body {
  overflow-x: hidden;
}

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

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

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

/* GSAP Reveal Base */
.reveal-item {
  opacity: 0;
  visibility: hidden;
}

/* Ensure Nav and Footer are never hidden unexpectedly */
#global-nav,
#global-footer {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ═══════════════════════════════════════════════════════════
   AXRIS ENHANCEMENTS v8.0 — Central styles
   Cursor, Page Transition, Cookie Consent, Scrollbar
═══════════════════════════════════════════════════════════ */

/* ── Custom Scrollbar (legal pages) ── */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 10px;
}

.custom-scrollbar:hover::-webkit-scrollbar-thumb {
  background: #D1D5DB;
}

.toc-link.active {
  color: #2563EB;
  background-color: #EFF6FF;
  font-weight: 600;
}

/* ── Page Transition Overlay ── */
#ax-transition {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #0ea5e9 100%);
  z-index: 99999;
  pointer-events: none;
  transform-origin: top center;
}

/* ── Custom Cursor — z-index ABOVE nav (nav is 9999) ── */

#ax-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100000;
  /* above everything including nav */
  will-change: transform;
}

#ax-cursor.ax-cursor--hidden .ax-cursor-dot,
#ax-cursor.ax-cursor--hidden .ax-cursor-ring {
  opacity: 0;
}

.ax-cursor-dot {
  display: none !important;
  position: fixed;
  top: -5px;
  left: -5px;
  width: 10px;
  height: 10px;
  background: #1d4ed8;
  border-radius: 50%;
  will-change: transform;
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
  pointer-events: none;
}

.ax-cursor-ring {
  position: fixed;
  top: -22px;
  left: -22px;
  width: 44px;
  height: 44px;
  border: 2px solid #1d4ed8;
  border-radius: 50%;
  will-change: transform;
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, border-color 0.3s ease, top 0.3s ease, left 0.3s ease;
  pointer-events: none;
}

/* Hover state — fill orange */
#ax-cursor.ax-cursor--active .ax-cursor-ring {
  width: 54px;
  height: 54px;
  top: -27px;
  left: -27px;
  background: rgba(249, 115, 22, 0.85);
  border-color: #f97316;
}

#ax-cursor.ax-cursor--active .ax-cursor-dot {
  display: none !important;
  width: 8px;
  height: 8px;
  top: -4px;
  left: -4px;
  background: #fff;
}

/* ── Cookie Consent Banner ── */
#ax-cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1rem;
  right: 1rem;
  max-width: 880px;
  margin: 0 auto;
  z-index: 99998;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.45s ease;
}

#ax-cookie-banner.ax-cookie--visible {
  transform: translateY(0);
  opacity: 1;
}

.ax-cookie-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  flex-wrap: wrap;
}

.ax-cookie-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.ax-cookie-text {
  flex: 1;
  min-width: 200px;
}

.ax-cookie-text h4 {
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.ax-cookie-text p {
  color: #94a3b8;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.5;
}

.ax-cookie-text a {
  color: #60a5fa;
  text-decoration: underline;
  cursor: none !important;
}

.ax-cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ax-cookie-actions button {
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

#ax-cookie-decline {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

#ax-cookie-decline:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.ax-cookie-primary {
  background: #f97316;
  color: white;
}

.ax-cookie-primary:hover {
  background: #ea580c;
}

@media (max-width: 640px) {
  .ax-cookie-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ax-cookie-actions {
    width: 100%;
  }

  .ax-cookie-actions button {
    flex: 1;
  }
}

/* ── Letter-by-letter: gradient child spans need -webkit-background-clip on each char ── */
.ax-char {
  display: inline-block;
}

/* When ax-char is inside a gradient wrapper, inherit the clip */
[class*="bg-clip-text"] .ax-char,
[class*="text-transparent"] .ax-char {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* ═══════════════════════════════════════════════════════════
   AXRIS TYPOGRAPHY HIERARCHY
   h1–h6, display numbers → Satoshi
   body text, paragraphs  → Inter
═══════════════════════════════════════════════════════════ */

/* Headings always use Satoshi */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv01";
}

/* Body, paragraphs, lists always Inter */
p,
li,
blockquote,
figcaption,
td,
th,
label,
input,
textarea,
select,
small,
span.body-text {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Buttons/nav use Satoshi (brand voice) */
button,
.btn-magnetic,
nav a {
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
}

/* Explicit utility overrides (keep after base rules) */
.font-satoshi {
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif !important;
}

.font-inter {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}


/* ═══════════════════════════════════════════════════════════
   AXRIS FLUID TYPOGRAPHY & ANTI-BREAK GLOBALS
═══════════════════════════════════════════════════════════ */
@layer base {

  /* 1. Strictly prevent mid-word breaking globally */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .font-satoshi {
    word-break: normal !important;
    overflow-wrap: normal !important;
    -webkit-hyphens: none !important;
    hyphens: none !important;
    text-wrap: balance;
    /* Modern CSS: Automatically balances lines evenly */
  }
}

@layer utilities {

  /* 2. Fluid Typography Classes - Auto-shrinks without breaking */
  .text-fluid-h1 {
    /* clamp(MIN_SIZE, IDEAL_SCALING_SIZE, MAX_SIZE) */
    font-size: clamp(2.25rem, 8vw + 0.5rem, 5rem) !important;
    line-height: 1.05 !important;
  }

  .text-fluid-h2 {
    font-size: clamp(1.875rem, 6vw + 0.5rem, 4rem) !important;
    line-height: 1.1 !important;
  }
}