@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #fbfaf5;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e6e0d2;
  --accent: #4a7c2e;
  --accent-bg: #d9e8c7;
  --accent-bg-soft: #ebf0e4;
  --warm-bg: #fbf7f0;
  --warm-fg: #a96f22;
  --warm-border: #d9c9a8;
  --link: #0366d6;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", Helvetica, Arial, sans-serif;
}

html {
  scrollbar-gutter: stable;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  line-height: 1.5em;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg);
  background-color: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
  font-size: 1em;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5em 2em 0.5em 2em;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding-bottom: 0.6em;
  border-bottom: 1px dashed var(--rule);
  margin-bottom: 1.2em;
}

#name {
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  font-size: 28px;
  text-decoration: none;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 0.45ch;
  line-height: 1;
}

#name::before {
  content: ">";
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75em;
  color: var(--accent);
  transform: translateY(-0.05em);
}

/* ── Nav ────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav .navbar {
  list-style: none;
  display: flex;
  flex-flow: row nowrap;
  margin: 0;
  padding: 0;
}

.nav .navbar li {
  padding: 0;
  display: inline-block;
}

.navbar li a {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--fg);
  padding: 0.45em 0.9em;
  display: inline-block;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.navbar li a:hover {
  background-color: var(--accent-bg-soft);
  border-color: var(--rule);
}

.navbar li a.current {
  background-color: var(--accent-bg);
  border-color: #c0d4a8;
}

/* ── Hamburger ──────────────────────────────────────────────────────── */

.hamburger-icon {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  padding: 0;
  box-sizing: border-box;
}

.hamburger-icon div {
  width: 2rem;
  height: 0.3rem;
  background-color: #333;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

@media (max-width: 768px) {
  .nav .navbar {
    z-index: 5;
    flex-flow: column nowrap;
    background-color: var(--bg);
    position: absolute;
    top: 4rem;
    right: 1rem;
    width: auto;
    padding: 0.5rem;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08);
    border: 1px solid var(--rule);
    border-radius: 3px;
    display: none;
  }

  .nav .navbar.open {
    display: flex;
  }

  .nav .navbar li {
    color: var(--fg);
    display: flex;
  }

  .navbar li a {
    width: 100%;
  }

  .hamburger-icon {
    display: flex;
  }
}

/* ── Links ──────────────────────────────────────────────────────────── */

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

a:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

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

#site-footer {
  margin-top: auto;
  padding-top: 4em;
  padding-bottom: 2em;
  bottom: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

#site-footer .prompt {
  color: var(--accent);
  margin-right: 0.4ch;
}

#site-footer .sep {
  color: var(--rule);
  margin: 0 0.4ch;
}

#site-footer .eof {
  color: #b09b6c;
  letter-spacing: 0.05em;
}

/* ── Reusable terminal heading ──────────────────────────────────────── */

.cli-head {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  margin: 0 0 1em 0;
  display: flex;
  align-items: baseline;
  gap: 0.6ch;
  flex-wrap: wrap;
}

.cli-head .prompt {
  color: var(--accent);
  font-weight: 500;
}

.cli-head .meta {
  color: var(--muted);
  font-size: 0.92em;
}

/* Blinking caret used at end of typed text */
.caret {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.15em;
  margin-left: 0.3ch;
  animation: caret-blink 1.05s steps(1) infinite;
}

@keyframes caret-blink {
  50% { background: transparent; }
}
