:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, "Cascadia Code",
    "Roboto Mono", Consolas, "Courier New", monospace;

  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-hover: #1a1a1a;
  --fg: #ededed;
  --fg-muted: #888888;
  --fg-subtle: #666666;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #ededed;
  --accent-soft: rgba(255, 255, 255, 0.06);
  --link: #3291ff;
  --link-hover: #52a5ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.24);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 150ms ease;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --bg-hover: #f5f5f5;
  --fg: #171717;
  --fg-muted: #666666;
  --fg-subtle: #888888;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #171717;
  --accent-soft: rgba(0, 0, 0, 0.04);
  --link: #0070f3;
  --link-hover: #0059c9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.025em;
}

h1 { font-size: 2rem; font-weight: 600; }
h2 {
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
h3 { font-size: 1rem; }

p { margin: 0 0 1rem; color: var(--fg); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-muted); }
.small { font-size: 0.875rem; }

.prompt {
  font-family: var(--font-mono);
  color: var(--fg-subtle);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0;
}
.prompt::before { content: ""; }

.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  background: var(--accent-soft);
  margin: 0 0.35rem 0.35rem 0;
  transition: border-color var(--transition), color var(--transition);
}
.tag:hover { border-color: var(--border-strong); color: var(--fg); }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.65rem;
  background: var(--bg-elevated);
  transition: border-color var(--transition), background-color var(--transition),
    box-shadow var(--transition);
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;
}
.card-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.4;
}
.card-title a {
  color: var(--fg);
  text-decoration: none;
}
.card-title a:hover { color: var(--link); }
.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.card-meta .badge {
  height: 18px;
  vertical-align: middle;
  opacity: 0.85;
}
.card-desc {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.55;
}
.card-footer {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

ul.bare { list-style: none; padding: 0; margin: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.25rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
}
.nav-list a {
  color: var(--fg-muted);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
}
.nav-list a:hover {
  color: var(--fg);
  background: var(--accent-soft);
  text-decoration: none;
}
.nav-list a[aria-current="page"] {
  color: var(--fg);
  background: var(--accent-soft);
  text-decoration: none;
}

#theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  transition: border-color var(--transition), color var(--transition),
    background-color var(--transition);
}
#theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--fg);
  background: var(--accent-soft);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.5rem 2rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.site-footer-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--fg); }

/* Home hero */
.hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.hero-name { margin-bottom: 0.25rem; }
.hero-name a {
  color: var(--fg);
  text-decoration: none;
  transition: color var(--transition);
}
.hero-name a:hover { color: var(--link); }
.hero .affiliations { margin: 0.75rem 0 0; line-height: 1.8; }

section > p:last-child { margin-bottom: 0; }

/* Contact list spacing */
.contact-list li { margin-bottom: 0.5rem; }

/* Diving page gallery, map, list */
.dive-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.dive-gallery figure { margin: 0; }
.dive-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  border: 1px solid var(--border);
}
@media (max-width: 600px) {
  .dive-gallery { grid-template-columns: 1fr; }
}

.dive-map {
  height: 420px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0 2rem;
  background: var(--bg-elevated);
  overflow: hidden;
}
[data-theme="light"] .dive-map { background: #f4f4f5; }

.dive-list { margin-top: 1.5rem; }
.dive-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.dive-row:last-child { border-bottom: 0; }
.dive-region { flex: 1; color: var(--fg); }
.dive-country { font-size: 0.8rem; }

@media (max-width: 640px) {
  main { padding: 2rem 1rem 3.5rem; }
  h1 { font-size: 1.65rem; }
  .site-nav { padding: 0.75rem 1rem; }
  .nav-list { gap: 0.15rem; font-size: 0.8rem; }
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 2rem;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
