@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600&family=Source+Sans+3:wght@400;600&display=swap");

:root {
  --bg: #fafafa;
  --ink: #1c1b1a;
  --muted: #666;
  --accent: #2f5f5a;
  --border: #e0e0e0;
}

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

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  padding: 2rem 1.5rem;
}

#concept-container {
  max-width: 500px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.manifesto {
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.simulation-section {
  margin-bottom: 2rem;
}

.simulation-section h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--ink);
}

.sim-description {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.simulation-container {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.simulation-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.controls button {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.controls button:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

.controls button:active {
  background: #e8e8e8;
}

/* Bridge Section */
.bridge-section {
  background: #f4f4f4;
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 2rem;
}

.bridge-section h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.bridge-section ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
}

.bridge-section li {
  margin-bottom: 0.5rem;
}

/* Lab Sections */
.lab-section {
  margin-bottom: 2rem;
}

.lab-section h2 {
  font-family: "Courier New", monospace;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lab-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(9, 36px);
  grid-template-rows: repeat(9, 36px);
  border: 2px solid #333;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  min-height: 324px;
  min-width: 324px;
}

.lab-cell {
  width: 36px;
  height: 36px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  transition: background 0.1s;
}

.lab-cell:hover {
  background: #e8e8e8;
}

.lab-cell.active {
  background: #1c1b1a;
}

.lab-cell.ant {
  background: #e74c3c;
}

.lab-cell.alive {
  background: var(--accent);
}

.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  body {
    padding: 1.5rem 1rem;
  }

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

  .manifesto {
    font-size: 0.95rem;
  }

  .simulation-container {
    max-width: 100%;
  }

  .lab-grid {
    grid-template-columns: repeat(9, 30px);
    grid-template-rows: repeat(9, 30px);
    min-height: 270px;
    min-width: 270px;
  }

  .lab-cell {
    width: 30px;
    height: 30px;
  }

  .bridge-section {
    padding: 1rem;
  }
}
