/* ============================================================
   flAI agency — Design System consolidated tokens.
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ---- Colors ---- */
:root {
  /* ---- Canvas (near-black, faint green undertone) ---- */
  --flai-ink-950:  #080A09;   /* primary canvas / page background */
  --flai-ink-900:  #0E1311;   /* raised surface / card base */
  --flai-ink-850:  #141A17;   /* card on a raised panel */

  /* legacy aliases — old emerald names now map onto the ink canvas */
  --flai-emerald-900: var(--flai-ink-950);
  --flai-emerald-800: var(--flai-ink-900);

  /* ---- Green — PRIMARY accent (spring / mint) ---- */
  --flai-green:        #3CDD97;   /* primary accent — CTAs, success, glow */
  --flai-green-bright: #5CE8AC;   /* hover / highlight */
  --flai-green-600:    #1FA871;   /* deep green — borders, pressed */
  --flai-green-300:    #86E6BD;   /* soft green — accent text on dark */

  /* ---- Fuchsia — section openers, the flamingo ---- */
  --flai-fuchsia:     #FF2870;   /* hot flamingo pink — eyebrows, alert CTA */
  --flai-fuchsia-300: #FF6E9F;   /* lighter fuchsia — risk/alert text */
  --flai-fuchsia-700: #C71E5A;   /* deep fuchsia — gradient end */

  /* ---- Gold — money / premium framing ---- */
  --flai-gold:        #E8C572;   /* warm gold — payment panels, hairlines */
  --flai-gold-600:    #D9B24C;   /* deeper gold */

  --flai-cream:       #FBF6EC;   /* legacy light chip (dark-wordmark logo) */

  /* ---- Neutrals (greenish grey ramp, tuned to the dark canvas) ---- */
  --flai-white:       #FFFFFF;
  --flai-mist:        #E3EAE6;   /* hero / lead copy on dark */
  --flai-sage-300:    #C8D2CD;   /* body text inside cards */
  --flai-sage-400:    #AEBAB4;   /* default / secondary body text */
  --flai-sage-500:    #8C998F;   /* muted labels / captions */
  --flai-sage-600:    #74817A;   /* sub-captions */
  --flai-sage-700:    #5A6660;   /* faint / footnote / em-dash cells */

  /* ---- Semantic aliases ---- */
  --color-bg:            var(--flai-ink-950);
  --color-bg-raised:     var(--flai-ink-900);
  --color-accent:        var(--flai-green);     /* PRIMARY accent */
  --color-accent-soft:   var(--flai-green-300);
  --color-accent-2:      var(--flai-fuchsia);   /* secondary accent */
  --color-secondary:     var(--flai-gold);      /* money / premium */
  --color-positive:      var(--flai-green);

  --text-strong:   var(--flai-white);
  --text-body:     var(--flai-sage-400);
  --text-body-card:var(--flai-sage-300);
  --text-muted:    var(--flai-sage-500);
  --text-faint:    var(--flai-sage-700);
  --text-green:    var(--flai-green-300);
  --text-gold:     var(--flai-gold);
  --text-accent:   var(--flai-fuchsia);

  /* ---- Surfaces & lines (translucent, layered over the canvas) ---- */
  --surface-card:        rgba(255, 255, 255, 0.03);
  --surface-card-2:      rgba(255, 255, 255, 0.05);
  --surface-raised:      var(--flai-ink-900);
  --surface-glass:       rgba(8, 10, 9, 0.72);    /* sticky header blur layer */
  --surface-emerald:     var(--flai-ink-900);     /* legacy alias */

  --border-subtle:   rgba(255, 255, 255, 0.08);
  --border-hair:     rgba(255, 255, 255, 0.06);
  --border-green:    rgba(60, 221, 151, 0.30);
  --border-green-2:  rgba(60, 221, 151, 0.18);
  --border-gold:     rgba(232, 197, 114, 0.22);
  --border-gold-2:   rgba(232, 197, 114, 0.16);
  --border-fuchsia:  rgba(255, 40, 112, 0.30);

  /* ---- Accent tints (for callouts / totals / badges) ---- */
  --tint-green:      rgba(60, 221, 151, 0.10);
  --tint-green-2:    rgba(60, 221, 151, 0.07);
  --tint-fuchsia:    rgba(255, 40, 112, 0.10);
  --tint-fuchsia-2:  rgba(255, 40, 112, 0.07);
  --tint-gold:       rgba(232, 197, 114, 0.08);
  --tint-gold-2:     rgba(232, 197, 114, 0.16);
}

