:root {
  --bg: #000;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --accent: #e8e8e8;
  /* --max set in base.html from admin “Content box width” */
  --font: Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 1.5rem;
  font-family: var(--font-ui);
  background: var(--bg);
}

.site-header__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max, 42rem);
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

.site-brand span {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
}

/* Hamburger — mobile only */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: #111;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: #1a1a1a;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.nav-toggle-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
  pointer-events: none;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav-main {
  display: flex;
  align-items: center;
}

.site-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
}
.site-nav-backdrop.is-visible {
  display: block;
}

body.nav-open {
  overflow: hidden;
}
body.nav-open .site-header__inner {
  z-index: 200;
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav-main {
    position: fixed;
    top: var(--site-header-offset, 5rem);
    right: 0;
    width: min(20rem, 92vw);
    height: calc(100dvh - var(--site-header-offset, 5rem));
    max-height: calc(100vh - var(--site-header-offset, 5rem));
    margin: 0;
    padding: 0.5rem 0 1.5rem;
    flex-direction: column;
    align-items: stretch;
    background: #0a0a0a;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 150;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s;
  }
  .site-nav-main.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
  }
  .site-nav li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .site-nav a {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.15rem;
    font-size: 0.88rem;
    min-height: 48px;
    line-height: 1.3;
  }
  .site-nav a:hover,
  .site-nav a.is-active {
    background: rgba(255, 255, 255, 0.05);
  }
}

@media (min-width: 768px) {
  .site-header__inner {
    align-items: baseline;
    flex-wrap: wrap;
  }
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  color: var(--muted);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-list a {
  text-decoration: none;
}

.post-list a:hover h2 {
  text-decoration: underline;
}

.post-list h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.post-meta {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-footer {
  max-width: var(--max, 42rem);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}

.flash {
  font-family: var(--font-ui);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.flash--ok {
  background: rgba(120, 200, 140, 0.15);
  color: #9ad8b8;
}

.flash--error {
  background: rgba(200, 100, 110, 0.15);
  color: #e8b4bc;
}

.contact-form {
  font-family: var(--font-ui);
  max-width: 28rem;
}

.contact-form label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  font: inherit;
}

.contact-form button {
  padding: 0.65rem 1.25rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}
