/* ── Base ───────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&display=swap');

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

:root {
  --bg:       #0a0a0a;
  --bg-card:  #111111;
  --green:    #39ff14;
  --cyan:     #00cfff;
  --muted:    #666666;
  --dimmed:   #444444;
  --text:     #cccccc;
  --border:   #1e1e1e;
  --font:     'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --radius:   6px;
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Links ──────────────────────────────────────────────────── */
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.site-nav .nav-home {
  color: var(--green);
  font-weight: 500;
  margin-right: auto;
}

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

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

.site-nav .nav-terminal-toggle {
  color: var(--green);
  border: 1px solid var(--dimmed);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
}

/* ── Main content area ──────────────────────────────────────── */
.site-main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Page headings ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.page-header h1::before { content: "# "; color: var(--muted); }

/* ── Content typography ─────────────────────────────────────── */
.content h1, .content h2, .content h3 {
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.04em;
}

.content h2::before { content: "## "; color: var(--muted); }
.content h3::before { content: "### "; color: var(--muted); }

.content p { margin-bottom: 1rem; }

.content ul, .content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content li { margin-bottom: 0.3rem; }

.content strong { color: var(--text); }

.content code {
  background: var(--bg-card);
  color: var(--green);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.content blockquote {
  border-left: 2px solid var(--green);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1rem 0;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* ── Aside / callout ────────────────────────────────────────── */
.content aside, .callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Dive log table ─────────────────────────────────────────── */
.dive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 1.5rem;
}

.dive-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 400;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.dive-table td {
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.dive-table tr:hover td { background: var(--bg-card); }

.dive-table td.dive-num  { color: var(--muted); width: 3rem; }
.dive-table td.dive-date { white-space: nowrap; color: var(--muted); }
.dive-table td.dive-site { color: var(--cyan); }
.dive-map-link { color: var(--muted); font-size: 0.75rem; text-decoration: none; }
.dive-map-link:hover { color: var(--cyan); }
.dive-table td.dive-depth { color: var(--green); }
.dive-table td.dive-notes { font-size: 0.78rem; color: var(--muted); }

.dive-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.dive-certifications {
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.dive-certifications p { margin: 0; }

.dive-stat-label { color: var(--muted); font-size: 0.75rem; display: block; }
.dive-stat-value { color: var(--green); font-size: 1.1rem; font-weight: 500; }

.dive-filter {
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.dive-filter label { color: var(--muted); margin-right: 0.5rem; }

.dive-filter select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
}

.dive-countries {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.dive-countries span {
  color: var(--text);
  margin: 0 0.2rem;
}

.dive-row-notes {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0 0.75rem 0.4rem 0.75rem;
  font-style: italic;
}

/* ── Writing list ───────────────────────────────────────────── */
.writing-group h2 {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 2rem 0 0.75rem;
}

.writing-group h2::before { content: none; }

.writing-list { list-style: none; padding: 0; }

.writing-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.writing-list li:last-child { border-bottom: none; }

.writing-tag {
  font-size: 0.72rem;
  color: var(--dimmed);
  white-space: nowrap;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }
.site-footer .footer-terminal-link { color: var(--green); }
.site-footer .footer-terminal-link:hover { color: #fff; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .site-nav { padding: 0.75rem 1.25rem; gap: 1rem; }
  .site-main { padding: 1.75rem 1.25rem; }
  .dive-table th:nth-child(n+5),
  .dive-table td:nth-child(n+5) { display: none; }
  .dive-stats { gap: 1rem; }
}