/* ---- Typography ---- */
:root {
  /* ---- Families ---- */
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;

  /* ---- Weights ---- */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    800;

  /* ---- Display scale (Unbounded) ---- */
  --text-hero:     clamp(46px, 7vw, 104px);   /* h1 — big uppercase page hero */
  --text-display:  clamp(30px, 4.2vw, 52px);  /* big summary blocks */
  --text-h2:       clamp(28px, 3.6vw, 44px);  /* section titles */
  --text-h3:       clamp(24px, 3vw, 34px);    /* sub-section titles */
  --text-marker:   74px;                      /* stroked section numbers */

  /* ---- Body & UI scale (Manrope) ---- */
  --text-lead:     17px;   /* hero / intro paragraph */
  --text-body-lg:  16.5px; /* section intro copy */
  --text-base:     15px;   /* card body */
  --text-sm:       14.5px; /* table cells */
  --text-xs:       13px;   /* nav, meta */
  --text-2xs:      12px;   /* captions, eyebrows */
  --text-3xs:      11px;   /* table column headers */

  /* ---- Eyebrow (small uppercase label) ---- */
  --eyebrow-size:    12px;
  --eyebrow-track:   4px;
  --eyebrow-track-sm:3px;

  /* ---- Line heights ---- */
  --lh-tight:   1.02;  /* display headlines */
  --lh-snug:    1.2;
  --lh-normal:  1.6;   /* body copy */
  --lh-relaxed: 1.65;
  --lh-loose:   1.75;  /* lists */

  /* ---- Tracking ---- */
  --track-hero:    -2px;   /* tighten huge uppercase hero */
  --track-display: -1px;   /* tighten big Unbounded */
  --track-label:   1.5px;
  --track-eyebrow: 4px;
}

/* ---- Spacing, Radii & Layout ---- */
:root {
  /* ---- Spacing scale ---- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  26px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  54px;   /* section vertical padding */
  --space-10: 78px;   /* hero top padding */

  /* ---- Layout ---- */
  --container: 1140px;        /* max content width */
  --gutter:    32px;          /* horizontal page padding */
  --section-pad-y: 54px;

  /* ---- Radii ---- */
  --radius-sm:   11px;   /* small chips / inline buttons */
  --radius-md:   14px;   /* callouts, small surfaces */
  --radius-lg:   18px;   /* cards, tables */
  --radius-xl:   24px;   /* hero panels, formula block */
  --radius-2xl:  28px;   /* large feature panels */
  --radius-pill: 20px;   /* badges */
  --radius-full: 999px;  /* buttons — fully rounded pills */
  --radius-round:50%;

  /* ---- Borders ---- */
  --border-w:    1px;
  --accent-bar:  3px;     /* left accent bar on callouts */
}

/* ---- Effects ---- */
:root {
  /* ---- Elevation (deep, soft, near-black canvas) ---- */
  --shadow-sm:  0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-md:  0 18px 44px rgba(0, 0, 0, 0.40);
  --shadow-lg:  0 22px 54px rgba(0, 0, 0, 0.48);
  --shadow-xl:  0 28px 64px rgba(0, 0, 0, 0.55);   /* hero panels */

  /* ---- Coloured accent shadows (on buttons) ---- */
  --glow-green:    0 10px 30px rgba(60, 221, 151, 0.30);   /* primary CTA */
  --glow-gold:     0 8px 24px rgba(232, 197, 114, 0.22);
  --glow-fuchsia:  0 8px 24px rgba(255, 40, 112, 0.28);

  /* ---- Gradients ---- */
  --grad-progress: linear-gradient(90deg, #3CDD97, #FF2870);            /* scroll bar */
  --grad-avatar:   linear-gradient(135deg, #FF2870, #C71E5A);           /* initials badge */
  --grad-panel:    linear-gradient(135deg, rgba(60,221,151,.12), rgba(232,197,114,.07)); /* summary panel */
  --grad-cta:      linear-gradient(135deg, #3CDD97, #1FA871);           /* lush green button */

  /* ---- Ambient radial glows (decorative page lighting) ---- */
  --glow-amb-green:   radial-gradient(circle, rgba(60,221,151,.22), transparent 70%); /* primary, behind CTAs */
  --glow-amb-fuchsia: radial-gradient(circle, rgba(255,40,112,.16), transparent 70%); /* flamingo lighting */
  --glow-amb-gold:    radial-gradient(circle, rgba(232,197,114,.10), transparent 70%);

  /* ---- Blur ---- */
  --blur-glass: 14px;   /* sticky header backdrop-filter */

  /* ---- Motion ---- */
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-reveal: 0.7s;
  --reveal-shift: 28px;
}

/* Logo / hero float */
@keyframes flaiFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Scroll-reveal helper (sections fade up into place) */
@keyframes flaiRevealUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* Unified Navigation Header Styling */
header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border-gold-2);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-text {
  line-height: 1.05;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 15px;
  color: var(--text-strong);
}

.brand-name span {
  color: var(--flai-fuchsia);
}

.brand-sub {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}

/* Header Lesson Banner (used when full nav menu is replaced by lesson title banner) */
.header-lesson-banner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 197, 114, 0.22);
  border-radius: 999px;
  padding: 6px 18px 6px 8px;
}
.header-lesson-pill {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--flai-ink-950);
  background: var(--flai-green);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(60, 221, 151, 0.4);
}
.header-lesson-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--flai-white);
}
.header-lesson-sub {
  font-size: 13px;
  color: var(--flai-gold);
  font-weight: 600;
}
@media (max-width: 768px) {
  .header-lesson-sub { display: none; }
  .header-lesson-title { font-size: 12px; }
  .header-lesson-banner { padding: 4px 12px 4px 6px; }
}

