/* base.css — Variables, Reset, Dark Mode, Scroll Reveal, Background Effects, Header */

:root {
  --bg: #fafbfc;
  --bg-subtle: #f3f5f8;
  --text: #1f1f1f;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border: #e8eaed;
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --accent-glow: rgba(26, 115, 232, 0.15);
  --purple-glow: rgba(99, 102, 241, 0.12);
  --cyan-glow: rgba(6, 182, 212, 0.1);
  --max-width: 1200px;
  --section-gap: 120px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Google Sans Flex", "Google Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg: #0f1117;
  --bg-subtle: #1a1d28;
  --text: #e4e6eb;
  --text-secondary: #9aa0a8;
  --text-muted: #6b7280;
  --border: #262a36;
  --accent: #4da3ff;
  --accent-hover: #7bbcff;
  --accent-glow: rgba(77, 163, 255, 0.18);
  --purple-glow: rgba(129, 140, 248, 0.14);
  --cyan-glow: rgba(6, 182, 212, 0.12);
}

[data-theme="dark"] header {
  background: rgba(15, 17, 23, 0.92);
}

[data-theme="dark"] .hero h1 {
  background: linear-gradient(135deg, #e4e6eb 0%, #a8b4c4 40%, #4da3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .hero-eyebrow {
  color: var(--accent);
  border-color: rgba(77, 163, 255, 0.25);
  background: rgba(77, 163, 255, 0.08);
}

[data-theme="dark"] .btn-primary {
  background: #e4e6eb;
  color: #0f1117;
}
[data-theme="dark"] .btn-primary:hover {
  background: #cdd0d6;
}

[data-theme="dark"] .btn-secondary {
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .chat-frame {
  border-color: var(--border);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

[data-theme="dark"] .primer-card,
[data-theme="dark"] .scenario-card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .news-list,
[data-theme="dark"] .sidebar-card,
[data-theme="dark"] .insight-panel {
  background: rgba(22, 25, 35, 0.8);
}
[data-theme="dark"] .primer-card:hover {
  background: rgba(28, 32, 44, 0.9);
}

[data-theme="dark"] .invest-tabs {
  background: rgba(22, 25, 35, 0.6);
}
[data-theme="dark"] .invest-tab.active {
  background: rgba(22, 25, 35, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .invest-tab:hover {
  background: rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .invest-card {
  background: rgba(22, 25, 35, 0.8);
}

[data-theme="dark"] .primer-card .fun-fact {
  background: rgba(77, 163, 255, 0.06);
  border-color: rgba(77, 163, 255, 0.12);
}

[data-theme="dark"] .ai-tools-intro {
  background: linear-gradient(180deg, rgba(15, 17, 23, 0.95) 0%, rgba(18, 22, 32, 0.98) 100%);
}

[data-theme="dark"] .ai-tool-category {
  background: rgba(22, 25, 35, 0.85);
  border-color: rgba(77, 163, 255, 0.12);
}
[data-theme="dark"] .ai-tool-category:hover {
  background: rgba(28, 32, 44, 0.9);
  border-color: rgba(77, 163, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(77, 163, 255, 0.2);
}

[data-theme="dark"] .ai-tool-list li {
  background: rgba(22, 25, 35, 0.6);
  border-color: rgba(77, 163, 255, 0.08);
}
[data-theme="dark"] .ai-tool-list li:hover {
  background: rgba(30, 34, 46, 0.9);
  border-color: rgba(77, 163, 255, 0.2);
}

[data-theme="dark"] .ai-tool-list .tool-try {
  color: var(--accent);
}

[data-theme="dark"] .frontier {
  background: linear-gradient(180deg, rgba(15, 17, 23, 0.95) 0%, rgba(18, 22, 32, 0.98) 100%);
}

[data-theme="dark"] .news-item:hover {
  background: rgba(77, 163, 255, 0.04);
}

[data-theme="dark"] .scenario-card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .scenario-problem {
  border-left-color: rgba(77, 163, 255, 0.25);
  color: var(--text-secondary);
}

[data-theme="dark"] .scenario-wow {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.06), rgba(129, 140, 248, 0.06));
  border-color: rgba(77, 163, 255, 0.1);
}

[data-theme="dark"] .scenario-icon {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.12) 0%, rgba(129, 140, 248, 0.12) 100%);
}

[data-theme="dark"] .scenario-tag {
  color: var(--accent);
  background: rgba(77, 163, 255, 0.12);
}

[data-theme="dark"] .insights {
  background: linear-gradient(180deg, rgba(15, 17, 23, 0.6) 0%, var(--bg) 100%);
}

[data-theme="dark"] .article-header {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .article-quote {
  background: rgba(77, 163, 255, 0.06);
  border-left-color: var(--accent);
}

[data-theme="dark"] .article-footer-note {
  border-top-color: var(--border);
}

[data-theme="dark"] .divider {
  background: var(--border);
}

[data-theme="dark"] .tech-tag {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .domain-card {
  background: rgba(22, 25, 35, 0.75);
}
[data-theme="dark"] .domain-card:hover {
  background: rgba(28, 32, 44, 0.9);
}

[data-theme="dark"] .domain-icon {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.12) 0%, rgba(129, 140, 248, 0.12) 100%);
}

[data-theme="dark"] .app-card {
  background: rgba(22, 25, 35, 0.7);
  border-color: var(--border);
}

[data-theme="dark"] .bg-grid {
  background-image:
    linear-gradient(rgba(77, 163, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 163, 255, 0.04) 1px, transparent 1px);
}

[data-theme="dark"] #particle-canvas {
  opacity: 0.7;
}

[data-theme="dark"] .bg-orb-1 {
  background: radial-gradient(circle, rgba(77, 163, 255, 0.1) 0%, transparent 70%);
}
[data-theme="dark"] .bg-orb-2 {
  background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 70%);
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--text-muted);
  background: var(--bg-subtle);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Tech Background ── */
.tech-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 115, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 115, 232, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 75%);
}

