/* ============================================================
   OpenClaw Brand Visual System
   ============================================================
   Brand Colors: Deep Violet (#7c3aed) + Cyan Glow (#06b6d4)
   Typography: Space Grotesk (display) + Inter (body) + Fira Code (code)
   Theme: Dark-first with light mode toggle
   ============================================================ */

/* ==================== CSS VARIABLES ==================== */
:root {
  /* --- Brand Colors --- */
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --accent-secondary: #06b6d4;
  --accent-secondary-glow: rgba(6, 182, 212, 0.3);

  /* --- Animation --- */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease-out;
  --transition-slow: 600ms ease-out;
  --transition-theme: 400ms ease;

  /* --- Spacing --- */
  --section-padding: 100px 0;
  --container-width: 1100px;

  /* --- Border Radius --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* ==================== DARK THEME (default) ==================== */
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-nav: rgba(10, 10, 15, 0.85);

  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;

  --border-color: 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 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);
}

/* ==================== LIGHT THEME ==================== */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5ff;
  --bg-nav: rgba(250, 250, 250, 0.85);

  --text-primary: #1a1a2e;
  --text-secondary: #555570;
  --text-muted: #9999aa;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.12);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background var(--transition-theme), color var(--transition-theme);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: white;
}

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

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

.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==================== BOOT SCREEN ==================== */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#boot-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.terminal {
  width: 90%;
  max-width: 650px;
  background: #1a1a2e;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.2);
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.15);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #6b6b80;
}

.terminal-body {
  padding: 20px 24px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  min-height: 200px;
}

.terminal-line {
  color: #a0a0b8;
  white-space: nowrap;
  overflow: hidden;
}

.terminal-line .prompt {
  color: var(--accent);
}

.terminal-line .cmd {
  color: #06b6d4;
}

.terminal-line .output {
  color: #a0a0b8;
}

.terminal-line .highlight {
  color: #f0f0f5;
  font-weight: 600;
}

.terminal-line .accent-text {
  color: var(--accent);
  font-weight: 600;
}

.cursor-blink::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.boot-skip {
  margin-top: 24px;
  font-size: 0.75rem;
  color: #6b6b80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ==================== CLAW CANVAS ==================== */
#claw-canvas {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}

/* ==================== PARTICLES ==================== */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: float-particle linear infinite;
}

[data-theme="light"] .particle {
  opacity: 0.3;
}

@keyframes float-particle {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ==================== NAVBAR ==================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-theme), border-color var(--transition-theme);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.brand-icon {
  font-size: 1.3rem;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: rotate(15deg);
}

/* ==================== HERO ==================== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  padding: 100px 32px 60px;
  position: relative;
}

.hero-content {
  max-width: 580px;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out both;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-greeting {
  display: block;
  font-size: 0.5em;
  color: var(--text-secondary);
  font-weight: 500;
  animation: fadeInUp 0.6s ease-out 0.15s both;
}

.hero-name {
  display: block;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  min-height: 1.8em;
  animation: fadeInUp 0.6s ease-out 0.45s both;
}

.hero-subtitle .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.hero-actions {
  display: flex;
  gap: 12px;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

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

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-2px);
}

.hero-visual {
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.claw-art {
  width: 250px;
  height: 250px;
  animation: float 6s ease-in-out infinite;
}

.claw-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ==================== SECTIONS ==================== */
.section {
  padding: var(--section-padding);
  position: relative;
  z-index: 1;
}

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

.section-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 1.4rem;
}

/* ==================== ABOUT ==================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

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

.about-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.stat-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-suffix {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==================== CAPABILITIES ==================== */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.capability-card {
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  text-align: center;
}

.capability-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.capability-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: block;
}

.capability-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.capability-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}

.capability-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.capability-tags span {
  padding: 2px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.capability-tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==================== CONTACT ==================== */
.contact-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 28px;
  text-align: center;
}

/* ==================== PROJECTS ==================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.project-card-more {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.project-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.project-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-tech span {
  padding: 2px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ==================== STATUS ==================== */
.status-card {
  max-width: 600px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.status-card:hover {
  border-color: var(--accent);
}

.status-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b6b80;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 10px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.6); }
}

.status-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.status-item:hover {
  background: var(--bg-card-hover);
}

.status-emoji {
  font-size: 1.1rem;
}

.status-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.status-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.status-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== CONTACT ==================== */
.contact-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  text-align: center;
  min-width: 180px;
}

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

.contact-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.contact-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.contact-handle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==================== FOOTER ==================== */
#footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.footer-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer-sub {
  margin-top: 6px;
  font-size: 0.8rem;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-triggered animation classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  #hero {
    flex-direction: column;
    text-align: center;
    gap: 40px;
    padding: 80px 20px 40px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .claw-art {
    width: 180px;
    height: 180px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    display: none;
  }

  .section-container {
    padding: 0 20px;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    flex-direction: column;
  }

  .hero-title {
    font-size: 2rem;
  }
}