nav {
  display: flex;
  gap: 26px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  align-items: center;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s var(--ease-soft);
}

nav a:hover {
  color: var(--flai-gold);
}

nav a.active {
  color: var(--flai-fuchsia) !important;
}

/* Global Buttons Style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  line-height: 1;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease-soft), filter 0.15s var(--ease-soft);
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-md {
  padding: 15px 28px;
  font-size: var(--text-base);
}

.btn-sm {
  padding: 10px 18px;
  font-size: var(--text-xs);
}

.btn-green {
  background: var(--flai-green);
  color: var(--flai-ink-950);
  box-shadow: var(--glow-green);
}

.btn-fuchsia {
  background: var(--flai-fuchsia);
  color: var(--flai-white);
  box-shadow: var(--glow-fuchsia);
}

.btn-gold {
  background: var(--flai-gold);
  color: var(--flai-ink-950);
  box-shadow: var(--glow-gold);
}

.btn-ghost {
  background: transparent;
  color: var(--flai-white);
  border: 1px solid var(--border-subtle);
}

/* Responsive container spacing overrides */
@media (max-width: 1024px) {
  :root {
    --gutter: 24px;
  }
}
@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }
}
@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }
}

/* Overflow protection */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
}

/* --- Navigation Layout and Responsiveness --- */
.desktop-nav {
  display: flex;
  gap: 26px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  align-items: center;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 6px;
  z-index: 70;
}

.menu-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--flai-white);
  border-radius: 2px;
  transition: all 0.25s var(--ease-soft);
}

/* Responsive navigation visibility */
@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
}

/* Mobile overlay styles */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  background: #080a09 !important; /* Solid Canvas Dark Background */
  z-index: 1000000 !important; /* Ensure it stacks above everything */
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 54px;
}

.menu-close {
  background: transparent;
  border: none;
  color: var(--flai-white);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-soft);
}

.menu-close:hover {
  transform: scale(1.08) rotate(90deg);
  color: var(--flai-fuchsia);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  text-align: center;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
  display: block;
  width: 100%;
}

.mobile-link:hover, .mobile-link.active {
  color: var(--flai-fuchsia);
  transform: translateY(-1px);
}

/* Interactive Cursor Glow styling */
.cursor-glow {
  position: fixed;
  width: 600px; /* Increased size to let the blur diffuse smoothly */
  height: 600px;
  background: radial-gradient(circle, rgba(255, 40, 112, 0.18) 0%, rgba(255, 40, 112, 0.06) 45%, rgba(255, 40, 112, 0) 75%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: blur(80px); /* Heavy blur filter to soften the gradient edge */
  -webkit-filter: blur(80px);
  z-index: 1; /* Renders above background grid/glows but behind cards/content container */
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
}

/* Stacking context to place main page sections above the cursor glow */
section, main, footer {
  position: relative;
  z-index: 2;
}

/* Glassmorphism backdrop blur on cards and tables so the glow shines through beautifully */
.article-card, 
.feature-card, 
.footer-card, 
.table-shell, 
.info-card,
.cta-box {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- Layout Container ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

/* ---- Footer Layout and Typography ---- */
footer {
  border-top: 1px solid var(--border-gold-2);
  background: transparent;
  position: relative;
  z-index: 2;
}

.footer-top {
  padding-top: 54px;
  padding-bottom: 54px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 800px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 800px) {
  .footer-brand {
    justify-content: center;
  }
}

.footer-logo {
  background: var(--flai-cream);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: inline-block;
  width: 48px;
  height: 48px;
}

.footer-logo img {
  width: 100%;
  height: auto;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
}

.footer-text {
  color: var(--flai-sage-400);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  max-width: 480px;
}

@media (max-width: 800px) {
  .footer-text {
    margin: 0 auto;
  }
}

.footer-card {
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.footer-card-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--flai-gold);
  font-weight: var(--fw-black);
  margin-bottom: 14px;
}

.footer-card-name {
  color: var(--flai-white);
  font-weight: var(--fw-bold);
  font-size: 18px;
  margin-bottom: 4px;
}

.footer-card-sub {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 18px;
}

.footer-bottom {
  border-top: 1px solid var(--border-hair);
  padding: 22px 0;
  text-align: center;
  color: var(--flai-sage-700);
  font-size: var(--text-xs);
}


