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

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-light: #4ade80;
  --bg-primary: #0b0d13;
  --bg-secondary: #111318;
  --bg-card: #16181e;
  --bg-card-hover: #1c1f27;
  --bg-code: #1a1d25;
  --text-primary: #f2f3f5;
  --text-secondary: #b5bac1;
  --text-muted: #80848e;
  --border: #2a2d35;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
  --nav-height: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  word-break: break-word;
}

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

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(11, 13, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: height 0.3s, background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  height: 52px;
  background: rgba(11, 13, 19, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo:hover {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

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

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

.nav-github {
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* === Hero === */
.hero {
  padding: 160px 24px 100px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(22, 163, 74, 0.12) 0%, transparent 60%);
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-light);
  margin-bottom: 24px;
  letter-spacing: 0.025em;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-emoji {
  display: inline-block;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-philosophy {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-style: italic;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-dark);
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* === Sections === */
.section {
  padding: 100px 0;
}

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

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

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 56px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* === Flow Diagram === */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 100%;
  overflow-x: hidden;
}

.flow-step {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  min-width: 180px;
  transition: border-color 0.2s, transform 0.2s;
}

.flow-step:hover {
  border-color: rgba(22, 163, 74, 0.3);
  transform: translateY(-2px);
}

.flow-step-dev {
  border-color: rgba(22, 163, 74, 0.4);
}

.flow-step-main {
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(22, 163, 74, 0.05);
}

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

.flow-label {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 4px;
}

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

.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.flow-arrow-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flow-arrow-icon {
  font-size: 1.5rem;
  color: var(--green-light);
}

/* === Features Grid === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(22, 163, 74, 0.3);
  transform: translateY(-2px);
}

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

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* === Setup Steps === */
.setup-steps {
  max-width: 640px;
  margin: 0 auto;
}

.setup-step {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.setup-step:last-child {
  border-bottom: none;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 50%;
}

.step-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.step-content code {
  display: inline-block;
  margin-top: 4px;
  word-break: break-all;
  white-space: pre-wrap;
}

/* === Branch Naming === */
.naming-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.naming-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  transition: border-color 0.2s;
}

.naming-card:hover {
  border-color: rgba(22, 163, 74, 0.3);
}

.naming-prefix {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green-light);
  margin-bottom: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
}

.naming-use {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.naming-card code {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Merge Strategy === */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
}

.strategy-direction {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.strategy-type {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-light);
  margin-bottom: 20px;
}

.strategy-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  overflow-x: hidden;
}

.commit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-code);
  border: 2px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: monospace;
}

.commit-squash {
  background: rgba(22, 163, 74, 0.15);
  border-color: var(--green);
  color: var(--green-light);
}

.commit-dev {
  width: auto;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border-color: var(--green);
  color: var(--green-light);
  background: rgba(22, 163, 74, 0.1);
}

.commit-main {
  width: auto;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border-color: var(--green-light);
  color: var(--green-light);
  background: rgba(74, 222, 128, 0.1);
}

.commit-arrow,
.becomes,
.merge-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.strategy-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* === Comparison Table === */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.comparison-table th,
.comparison-table td {
  padding: 16px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.comparison-table th {
  background: var(--bg-code);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.comparison-table td {
  color: var(--text-secondary);
}

.comparison-table .highlight {
  background: rgba(22, 163, 74, 0.06);
  color: var(--green-light);
}

.comparison-table th.highlight {
  background: rgba(22, 163, 74, 0.12);
  color: var(--green-light);
}

.row-label {
  text-align: left !important;
  font-weight: 600;
  color: var(--text-primary) !important;
}

/* === AI Integration === */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

.ai-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

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

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

.ai-code code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-secondary);
  word-break: break-all;
  white-space: pre-wrap;
}

/* === Rules List === */
.rules-list {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rule-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-item::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
}

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

.rule-item code {
  color: var(--green-light);
  background: rgba(22, 163, 74, 0.1);
}

/* === Footer === */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-bottom a {
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--text-secondary);
}

/* === Responsive === */
@media (max-width: 900px) {
  .features-grid,
  .naming-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .strategy-grid,
  .ai-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.75rem;
  }
}

@media (max-width: 768px) {
  .js .nav-toggle {
    display: flex;
  }

  .js .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

  .js .nav-links.active {
    display: flex;
  }

  .js .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .js .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .js .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .flow-diagram {
    flex-direction: column;
  }

  .flow-arrow {
    flex-direction: row;
    gap: 8px;
  }

  .flow-arrow-icon {
    transform: rotate(90deg);
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    gap: 40px;
  }

  .section {
    padding: 48px 0;
  }

  .hero {
    padding: 88px 24px 48px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-tagline {
    margin-bottom: 24px;
  }

  .hero-actions {
    margin-bottom: 20px;
  }

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

  .section-subtitle {
    margin-bottom: 32px;
  }
}

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

  .section {
    padding: 40px 0;
  }

  .hero {
    padding: 80px 20px 36px;
  }

  .hero h1 {
    font-size: 1.85rem;
    margin-bottom: 12px;
  }

  .hero-tagline {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
  }

  .hero-badge {
    margin-bottom: 16px;
  }

  .section-subtitle {
    margin-bottom: 28px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 24px;
  }

  .flow-step {
    padding: 20px 20px;
    min-width: unset;
  }

  .feature-card {
    padding: 24px 20px;
  }

  .setup-step {
    padding: 20px 0;
    gap: 16px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .footer {
    padding: 36px 0 24px;
  }

  .footer-inner {
    gap: 24px;
    margin-bottom: 24px;
  }

  .footer-links {
    flex-direction: column;
    gap: 24px;
  }
}
