/* ============================================
   DESIGN SYSTEM — Siddharth Ravikumar Portfolio
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors — Dark Theme (default) */
  --bg-primary:       #06060b;
  --bg-secondary:     #0d0d15;
  --bg-tertiary:      #14142a;
  --bg-card:          rgba(20, 20, 42, 0.6);
  --bg-card-hover:    rgba(30, 30, 60, 0.8);
  --bg-glass:         rgba(255, 255, 255, 0.03);
  --bg-glass-border:  rgba(255, 255, 255, 0.06);

  --accent-primary:   #6c63ff;
  --accent-secondary: #00d4aa;
  --accent-tertiary:  #ff6b9d;
  --accent-gradient:  linear-gradient(135deg, #6c63ff 0%, #00d4aa 100%);
  --accent-gradient-r: linear-gradient(135deg, #00d4aa 0%, #6c63ff 100%);
  --accent-glow:      rgba(108, 99, 255, 0.3);
  --accent-glow-secondary: rgba(0, 212, 170, 0.3);

  --text-primary:     #e8e8f0;
  --text-secondary:   #8888a8;
  --text-muted:       #555570;
  --text-accent:      #ffffff;
  --text-heading:     #f0f0f8;

  --border:           rgba(255, 255, 255, 0.06);
  --border-hover:     rgba(255, 255, 255, 0.12);

  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:        0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg:        0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow:      0 0 40px rgba(108, 99, 255, 0.15);

  /* Typography */
  --font-heading:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code:        'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;

  /* Border Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast:   0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width:     1200px;
  --nav-height:    72px;
  --section-padding: clamp(60px, 10vh, 120px);
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg-primary:       #f5f5fa;
  --bg-secondary:     #ffffff;
  --bg-tertiary:      #eeeef4;
  --bg-card:          rgba(255, 255, 255, 0.8);
  --bg-card-hover:    rgba(255, 255, 255, 0.95);
  --bg-glass:         rgba(255, 255, 255, 0.6);
  --bg-glass-border:  rgba(0, 0, 0, 0.08);

  --text-primary:     #2a2a3a;
  --text-secondary:   #6a6a80;
  --text-muted:       #9a9ab0;
  --text-accent:      #0d0d15;
  --text-heading:     #1a1a2e;

  --border:           rgba(0, 0, 0, 0.06);
  --border-hover:     rgba(0, 0, 0, 0.12);

  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md:        0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg:        0 16px 64px rgba(0, 0, 0, 0.1);
  --shadow-glow:      0 0 40px rgba(108, 99, 255, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

::selection {
  background: var(--accent-primary);
  color: #fff;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

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

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-body);
}

ul, ol {
  list-style: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent {
  color: var(--accent-primary);
}

.font-code {
  font-family: var(--font-code);
  font-size: 0.85em;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header .section-label {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: var(--space-sm);
  display: block;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: var(--accent-gradient);
  margin: var(--space-lg) auto;
  border-radius: 2px;
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(108, 99, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.glass-card:hover::before {
  opacity: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.05);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-primary);
  padding: 8px 16px;
}

.btn-ghost:hover {
  background: rgba(108, 99, 255, 0.08);
}

/* ---------- Tags / Badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-family: var(--font-code);
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(108, 99, 255, 0.15);
  border-radius: 100px;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: rgba(108, 99, 255, 0.18);
}

.tag-green {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-secondary);
  border-color: rgba(0, 212, 170, 0.15);
}

.tag-pink {
  background: rgba(255, 107, 157, 0.1);
  color: var(--accent-tertiary);
  border-color: rgba(255, 107, 157, 0.15);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.status-badge.live::before { background: #00d4aa; box-shadow: 0 0 8px rgba(0, 212, 170, 0.5); }
.status-badge.progress::before { background: #ffaa00; box-shadow: 0 0 8px rgba(255, 170, 0, 0.5); }
.status-badge.pipeline::before { background: #6c63ff; box-shadow: 0 0 8px rgba(108, 99, 255, 0.5); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ---------- Grid Utilities ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ---------- Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-lg); }
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .glass-card { padding: var(--space-xl); }
  section { padding: clamp(40px, 8vh, 80px) 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-md); }
  .btn { padding: 10px 20px; font-size: 0.85rem; }
}
