@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
  --bg: #F9FAFB;
  --panel: #ffffff;
  --muted: #4B5563;
  --muted-2: #6B7280;
  --border: #E5E7EB;
  --graphite: #1F2933;
  --accent: #0E4F5A;
  --accent-soft: rgba(14, 79, 90, 0.12);
  --radius: 12px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--graphite);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 0;
  color: var(--graphite);
}

p {
  color: var(--muted);
  margin: 0 0 12px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  z-index: 20;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(249, 250, 251, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

h1, h2, h3, h4, h5, h6, section, .card, .section-title {
  scroll-margin-top: 96px;
}

.nav-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand {
  font-weight: 700;
  color: var(--graphite);
  letter-spacing: -0.01em;
}

.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: nowrap;
}

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

.nav-links a {
  color: var(--graphite);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-links a:hover {
  background: var(--border);
  text-decoration: none;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--muted);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 22px 64px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 24px 0 16px;
}

.hero-text {
  width: 100%;
  max-width: 1100px;
  text-align: center;
  margin: 0 auto;
}

.hero-text h1 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 12px;
  text-align: center;
}

.hero .card {
  margin: 12px auto 0;
  max-width: 1100px;
  text-align: justify;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 16px;
  padding: 0 8px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.section-title h2 {
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
  max-width: 1100px;
  margin: 0 auto;
}

.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.grid > .card,
.grid > .card-link,
.grid > a.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  max-width: 100%;
}

.card-link {
  display: block;
  color: inherit;
}

.card.card-link {
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, rgba(14, 79, 90, 0.06), #ffffff);
  box-shadow: 0 12px 26px rgba(14, 79, 90, 0.12);
}

.card-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  transition: transform 0.12s ease, box-shadow 0.18s ease;
  box-shadow: 0 16px 30px rgba(14, 79, 90, 0.18);
}

.link-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 18px 18px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 1100px;
  position: relative;
}

.card p {
  margin-bottom: 10px;
}

.module-card h3 {
  margin: 0 0 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(27, 123, 131, 0.25);
  text-decoration: none;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
}

.list {
  padding-left: 18px;
  color: var(--muted);
  margin: 0 0 10px;
}

.doc-hero {
  margin: 0 0 16px;
}

.doc-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.doc-content h1:first-of-type {
  margin-top: 0;
}

.doc-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 24px 0 12px;
  color: var(--muted-2);
  font-size: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

th, td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}

th {
  background: #f1f5f9;
  color: var(--graphite);
}

blockquote {
  border-left: 4px solid var(--accent);
  margin: 16px 0;
  padding: 8px 12px;
  background: #F1F5F9;
  color: var(--muted);
}

code {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f1f5f9;
  padding: 2px 4px;
  border-radius: 6px;
}

.doc-content pre {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre;
}

.doc-content pre code {
  display: block;
  background: transparent;
  padding: 0;
  white-space: inherit;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .hero-text {
    grid-column: span 7;
  }

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

@media (max-width: 900px) {
  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .doc-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  .doc-content th,
  .doc-content td {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .nav-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .nav-links {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
}
