@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Instrument+Sans:wght@400;500;600&display=swap');
@import 'tailwindcss' source('../');

@import 'tw-animate-css';

@custom-variant dark (&:is(.dark *));

body {
  @apply m-0;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family:
    source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}


:root {
  --font-body: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --font-heading: 'Bricolage Grotesque', 'Instrument Sans', ui-sans-serif, sans-serif;
  --content-width: 76rem;
  --reading-width: 42rem;
  /* Warm paper, deep forest green, kente gold */
  --background: oklch(0.975 0.012 85);
  --foreground: oklch(0.22 0.035 160);
  --card: oklch(0.993 0.006 85);
  --card-foreground: oklch(0.22 0.035 160);
  --popover: oklch(0.993 0.006 85);
  --popover-foreground: oklch(0.22 0.035 160);
  --primary: oklch(0.36 0.085 158);
  --primary-foreground: oklch(0.98 0.012 85);
  --secondary: oklch(0.93 0.03 90);
  --secondary-foreground: oklch(0.26 0.05 158);
  --muted: oklch(0.94 0.014 85);
  --muted-foreground: oklch(0.47 0.03 150);
  --accent: oklch(0.82 0.15 82);
  --accent-foreground: oklch(0.24 0.045 158);
  --destructive: oklch(0.56 0.21 28);
  --destructive-foreground: oklch(0.98 0 0);
  --border: oklch(0.88 0.02 85);
  --input: oklch(0.86 0.022 85);
  --ring: oklch(0.55 0.11 158);
  --chart-1: oklch(0.36 0.085 158);
  --chart-2: oklch(0.82 0.15 82);
  --chart-3: oklch(0.56 0.21 28);
  --chart-4: oklch(0.6 0.1 200);
  --chart-5: oklch(0.7 0.12 130);
  --radius: 0.875rem;
  --sidebar: oklch(0.96 0.014 85);
  --sidebar-foreground: oklch(0.22 0.035 160);
  --sidebar-primary: oklch(0.36 0.085 158);
  --sidebar-primary-foreground: oklch(0.98 0.012 85);
  --sidebar-accent: oklch(0.93 0.03 90);
  --sidebar-accent-foreground: oklch(0.26 0.05 158);
  --sidebar-border: oklch(0.88 0.02 85);
  --sidebar-ring: oklch(0.55 0.11 158);
}

.dark {
  --background: oklch(0.18 0.03 160);
  --foreground: oklch(0.96 0.012 85);
  --card: oklch(0.22 0.035 160);
  --card-foreground: oklch(0.96 0.012 85);
  --popover: oklch(0.22 0.035 160);
  --popover-foreground: oklch(0.96 0.012 85);
  --primary: oklch(0.82 0.15 82);
  --primary-foreground: oklch(0.2 0.035 160);
  --secondary: oklch(0.28 0.04 160);
  --secondary-foreground: oklch(0.96 0.012 85);
  --muted: oklch(0.27 0.035 160);
  --muted-foreground: oklch(0.74 0.03 120);
  --accent: oklch(0.82 0.15 82);
  --accent-foreground: oklch(0.2 0.035 160);
  --destructive: oklch(0.5 0.19 28);
  --destructive-foreground: oklch(0.96 0 0);
  --border: oklch(0.32 0.035 160);
  --input: oklch(0.34 0.035 160);
  --ring: oklch(0.7 0.12 82);
  --chart-1: oklch(0.82 0.15 82);
  --chart-2: oklch(0.7 0.12 158);
  --chart-3: oklch(0.6 0.19 28);
  --chart-4: oklch(0.65 0.1 200);
  --chart-5: oklch(0.75 0.12 130);
  --sidebar: oklch(0.2 0.03 160);
  --sidebar-foreground: oklch(0.96 0.012 85);
  --sidebar-primary: oklch(0.82 0.15 82);
  --sidebar-primary-foreground: oklch(0.2 0.035 160);
  --sidebar-accent: oklch(0.28 0.04 160);
  --sidebar-accent-foreground: oklch(0.96 0.012 85);
  --sidebar-border: oklch(0.32 0.035 160);
  --sidebar-ring: oklch(0.7 0.12 82);
}

@theme inline {
  --font-sans: var(--font-body);
  --font-display: var(--font-heading);
  --container-content: var(--content-width);
  --container-reading: var(--reading-width);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

@layer base {
  h1,
  h2,
  h3 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
  }
}

/* Kente-inspired stripe used as a decorative band */
.kente-band {
  background-image: repeating-linear-gradient(
    90deg,
    var(--accent) 0 18px,
    var(--primary) 18px 26px,
    var(--destructive) 26px 30px,
    var(--primary) 30px 38px,
    var(--accent) 38px 56px,
    var(--foreground) 56px 60px
  );
}