.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.025) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: radial-gradient(ellipse 70% 50% at 60% 20%, black 10%, transparent 70%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  top: -10%;
  right: -5%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  top: 30%;
  left: -10%;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  right: 15%;
  background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
}

.bg-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(26, 115, 232, 0.012) 3px,
    rgba(26, 115, 232, 0.012) 4px
  );
  opacity: 0.6;
}

/* Holographic noise / signal grain layer */
.bg-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.45 0 0 0 0 0.9 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] .bg-noise { opacity: 0.07; }

.page-content {
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

header.scrolled {
  border-bottom-color: var(--border);
}

/* Header neon scan line — visible after scroll */
header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(26, 115, 232, 0) 12%,
    rgba(26, 115, 232, 0.55) 42%,
    rgba(6, 182, 212, 0.75) 55%,
    rgba(99, 102, 241, 0.55) 68%,
    rgba(26, 115, 232, 0) 88%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}
header.scrolled::after { opacity: 1; }
[data-theme="dark"] header::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(77, 163, 255, 0) 12%,
    rgba(77, 163, 255, 0.6) 42%,
    rgba(6, 182, 212, 0.85) 55%,
    rgba(129, 140, 248, 0.6) 68%,
    rgba(77, 163, 255, 0) 88%,
    transparent 100%
  );
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Tech node marker before logo */
.logo::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(135deg, #06b6d4 0%, var(--accent) 60%, #6366f1 100%);
  box-shadow:
    0 0 8px rgba(26, 115, 232, 0.55),
    0 0 18px rgba(6, 182, 212, 0.35);
  transform: rotate(45deg);
  animation: logo-node-pulse 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes logo-node-pulse {
  0%, 100% { transform: rotate(45deg) scale(1); opacity: 1; }
  50%      { transform: rotate(45deg) scale(0.85); opacity: 0.75; }
}

.logo span {
  color: var(--text-secondary);
  font-weight: 400;
}

nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

nav a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

nav a {
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent, #1a73e8);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

nav a.active {
  color: var(--text);
  font-weight: 500;
}

nav a.active::after {
  transform: scaleX(1);
}

nav a.nav-join {
  background: var(--accent, #1a73e8);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}

nav a.nav-join::after {
  display: none;
}

nav a.nav-join:hover {
  background: var(--accent-hover, #1557b0);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Learning dark mode ── */
[data-theme="dark"] .learning-courses {
  background: linear-gradient(180deg, rgba(15, 17, 23, 0.6) 0%, var(--bg) 100%);
}

[data-theme="dark"] .learning-card {
  background: rgba(22, 25, 35, 0.8);
}

[data-theme="dark"] .learning-card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .course-list li a {
  background: rgba(22, 25, 35, 0.6);
  border-color: rgba(77, 163, 255, 0.08);
}

[data-theme="dark"] .course-list li a:hover {
  background: rgba(30, 34, 46, 0.9);
  border-color: rgba(77, 163, 255, 0.2);
}

[data-theme="dark"] .learning-badge {
  color: var(--accent);
  background: rgba(77, 163, 255, 0.12);
}

/* ── FAQ / TL;DR / Table / Summary dark mode ── */
[data-theme="dark"] .faq-item {
  background: rgba(22, 25, 35, 0.8);
}

[data-theme="dark"] .faq-item:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .section-tldr {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.04), rgba(129, 140, 248, 0.04));
  border-color: rgba(77, 163, 255, 0.12);
}

[data-theme="dark"] .tool-table thead {
  background: rgba(77, 163, 255, 0.06);
}

[data-theme="dark"] .tool-table tbody tr:nth-child(even) {
  background: rgba(22, 25, 35, 0.5);
}

[data-theme="dark"] .tool-table tbody tr:hover {
  background: rgba(30, 34, 46, 0.9);
}

[data-theme="dark"] .comparison-table-wrap {
  border-color: var(--border);
}

[data-theme="dark"] .about-author {
  background: rgba(22, 25, 35, 0.8);
}

[data-theme="dark"] .author-avatar {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.1), rgba(129, 140, 248, 0.1));
}

[data-theme="dark"] .final-summary {
  background: rgba(22, 25, 35, 0.8);
}

[data-theme="dark"] .summary-point {
  background: rgba(77, 163, 255, 0.04);
  border-color: rgba(77, 163, 255, 0.08);
}

[data-theme="dark"] .summary-num {
  color: var(--accent);
  background: rgba(77, 163, 255, 0.12);
}

[data-theme="dark"] .channel-link {
  background: rgba(22, 25, 35, 0.6);
  border-color: rgba(77, 163, 255, 0.08);
}

[data-theme="dark"] .channel-link:hover {
  background: rgba(30, 34, 46, 0.9);
  border-color: rgba(77, 163, 255, 0.2);
}

/* ── Tech Investment dark mode ── */
[data-theme="dark"] .tech-invest {
  background: linear-gradient(180deg, var(--bg) 0%, rgba(15, 17, 23, 0.4) 50%, var(--bg) 100%);
}

[data-theme="dark"] .invest-card {
  background: rgba(22, 25, 35, 0.8);
}

[data-theme="dark"] .invest-metrics {
  background: rgba(77, 163, 255, 0.04);
  border-color: rgba(77, 163, 255, 0.1);
}

[data-theme="dark"] .highlight-item {
  background: rgba(22, 25, 35, 0.6);
  border-color: rgba(77, 163, 255, 0.06);
}

[data-theme="dark"] .invest-takeaway {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(239, 68, 68, 0.04));
  border-color: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .invest-takeaway h4 {
  color: #fbbf24;
}

[data-theme="dark"] .invest-source a {
  background: rgba(77, 163, 255, 0.08);
}

[data-theme="dark"] .invest-source a:hover {
  background: rgba(77, 163, 255, 0.15);
}

/* ── Floating Section Navigator ── */
.section-nav {
  position: fixed;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.section-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.snav-dot {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: flex-end;
  cursor: pointer;
  position: relative;
  padding-top: 10px;
  transition: all 0.25s ease;
}

.snav-dot:first-child {
  padding-top: 0;
}

/* Dot circle */
.snav-dot::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.snav-dot:hover::after {
  transform: scale(1.5);
  background: var(--accent);
}

.snav-dot.reached::after {
  background: var(--accent);
}

.snav-dot.active::after {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.45);
}

.snav-label {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.25s ease;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 50%;
  margin-top: -1px;
}

.snav-dot:hover .snav-label {
  opacity: 1;
  transform: translateX(0);
}

/* Dark mode nav */
[data-theme="dark"] .snav-label {
  background: rgba(22, 25, 35, 0.92);
  border-color: var(--border);
  color: #e0e0e0;
}

[data-theme="dark"] .snav-dot.active::after {
  box-shadow: 0 0 10px rgba(77, 163, 255, 0.5);
}

/* Hide on small screens */
@media (max-width: 1280px) {
  .section-nav {
    display: none;
  }
}
