:root {
  /* Backgrounds */
  --bg-primary: #002B36;
  --bg-secondary: #073642;
  --bg-surface: #001a21;

  /* Borders & Dividers */
  --border-color: #0a4f5c;
  --border-muted: #586e75;

  /* Text & Accents */
  --text-primary: #5FFFBF;
  --text-muted: #73a1a1;
  --text-light: #93A1A1;

  /* Status Colors */
  --success: #27c93f;
  --warning: #ffbd2e;
  --error: #ff5f56;

  /* Fonts */
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;

  /* Shared */
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --max: 1080px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  animation: page-in 0.4s var(--ease) both;
  transition: opacity 0.2s ease;
}

body.is-leaving { opacity: 0; }

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

h1, h2, h3, p, ol, dl, dd { margin: 0; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(var(--max), 100% - 2.5rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 43, 54, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-header.scrolled { border-bottom-color: var(--border-color); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.logo-img {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
  transition: transform 0.4s var(--ease);
}

.logo:hover .logo-img { transform: scale(1.08) rotate(-4deg); }

.nav { display: flex; gap: 24px; font-size: 0.9rem; }

.nav a {
  position: relative;
  color: var(--text-light);
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--text-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--text-primary); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid var(--text-primary);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-solid {
  background: var(--text-primary);
  color: var(--bg-surface);
  font-weight: 700;
}

.btn-solid:hover { background: #8dffd2; }
.btn-ghost { border-color: var(--border-color); color: var(--text-light); }
.btn-ghost:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* Footer */
.site-footer {
  padding: 14px 0 18px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: center;
}

/* Simple text pages (about, contact) */
.prose {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0 72px;
  text-align: center;
}
.prose h1 {
  color: var(--text-primary);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}
.prose p { max-width: 52ch; margin-top: 20px; }
.prose a { color: var(--text-primary); border-bottom: 1px solid var(--border-color); transition: border-color 0.2s ease; }
.prose a:hover { border-bottom-color: var(--text-primary); }
.prose dl { margin-top: 28px; }
.prose dt { color: var(--text-muted); font-size: 0.85rem; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Skip entrance animations and movement, but keep gentle fades and resizes */
  *, *::before, *::after { animation: none !important; }
  .btn:hover,
  .logo:hover .logo-img { transform: none; }
}