/* Port Daddy — Shared Design System
   Used across all pages for consistent look and feel.
   Colors: navy (#1e3a5f), teal (#4a7c7e), cream (#faf9f6)
   Fonts: Playfair Display (headings), Inter (body), JetBrains Mono (code) */

:root {
  --bg-primary: #faf9f6;
  --bg-secondary: #f5f4f0;
  --navy: #1e3a5f;
  --navy-light: #2d4a6f;
  --teal: #4a7c7e;
  --teal-light: #6a9c9e;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a6e;
  --text-muted: #8a8a9e;
  --border: #e5e4e0;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── Navigation ───────────────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(250, 249, 246, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
}
.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--teal);
}
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); font-weight: 600; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  padding: 0.25rem;
}
.nav-toggle svg { display: block; }

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(250, 249, 246, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-outline { border: 1.5px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: white; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

/* ── Breadcrumbs ──────────────────────────────────────────────────── */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumbs a:hover { color: var(--navy); }
.breadcrumbs .separator { color: var(--text-muted); opacity: 0.5; }

/* ── Page Hero (inner pages) ──────────────────────────────────────── */

.page-hero {
  padding: 7rem 2rem 3rem;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.page-hero-container {
  max-width: 800px;
  margin: 0 auto;
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--navy);
}
.page-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
}
.page-hero .meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.page-hero .meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.page-hero .meta-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

/* ── Section utilities ────────────────────────────────────────────── */

.section { padding: 4rem 2rem; }
.section-label {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--navy);
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ── Content (articles, tutorials) ────────────────────────────────── */

.content-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
}

/* Table of Contents sidebar */
.toc {
  position: sticky;
  top: 6rem;
  align-self: start;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding-right: 1rem;
}
.toc h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.toc ul {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}
.toc li { margin-bottom: 0.5rem; }
.toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.4;
  display: block;
  transition: color 0.2s;
}
.toc a:hover { color: var(--navy); }
.toc a.active {
  color: var(--teal);
  font-weight: 500;
}

/* Article content */
.article {
  max-width: 780px;
  min-width: 0;
}
.article h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
}
.article h2:first-child { margin-top: 0; }
.article h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.article h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.article p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.article ul, .article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}
.article li { margin-bottom: 0.35rem; }
.article strong { color: var(--text-primary); }
.article a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.article a:hover { border-bottom-color: var(--teal); }

/* Inline code */
.article code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--navy);
}

/* Code blocks */
.article pre {
  background: var(--navy);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(30, 58, 95, 0.15);
}
.article pre code {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  line-height: 1.7;
  border-radius: 0;
}

/* Code syntax colors (manual, no JS) */
.article pre .comment { color: rgba(255,255,255,0.35); }
.article pre .keyword { color: #7fb069; }
.article pre .string { color: #d4a017; }
.article pre .prompt { color: var(--teal-light); }
.article pre .output { color: rgba(255,255,255,0.5); }

/* Blockquotes */
.article blockquote {
  border-left: 3px solid var(--teal);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(74, 124, 126, 0.06);
  border-radius: 0 8px 8px 0;
}
.article blockquote p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Tables in article */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.article th {
  background: var(--navy);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
}
.article th:first-child { border-radius: 8px 0 0 0; }
.article th:last-child { border-radius: 0 8px 0 0; }
.article td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.article tr:hover td { background: var(--bg-secondary); }

/* Horizontal rule */
.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
  }
  .page-hero h1 { font-size: 2rem; }
}

/* ── Prev/Next navigation ─────────────────────────────────────────── */

.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.prev-next a {
  display: block;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}
.prev-next a:hover {
  border-color: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 58, 95, 0.08);
}
.prev-next .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.prev-next .title {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
}
.prev-next .next { text-align: right; }

@media (max-width: 600px) {
  .prev-next { grid-template-columns: 1fr; }
}

/* ── Card grids ───────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  border-color: var(--teal-light);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(30, 58, 95, 0.08);
}
.card .card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.card .card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Footer ───────────────────────────────────────────────────────── */

footer {
  padding: 4rem 2rem 2rem;
  background: var(--navy);
  color: rgba(255,255,255,0.6);
}
.footer-container { max-width: 1100px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand p {
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 300px;
  line-height: 1.7;
}
.footer-column h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 0.5rem; }
.footer-column a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-column a:hover { color: var(--teal-light); }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ── MCP tool list ────────────────────────────────────────────────── */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.2s;
}
.tool-card:hover {
  border-color: var(--teal-light);
  box-shadow: 0 4px 16px rgba(30, 58, 95, 0.06);
}
.tool-card .tool-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 0.5rem;
}
.tool-card .tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.tool-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--navy);
}
.tool-category:first-of-type { margin-top: 0; }

/* ── Config block (install cards) ──────────────────────────────────── */

.config-block {
  background: var(--navy);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}
.config-block code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
  white-space: pre;
}

/* ── Docs hub link grid ───────────────────────────────────────────── */

.doc-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.doc-link {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.25s;
}
.doc-link:hover {
  border-color: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 95, 0.08);
}
.doc-link-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--teal);
}
.doc-link h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.doc-link p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.doc-link .external-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
