@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Oblique.ttf') format('truetype');
  font-weight: 400;
  font-style: oblique;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Bold-Oblique.ttf') format('truetype');
  font-weight: 700;
  font-style: oblique;
}

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --background-color: #ffffff;
  --text-color: #111111;
  --link-color: #111111;
  --border-color: #999999;
  --muted-color: #999999;
}

/* ============================================
   Base Layout
   ============================================ */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Berkeley Mono', monospace;
  font-size: 1em;
  line-height: 1.3;
  margin: 0 auto;
  padding: 50px;
  max-width: 38em;
}

/* ============================================
   Navigation
   ============================================ */
.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0;
}

.site-nav + hr {
  margin-top: 0;
  height: 5px;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted-color);
  font-size: 0.8em;
  text-transform: uppercase;
}

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

.site-title {
  font-size: 0.9em;
  color: var(--text-color) !important;
}

.site-nav li.active a,
.site-title.active {
  color: var(--text-color);
  font-weight: 600;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--border-color);
  font-weight: 500;
  text-transform: uppercase;
  text-align: left;
  margin-top: 1.25em;
  margin-bottom: 0.25em;
}

h3 {
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  display: flex;
  align-items: flex-end;
  gap: 0.6em;
}

h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ============================================
   Links
   ============================================ */
a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.25s ease;
}

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

/* ============================================
   Lists
   ============================================ */
ul, ol {
  padding-left: 2em;
  margin: 0.5em 0;
}

/* ============================================
   Person Cards
   ============================================ */
.person {
  margin: 0.75em 0;
}

.person-name {
  display: block;
}

.person-meta {
  display: block;
  color: var(--muted-color);
  font-size: 0.88em;
}

/* ============================================
   Events
   ============================================ */
.event {
  margin: 1.25em 0;
  padding-left: 1em;
  border-left: 1px solid var(--border-color);
}

.event-meta {
  margin-bottom: 0;
}

.event p {
  margin: 0;
}

.event-date {
  color: var(--muted-color);
  font-size: 0.88em;
  margin-right: 0.5em;
}

/* ============================================
   Media
   ============================================ */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
}

/* ============================================
   Code
   ============================================ */
code {
  font-family: 'Courier New', monospace;
  background-color: rgba(0, 0, 0, 0.06);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
}

/* ============================================
   Blockquotes
   ============================================ */
blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 2px solid var(--border-color);
  color: var(--muted-color);
  font-style: italic;
}

/* ============================================
   Rules
   ============================================ */
hr {
  height: 1px;
  background-color: var(--border-color);
  border: none;
  margin: 1.25em 0;
}

/* ============================================
   Endnotes
   ============================================ */
section[role="doc-endnotes"] {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--border-color);
}

section[role="doc-endnotes"] ol li a[role="doc-backlink"] {
  padding-right: 0.2em;
}

/* ============================================
   Hamburger (hidden on desktop)
   ============================================ */
.nav-toggle {
  display: none;
}

.nav-hamburger {
  display: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  body {
    padding: 12px;
    font-size: 0.9em;
  }

  .site-nav {
    position: sticky;
    top: 0;
    background: var(--background-color);
    z-index: 100;
    flex-wrap: wrap;
    border-bottom: 5px solid var(--border-color);
  }

  .site-nav + hr {
    display: none;
  }

  .nav-hamburger {
    display: block;
    cursor: pointer;
    color: var(--muted-color);
    font-size: 0;
    user-select: none;
  }

  .nav-hamburger::before {
    content: '☰';
    font-size: 1.1rem;
    display: inline-block;
    transition: transform 0.25s ease;
  }

  .nav-toggle:checked ~ .nav-hamburger::before {
    content: '✕';
    transform: rotate(90deg);
  }

  .site-nav ul {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.5em;
    padding: 0.5em 0;
  }

  .nav-toggle:checked ~ ul {
    display: flex;
  }
}
