/* ========================================
   Nano-Claw-Code Project Website
   ======================================== */

:root {
  --bg: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text: #e8e8ed;
  --text-secondary: #8888a0;
  --text-dim: #55556a;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.15);
  --green: #00d2a0;
  --green-dim: rgba(0, 210, 160, 0.15);
  --red: #ff6b6b;
  --red-dim: rgba(255, 107, 107, 0.1);
  --yellow: #ffd93d;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --nav-bg: rgba(10, 10, 15, 0.85);
  --code-header-bg: rgba(0, 0, 0, 0.3);
  --code-block-bg: rgba(0, 0, 0, 0.3);
  --capability-bg: rgba(0, 0, 0, 0.2);
  --bar-full-start: #2a2a3a;
  --bar-full-end: #55556a;
  --bar-full-text: #e8e8ed;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
  --max-width: 1100px;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8f8fc;
  --bg-secondary: #eeeef4;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f6;
  --text: #1a1a2e;
  --text-secondary: #5a5a78;
  --text-dim: #8888a0;
  --accent: #5a4ad6;
  --accent-light: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.08);
  --green: #00b88c;
  --green-dim: rgba(0, 184, 140, 0.1);
  --red: #e04848;
  --red-dim: rgba(224, 72, 72, 0.08);
  --yellow: #e6b800;
  --border: #d8d8e4;
  --border-light: #c8c8d8;
  --nav-bg: rgba(248, 248, 252, 0.85);
  --code-header-bg: rgba(0, 0, 0, 0.04);
  --code-block-bg: rgba(0, 0, 0, 0.03);
  --capability-bg: rgba(0, 0, 0, 0.03);
  --bar-full-start: #c8c8d8;
  --bar-full-end: #8888a0;
  --bar-full-text: #1a1a2e;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
}

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

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--accent-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem !important;
}

.nav-github:hover {
  border-color: var(--text-secondary);
  background: var(--bg-card);
}

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  padding: 160px 0 100px;
  text-align: center;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(108, 92, 231, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 92, 231, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-glow);
  border: 1px solid rgba(108, 92, 231, 0.25);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title-nano {
  background: linear-gradient(135deg, var(--accent-light), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 16px;
  line-height: 1.7;
}

.hero-subtitle strong {
  color: var(--text);
}

.hero-highlight {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  color: var(--green);
  font-size: 1.1rem;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 48px 0 40px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 36px;
  min-width: 200px;
  transition: border-color 0.3s, transform 0.3s;
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-unit {
  font-size: 1.6rem;
  color: var(--accent-light);
  font-weight: 600;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}

.stat-detail {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--mono);
}

/* Hero Actions */
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #5a4ad6;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  background: var(--bg-card);
  color: var(--text);
}

/* ========================================
   Sections
   ======================================== */

.section {
  padding: 100px 0;
}

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

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 48px;
}

/* ========================================
   About Section
   ======================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.75;
}

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

/* Code Window */
.code-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--code-header-bg);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

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

.code-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 8px;
}

.code-body {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-comment { color: var(--text-dim); }
.code-file { color: var(--accent-light); }
.code-dim { color: var(--text-dim); }
.code-highlight { color: var(--green); font-weight: 600; }

/* ========================================
   Results Table
   ======================================== */

.results-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.results-table th {
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

.results-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.results-table td strong {
  color: var(--text);
}

.row-highlight {
  background: var(--accent-glow);
}

.row-highlight td {
  color: var(--text);
}

.rate {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--green);
  font-size: 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 6px;
}

.badge-full {
  background: rgba(136, 136, 160, 0.15);
  color: var(--text-secondary);
}

.badge-nano {
  background: var(--accent-glow);
  color: var(--accent-light);
}

.results-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 48px;
}

/* Comparison Bar */
.comparison {
  max-width: 700px;
  margin: 0 auto;
}

.comparison-item {
  margin-bottom: 16px;
}

.comparison-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.bar-container {
  position: relative;
  height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  overflow: visible;
}

.bar {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  min-width: fit-content;
}

.bar-full {
  background: linear-gradient(90deg, var(--bar-full-start) 0%, var(--bar-full-end) 100%);
  color: var(--bar-full-text);
}

.bar-nano {
  background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%);
  color: white;
  min-width: 12px;
}

.bar-label-outside {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}

/* ========================================
   Pipeline
   ======================================== */

.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.pipeline-stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  min-width: 200px;
  max-width: 220px;
  transition: border-color 0.3s, transform 0.3s;
}

