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

:root {
  --font-sans: "Noto Sans", Arial, Helvetica, sans-serif;
  --font-mono: "Noto Sans Mono", "Courier New", monospace;
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #555;
  --color-accent: #2563eb;
  --color-accent-light: #dbeafe;
  --color-border: #e5e7eb;
  --color-code-bg: #f8f9fa;
  --color-banner-bg: #dbeafe;
  --color-banner-border: #3b82f6;
  --max-width: 820px;
  --section-gap: 3.5rem;
}

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

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

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  margin-bottom: var(--section-gap);
}

/* ── Typography ── */
h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-border);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--color-muted);
  background: var(--color-code-bg);
  border-radius: 0 6px 6px 0;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 4rem 0 2rem;
}

.hero-logo-text {
  margin-bottom: 1.25rem;
}

.logo-text {
  font-family: "SF Mono", "Fira Code", "Consolas", var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.03em;
}

.logo-dim {
  opacity: 0.4;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 620px;
  margin: 0.5rem auto 1.5rem;
  line-height: 1.6;
}

.hero .author {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.hero .author a {
  color: var(--color-text);
  font-weight: 500;
}

/* ── Quick Links ── */
.quick-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color 0.2s, background 0.2s;
}

.quick-links a:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  text-decoration: none;
}

.quick-links a svg {
  width: 16px;
  height: 16px;
}

/* ── Propel Banner ── */
.propel-banner {
  background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
  border: 1px solid #a78bfa;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.propel-banner a {
  color: #6d28d9;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.propel-banner a:hover {
  text-decoration: underline;
}

.propel-banner-icon {
  width: 16px;
  height: 16px;
  color: #7c3aed;
}

.propel-banner a strong {
  color: #6d28d9;
}

/* ── Propel Quick Link (highlighted) ── */
.quick-links a.propel-link {
  border-color: #a78bfa;
  background: #ede9fe;
  color: #6d28d9;
}

.quick-links a.propel-link:hover {
  border-color: #7c3aed;
  background: #ddd6fe;
}

/* ── Development Banner ── */
.dev-banner {
  background: var(--color-banner-bg);
  border: 1px solid var(--color-banner-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
}

.dev-banner strong {
  color: #1e40af;
}

/* ── Table of Contents ── */
.toc {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.toc-wrapper {
  display: none;
}

@media (min-width: 1200px) {
  .toc-wrapper {
    display: block;
    position: fixed;
    left: max(1rem, calc((100vw - var(--max-width)) / 2 - 220px));
    top: 2rem;
    width: 190px;
    z-index: 10;
  }

  .toc h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
  }

  .toc a {
    display: block;
    font-size: 0.82rem;
    color: var(--color-muted);
    padding: 0.2rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1.4;
  }

  .toc a:hover {
    color: var(--color-text);
    text-decoration: none;
  }

  .toc a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    font-weight: 500;
  }
}

/* ── Feature Cards ── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.feature-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-icon-timer {
  background: #dbeafe;
  color: #2563eb;
}

.feature-icon-analytics {
  background: #d1fae5;
  color: #059669;
}

.feature-icon-chat {
  background: #ede9fe;
  color: #7c3aed;
}

.feature-icon-projects {
  background: #fef3c7;
  color: #d97706;
}

.feature-icon-data {
  background: #fce7f3;
  color: #db2777;
}

.feature-icon-theme {
  background: #f1f5f9;
  color: #475569;
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* ── Architecture Diagram ── */
.arch-diagram {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.arch-layer {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.arch-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.arch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.arch-items span {
  font-size: 0.82rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
}

.arch-frontend {
  border-top: 3px solid #2563eb;
}

.arch-backend {
  border-top: 3px solid #059669;
}

.arch-storage {
  border-top: 3px solid #d97706;
}

.arch-arrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 0.4rem 0;
  position: relative;
}

.arch-arrow::before {
  content: "\2193";
  margin-right: 0.4rem;
}

.arch-arrow::after {
  content: "\2193";
  margin-left: 0.4rem;
}

/* ── Data Model Grid ── */
.data-model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.model-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
}

.model-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.model-card p {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* ── AI Integration ── */
.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.ai-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.ai-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.ai-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.ai-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ai-examples code {
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.5rem;
}

.approval-note {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.approval-note strong {
  color: #166534;
}

/* ── Tech Choices ── */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.choice-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.choice-card h4 {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.choice-card p {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  background: var(--color-code-bg);
  font-size: 0.85rem;
}

tr:last-child td {
  border-bottom: none;
}

/* ── Install Steps ── */
.install-steps {
  counter-reset: step;
}

.install-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.install-step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.install-step div {
  flex: 1;
}

.install-step p {
  margin-bottom: 0.4rem;
}

/* ── Acknowledgments List ── */
.ack-list {
  list-style: none;
  padding: 0;
}

.ack-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.92rem;
  line-height: 1.6;
}

.ack-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

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

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

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .logo-text {
    font-size: 2.2rem;
  }

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

  .data-model-grid {
    grid-template-columns: 1fr;
  }

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

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

  .hero {
    padding: 2.5rem 0 1.5rem;
  }
}

/* ── Scroll 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);
}
