/* ═══════════════════════════════════════════════════
   BASE.CSS — Variables, Reset, Typography, Theme
   Somala Ajay Portfolio
═══════════════════════════════════════════════════ */

/* ── CSS Custom Properties: DARK Theme (default) ── */
[data-theme="dark"] {
  --bg:           #0a080f;
  --bg2:          #100d18;
  --bg3:          #150f20;
  --card:         #130e1c;
  --card-hover:   #1a1228;
  --border:       rgba(180,140,255,0.1);
  --border-hover: rgba(201,168,76,0.35);

  /* Purple + Gold palette */
  --purple:       #9b59f5;
  --purple-dim:   rgba(155,89,245,0.12);
  --purple-glow:  rgba(155,89,245,0.25);
  --gold:         #d4a843;
  --gold-dim:     rgba(212,168,67,0.1);
  --gold-bright:  #f0c860;

  --white:        #f0ecff;
  --muted:        #6b5f82;
  --muted2:       #4a4060;

  --text:         #e8e0ff;
  --text-sub:     #9488b0;

  /* Scrollbar */
  --scroll-thumb: var(--purple);
}

/* ── CSS Custom Properties: LIGHT Theme ── */
[data-theme="light"] {
  --bg:           #faf8ff;
  --bg2:          #f3f0fc;
  --bg3:          #ede8fa;
  --card:         #ffffff;
  --card-hover:   #f5f0ff;
  --border:       rgba(155,89,245,0.15);
  --border-hover: rgba(212,168,67,0.5);

  --purple:       #7c3aed;
  --purple-dim:   rgba(124,58,237,0.08);
  --purple-glow:  rgba(124,58,237,0.2);
  --gold:         #b8860b;
  --gold-dim:     rgba(184,134,11,0.1);
  --gold-bright:  #d4a017;

  --white:        #1a0f35;
  --muted:        #7c6fa0;
  --muted2:       #b0a4cc;

  --text:         #1a0f35;
  --text-sub:     #5a4f72;

  --scroll-thumb: var(--purple);
}

/* ── Typography ── */
:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Cabinet Grotesk', 'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  cursor: none;
  /* Neural canvas sits behind everything */
  position: relative;
}

/* Neural network canvas always behind content */
#bg-neural {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

/* Fallback for devices without hover (touch) */
@media (hover: none) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }

/* ── Selection ── */
::selection {
  background: var(--purple-dim);
  color: var(--purple);
}

/* ── Typography Scale ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  color: var(--white);
}

p { color: var(--text-sub); }

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

img { max-width: 100%; display: block; }

strong { color: var(--white); font-weight: 600; }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* ── Section Base ── */
.section {
  padding: 7rem 0;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.section-alt {
  background: var(--bg2);
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-tag::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
}

h2.section-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  color: var(--white);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  border: none;
  cursor: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold), var(--purple));
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 35px var(--purple-glow); }
.btn-primary > * { position: relative; z-index: 1; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--gold-dim);
  color: var(--gold-bright);
  border: 1px solid rgba(212,168,67,0.3);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: none;
  transition: all 0.3s ease;
}
.btn-secondary:hover {
  background: var(--gold);
  color: #0a080f;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(212,168,67,0.25);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: none;
  transition: all 0.3s ease;
}
.btn-outline:hover {
  border-color: var(--purple);
  color: var(--purple);
  transform: translateY(-2px);
}

.btn-full { width: 100%; justify-content: center; }

/* ── Theme Toggle Button ── */
#theme-toggle {
  position: fixed;
  bottom: 9rem;
  right: 2rem;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
#theme-toggle:hover {
  border-color: var(--gold);
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 8px 30px var(--gold-dim);
}

/* Show/hide theme icons */
[data-theme="dark"] .theme-icon-light  { display: none; }
[data-theme="dark"] .theme-icon-dark   { display: block; }
[data-theme="light"] .theme-icon-dark  { display: none; }
[data-theme="light"] .theme-icon-light { display: block; }

/* ── Footer ── */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--muted);
}
.footer-name { color: var(--purple); font-weight: 500; }