.pipeline-stage:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.pipeline-stage-final {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.pipeline-stage-final:hover {
  border-color: var(--green);
}

.pipeline-icon {
  color: var(--accent-light);
  margin-bottom: 12px;
}

.pipeline-stage h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pipeline-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: 12px;
}

.pipeline-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ps-lines, .ps-tools {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.ps-lines {
  color: var(--text-secondary);
}

.ps-tools {
  color: var(--text-dim);
}

/* Pipeline Arrow */
.pipeline-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px;
  position: relative;
}

.arrow-line {
  width: 60px;
  height: 2px;
  background: var(--border-light);
  position: relative;
}

.arrow-line::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 8px solid var(--border-light);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.arrow-label {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.arrow-label strong {
  color: var(--text);
  font-size: 0.78rem;
}

.arrow-delta {
  color: var(--green);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.72rem;
}

/* ========================================
   Architecture
   ======================================== */

.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.arch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.arch-card-wide {
  grid-column: 1 / -1;
}

.arch-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

.arch-card-title svg {
  color: var(--green);
}

.arch-card-removed .arch-card-title svg {
  color: var(--red);
}

/* Tool Tags */
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0, 210, 160, 0.2);
  font-weight: 500;
}

.tool-tag.removed {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.15);
  text-decoration: line-through;
  opacity: 0.7;
}

/* Capabilities */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.capability {
  padding: 14px 16px;
  background: var(--capability-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.cap-name {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.cap-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ========================================
   Quick Start
   ======================================== */

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.qs-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.qs-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-glow);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 50%;
  color: var(--accent-light);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.qs-step h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.code-block {
  background: var(--code-block-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.code-block pre {
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.code-block .code-comment {
  color: var(--text-dim);
}

/* ========================================
   Roadmap
   ======================================== */

.roadmap {
  max-width: 640px;
  margin: 0 auto;
}

.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.roadmap-item:last-child {
  border-bottom: none;
}

.roadmap-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.roadmap-item.done .roadmap-check {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0, 210, 160, 0.3);
}

.roadmap-item.pending .roadmap-check {
  background: rgba(136, 136, 160, 0.1);
  border: 1px solid var(--border);
}

.roadmap-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.roadmap-item.done .roadmap-text {
  color: var(--text);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-org {
  color: var(--text-secondary) !important;
  margin-top: 4px;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-link:hover {
  color: var(--text);
}

/* ========================================
   Theme Toggle
   ======================================== */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--text-secondary);
  color: var(--text);
  background: var(--bg-card);
}

/* Dark mode: show sun, hide moon */
.icon-sun { display: block; }
.icon-moon { display: none; }

/* Light mode: show moon, hide sun */
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Smooth color transitions on theme switch */
body,
.nav,
.stat-card,
.code-window,
.code-header,
.code-body,
.results-table th,
.results-table td,
.pipeline-stage,
.arch-card,
.qs-step,
.code-block,
.capability,
.footer,
.roadmap-item,
.hero-badge,
.btn,
.nav-github,
.theme-toggle {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light theme: bar container visibility tweak */
[data-theme="light"] .bar-container {
  background: rgba(0, 0, 0, 0.04);
}

/* Light theme: hero grid slightly darker */
[data-theme="light"] .hero-bg-grid {
  background-image:
    linear-gradient(rgba(108, 92, 231, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 92, 231, 0.06) 1px, transparent 1px);
}

/* Light theme: row highlight */
[data-theme="light"] .row-highlight {
  background: rgba(108, 92, 231, 0.06);
}

/* Light theme: code window */
[data-theme="light"] .code-window {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Light theme: code dots stay colorful */
[data-theme="light"] .code-dot.red { background: #ff5f57; }
[data-theme="light"] .code-dot.yellow { background: #febc2e; }
[data-theme="light"] .code-dot.green { background: #28c840; }

/* ========================================
   Animations
   ======================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .nav-links a:not(.nav-github):not(.theme-toggle) {
    display: none;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
  }

  .stat-card {
    width: 100%;
    max-width: 300px;
  }

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

  .pipeline {
    flex-direction: column;
    gap: 8px;
  }

  .pipeline-arrow {
    padding: 16px 0;
  }

  .arrow-line {
    width: 2px;
    height: 40px;
  }

  .arrow-line::after {
    right: auto;
    top: auto;
    bottom: -6px;
    left: -4px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--border-light);
    border-bottom: none;
  }

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

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

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .section {
    padding: 60px 0;
  }

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