@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg: #030303;           /* Absolute deep charcoal/black */
  --bg-panel: rgba(255,255,255,0.015);
  --bg-hover: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.12); /* Sharp structural lines */
  --border-dim: rgba(255,255,255,0.05);
  
  --text: #F1F5F9;         /* Harsh white */
  --dim: #94A3B8;          /* Slate prose */
  --muted: #475569;
  
  /* Solana / Technical Accents */
  --accent: #14F195;       /* Neon Mint */
  --accent2: #9945FF;      /* Deep Electric Purple */
  --alert: #EF4444;
  --warn: #F59E0B;
  
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-prose: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-fast: cubic-bezier(0.16, 1, 0.3, 1);
}

html { 
  scroll-snap-type: y mandatory; 
  scroll-behavior: smooth; 
  font-size: 16px; 
  -webkit-font-smoothing: antialiased; 
  background: var(--bg);
  overflow-x: hidden;
  max-width: 100%;
}

body { 
  font-family: var(--font-prose); 
  background: var(--bg); 
  color: var(--text); 
  line-height: 1.6; 
  overflow-x: hidden;
  max-width: 100%;
}

::selection { background: var(--accent2); color: #fff; }
::-webkit-scrollbar { width: 0px; } /* Clean, hidden scrollbar for editorial feel */

/* ── Global Noise Overlay ── */
.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* ── Structural Deck & Panels ── */
.deck {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.slide-panel {
  min-height: 100vh;
  width: 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center; /* keep center, but protect with padding/overflow */
  padding: max(5rem, 6vw) 4vw;
  border-bottom: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Raw Structural Grid Overlay (Optional Subtle Lines) */
.slide-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 4vw; right: 4vw; bottom: 0;
  border-left: 1px solid var(--border-dim);
  border-right: 1px solid var(--border-dim);
  pointer-events: none;
  z-index: 0;
}

/* ── Centralized Symmetrical Layout (Canva/Keynote Style) ── */
.content-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 1200px; /* Constrained for reading flow */
  margin: 0 auto;
  z-index: 10;
  position: relative;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Symmetrical Auto-Grids for Data Cards */
.grid-sym-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; width: 100%; margin-top: 3rem; }
.grid-sym-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; width: 100%; margin-top: 3rem; }
.grid-sym-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; width: 100%; margin-top: 3rem; }

@media (max-width: 1023px) {
  .grid-sym-2, .grid-sym-3, .grid-sym-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .content-center { text-align: left; align-items: flex-start; } /* Mobile often needs left-alignment for readability */
}

/* ── Monumental Typography (Centered Adjustments) ── */
.t-display {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 8vw, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 1rem;
  overflow-wrap: break-word;
  word-break: keep-all; 
}

.t-display-outline {
  -webkit-text-stroke: 1px var(--text);
  color: transparent;
}

.t-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dim);
  display: block;
  margin-bottom: 1.5rem;
}

.t-eyebrow::before {
  content: '—';
  margin-right: 0.5rem;
  color: var(--accent);
}

.t-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.t-prose {
  font-family: var(--font-prose);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  color: var(--dim);
  line-height: 1.7;
  max-width: 65ch;
  font-weight: 300;
}

.t-prose strong {
  font-weight: 600;
  color: var(--text);
}

/* Gradient text utilities */
.glow-solana {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Brutalist UI Elements ── */

/* Data Box (Softer Premium Style) */
.bento-box {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.4s var(--ease);
}

.bento-box:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.bento-data-value {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.05em;
}

.bento-data-label {
  font-family: var(--font-prose);
  font-size: 0.85rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* List Items (Tick marks) */
.data-list {
  list-style: none;
  border-top: 1px solid var(--border);
}
.data-list li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.data-list-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.2rem;
}
.data-list-content h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.data-list-content p {
  font-size: 0.9rem;
  color: var(--dim);
  line-height: 1.6;
}

/* ── Absolute Slide Numbers ── */
.abs-slide-num {
  position: absolute;
  top: 4vw;
  right: 4vw;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--border); /* extremely subtle */
  user-select: none;
}