.dot-grid {
  background-image: radial-gradient(color-mix(in oklch, var(--foreground) 14%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bubble-in {
  animation: bubble-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .bubble-in {
    animation: none;
  }
}

/* ---------- Atmosphere: deep forest stage with gold/emerald aurora ---------- */
:root {
  --forest-950: oklch(0.17 0.035 162);
  --forest-900: oklch(0.21 0.045 160);
  --forest-800: oklch(0.27 0.06 158);
  --emerald-glow: oklch(0.62 0.13 160);
  --gold-glow: oklch(0.8 0.15 80);
  --ember-glow: oklch(0.64 0.17 40);
}

.stage {
  position: relative;
  isolation: isolate;
  color: oklch(0.97 0.012 85);
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in oklch, var(--forest-800) 80%, transparent), transparent 60%),
    linear-gradient(160deg, var(--forest-900), var(--forest-950) 70%);
}

.aurora {
  position: absolute;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  filter: blur(60px) saturate(1.1);
  background:
    radial-gradient(35% 40% at 20% 30%, color-mix(in oklch, var(--emerald-glow) 55%, transparent), transparent 70%),
    radial-gradient(30% 35% at 80% 20%, color-mix(in oklch, var(--gold-glow) 45%, transparent), transparent 70%),
    radial-gradient(25% 30% at 65% 85%, color-mix(in oklch, var(--ember-glow) 30%, transparent), transparent 70%);
  animation: aurora-drift 22s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes aurora-drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, -3%, 0) rotate(6deg) scale(1.08); }
  100% { transform: translate3d(-3%, 4%, 0) rotate(-4deg) scale(1.02); }
}

/* Static film grain; sits on a non-scrolling layer inside its section */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.line-grid {
  background-image:
    linear-gradient(color-mix(in oklch, white 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, white 7%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
}

.glass {
  background: linear-gradient(145deg, color-mix(in oklch, white 11%, transparent), color-mix(in oklch, white 3%, transparent));
  border: 1px solid color-mix(in oklch, white 14%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.text-gold {
  background: linear-gradient(100deg, oklch(0.9 0.11 90), var(--gold-glow) 35%, oklch(0.72 0.16 60) 60%, oklch(0.92 0.09 92));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 7s ease-in-out infinite;
}

.text-forest {
  background: linear-gradient(110deg, var(--primary), oklch(0.5 0.12 165) 55%, oklch(0.62 0.14 120));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Gradient hairline border via mask; set --ring-from / --ring-to to recolor */
.gradient-border {
  position: relative;
  isolation: isolate;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, var(--ring-from, var(--gold-glow)), transparent 40%, transparent 60%, var(--ring-to, var(--emerald-glow)));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.btn-gold {
  color: var(--forest-950);
  background: linear-gradient(135deg, oklch(0.9 0.12 90), var(--gold-glow) 45%, oklch(0.72 0.16 62));
  box-shadow:
    inset 0 1px 0 color-mix(in oklch, white 55%, transparent),
    0 10px 30px -10px color-mix(in oklch, var(--gold-glow) 70%, transparent);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 color-mix(in oklch, white 55%, transparent),
    0 16px 36px -10px color-mix(in oklch, var(--gold-glow) 85%, transparent);
}
.btn-gold:active { transform: translateY(0) scale(0.98); }

.shadow-deep {
  box-shadow:
    0 1px 0 color-mix(in oklch, white 60%, transparent) inset,
    0 2px 4px -2px color-mix(in oklch, var(--forest-950) 12%, transparent),
    0 24px 48px -24px color-mix(in oklch, var(--forest-950) 30%, transparent);
}

.float-slow { animation: float 7s ease-in-out infinite; }
.float-slower { animation: float 9s ease-in-out -3s infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); }
  50% { transform: translateY(-12px) rotate(var(--tilt, 0deg)); }
}

.marquee {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

.rise {
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

.pulse-dot { position: relative; }
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: inherit;
  animation: pulse-ring 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
@keyframes pulse-ring {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(2.8); opacity: 0; }
}

.spotlight {
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in oklch, var(--gold-glow) 16%, transparent), transparent 60%);
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .text-gold, .float-slow, .float-slower, .marquee, .rise, .pulse-dot::after {
    animation: none;
  }
}

/* ---------- Scrolling: branded scrollbar and reading progress ---------- */
/* Firefox (Chromium ignores ::-webkit-scrollbar once scrollbar-color is set, so scope it) */
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklch, var(--primary) 75%, transparent) transparent;
  }
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: color-mix(in oklch, var(--muted) 70%, transparent);
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, oklch(0.46 0.09 158), var(--primary)) padding-box;
  min-height: 48px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), oklch(0.72 0.16 60)) padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, oklch(0.72 0.16 60), var(--accent)) padding-box;
}

/* Drop the plain arrow buttons at each end of the bar */
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.scroll-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--accent) 60%, oklch(0.72 0.16 60));
  box-shadow: 0 0 12px color-mix(in oklch, var(--accent) 60%, transparent);
  transition: transform 120ms linear;
}