.abs-logo {
  position: absolute;
  top: 4vw;
  left: 4vw;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.abs-logo::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--accent);
}

/* ── Navigation Track ── */
.progress-track {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border);
  z-index: 900;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width 0.6s var(--ease);
}

.nav-brutal {
  position: fixed;
  bottom: 2rem;
  right: 4vw;
  max-width: 90%;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  z-index: 900;
}
.nav-brutal-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-brutal-btn:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}
.nav-brutal-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* ── Advanced Clip-Path Animations ── */
.mask-wrap {
  clip-path: polygon(0 -30%, 100% -30%, 100% 130%, 0 130%); /* Protects ascenders/descenders */
  display: block;
}

.mask-el {
  transform: translateY(110%);
  transition: transform 1.2s var(--ease);
  will-change: transform;
}

.is-active .mask-el {
  transform: translateY(0);
  opacity: 1;
}

.fade-el {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.is-active .fade-el {
  opacity: 1;
  transform: translateY(0);
}

/* Staggering Utilities */
.d-1 { transition-delay: 0.1s; }
.d-2 { transition-delay: 0.2s; }
.d-3 { transition-delay: 0.3s; }
.d-4 { transition-delay: 0.4s; }
.d-5 { transition-delay: 0.5s; }

/* ── Unique Slide Overrides ── */

/* Canvas backgrounds */
#demoCanvasContainer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 50%;
  z-index: 0;
  pointer-events: none;
}

/* ── Interactive Demo UI (Canva Premium Style) ── */
.demo-nav {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.5rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  overflow-x: auto;
}

/* Hide scrollbar for demo nav on mobile */
.demo-nav::-webkit-scrollbar { display: none; }
.demo-nav { -ms-overflow-style: none; scrollbar-width: none; }

.demo-tab {
  background: transparent;
  color: var(--dim);
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-family: var(--font-prose);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}

.demo-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.demo-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.demo-back {
  position: fixed;
  top: 2rem;
  left: 3vw;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--font-prose);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transition: all 0.3s var(--ease);
}
@media (max-width: 1023px) { .demo-back { top: auto; bottom: 2rem; } }
.demo-back:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }

.demo-section {
  display: none;
  width: 100%;
  animation: fadeIn 0.8s var(--ease) forwards;
}

.demo-section.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.demo-canvas-wrap {
  width: 100%;
  max-width: 1200px; /* Expansive Premium width */
  margin: 3rem auto;
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.demo-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Floating Badges Over Canvas */
.demo-badge, .demo-hint {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--dim);
}
.demo-badge { top: 1.5rem; right: 1.5rem; color: var(--accent); border-color: rgba(20, 184, 166, 0.3); }
.demo-hint { bottom: 1.5rem; left: 1.5rem; }

/* Actor Nodes inside Canvas areas (if HTML layered) */
.actor-node {
  border: 1px solid var(--border);
  padding: 1.5rem;
  position: relative;
}
.actor-node::before {
  content: '';
  position: absolute;
  top: -10px; left: -10px;
  width: 20px; height: 2px; background: var(--border);
}
.actor-node::after {
  content: '';
  position: absolute;
  top: -10px; left: -10px;
  width: 2px; height: 20px; background: var(--border);
}

/* Flow Arrows */
.arrow-down {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 1rem 0;
  position: relative;
}
.arrow-down::after {
  content: '↓';
  position: absolute;
  bottom: -15px; left: -4px;
  font-family: var(--font-mono);
  color: var(--dim);
  font-size: 12px;
}

@media (max-width: 1023px) {
  #demoCanvasContainer {
    width: 100%;
    opacity: 0.2; /* Fade canvas on mobile to show text clearly */
  }
}
