/* ─── Design tokens ───────────────────────────────────────────────── */
:root {
  --paper: #ffffff;
  --paper-tint: #fafaf7;
  --manila: #F4E9D0;
  --manila-deep: #E8D9B0;
  --manila-edge: #C9B888;
  --teal: #1B4D4A;
  --teal-dark: #103634;
  --silver-light: #EDEDEA;
  --silver: #C0C0BD;
  --silver-mid: #9A9A97;
  --silver-dark: #6F6F6C;
  --silver-shadow: #3F3F3D;
  --ink: #141414;
  --ink-muted: #555;
  --rule: #E5E2D8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
a:visited { color: var(--teal-dark); }

/* ─── Top bar ───────────────────────────────────────────────────────── */
.topbar {
  background: var(--teal);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid var(--teal-dark);
  text-decoration: none;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.logo-wrap:hover { color: inherit; }

/* Windows-style keycap */
.esc-key {
  width: 44px; height: 44px;
  background: linear-gradient(180deg, var(--silver-light) 0%, var(--silver) 55%, var(--silver-mid) 100%);
  border-radius: 2px;
  position: relative;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -2px 0 var(--silver-mid),
    inset 1px 0 0 rgba(255,255,255,0.5),
    inset -1px 0 0 var(--silver-mid),
    0 2px 0 var(--silver-shadow),
    0 3px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--silver-shadow);
}
.esc-key-text {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #1a1a1a;
  letter-spacing: 0;
  line-height: 1;
  text-transform: lowercase;
}

.wordmark {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
}
.wordmark .sub {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--manila-deep);
  margin-top: 4px;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
}
.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-family: "Oswald", sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.topbar nav a {
  color: #fff;
  text-decoration: none;
  padding: 3px 0;
  border-bottom: 1px solid transparent;
}
.topbar nav a:hover { border-bottom-color: var(--manila-deep); color: #fff; }
.topbar nav a.current { border-bottom-color: #fff; }

/* ─── Page container ────────────────────────────────────────────────── */
.page { max-width: 760px; margin: 0 auto; padding: 36px 28px 60px; }

/* ─── Masthead ──────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  margin-bottom: 28px;
  position: relative;
}
.masthead h1 {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 38px;
  letter-spacing: 1px;
  margin: 0 0 4px;
  color: var(--ink);
  text-transform: uppercase;
}
.masthead .tagline {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  letter-spacing: 0.5px;
}
.masthead .vol {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: var(--ink-muted);
  float: right;
  margin-top: 22px;
  letter-spacing: 1.5px;
}
.masthead h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--teal);
  margin-top: 8px;
}

/* ─── Filters ───────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 32px;
  padding: 12px 14px;
  background: var(--manila);
  border: 1px solid var(--manila-edge);
}
.filters-label {
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-right: 6px;
  align-self: center;
  font-weight: 500;
}
.filter {
  font-family: "Oswald", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 11px;
  background: var(--paper);
  color: var(--teal-dark);
  border: 1px solid var(--manila-edge);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  border-radius: 0;
}
.filter:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.filter.active { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ─── Essay list ────────────────────────────────────────────────────── */
.essay-list { list-style: none; padding: 0; margin: 0; }
.essay {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--rule);
}
.essay:last-child { border-bottom: none; }
.essay-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--ink-muted);
  font-family: "Courier New", monospace;
  letter-spacing: 0.5px;
}
.essay-cat {
  font-family: "Oswald", sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--teal);
  color: #fff;
  padding: 2px 8px;
}
.essay-cat.locked { background: var(--silver-mid); }
.essay-title {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: 0.3px;
}
.essay-title a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.essay-title a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.essay-excerpt {
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.65;
  margin: 0;
}
.essay-readmore {
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  margin-top: 10px;
  display: inline-block;
  font-weight: 500;
}
.essay-readmore:hover { text-decoration: underline; }
.essay-readmore::after { content: " \2192"; }

/* ─── Article view ──────────────────────────────────────────────────── */
.back-link {
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  margin-bottom: 24px;
  display: inline-block;
  cursor: pointer;
}
.back-link:hover { text-decoration: underline; }
.back-link::before { content: "\2190  "; }

.article-head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.article-head .essay-meta { margin-bottom: 12px; }
.article-head h1 {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.article-head h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--teal);
  margin-top: 10px;
}
.byline {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 6px;
}

.article-body { font-family: "Courier New", Courier, monospace; font-size: 15px; line-height: 1.75; }
.article-body p { margin: 0 0 14px; }
.article-body h2 {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--ink);
  margin: 32px 0 10px;
  text-transform: uppercase;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
}
.article-body h3 {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--teal-dark);
  margin: 24px 0 8px;
  text-transform: uppercase;
}
.article-body em { font-style: italic; }
.article-body strong { font-weight: bold; }
.article-body blockquote {
  border-left: 3px solid var(--teal);
  background: var(--manila);
  margin: 18px 0;
  padding: 12px 16px;
  font-style: italic;
  color: var(--ink);
}
.article-body code {
  background: var(--manila);
  padding: 1px 5px;
  font-size: 14px;
  border: 1px solid var(--manila-edge);
}
.article-body ul, .article-body ol { padding-left: 26px; margin: 8px 0 16px; }
.article-body li { margin-bottom: 6px; }
.article-body hr { border: none; border-top: 1px solid var(--rule); margin: 28px 0; }
.article-body .aside {
  background: var(--manila);
  border: 1px solid var(--manila-edge);
  border-left: 3px solid var(--silver-dark);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 18px 0;
}

/* Images in articles */
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px auto;
  border: 1px solid var(--rule);
}
.article-body figure {
  margin: 24px 0;
}
.article-body figcaption {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  text-align: center;
  margin-top: 6px;
}

/* Twitter embeds — keep them visually contained */
.article-body .twitter-tweet {
  margin: 18px auto !important;
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.footer {
  margin-top: 64px;
  padding: 24px 28px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  border-top: 1px solid var(--rule);
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.7;
}
.footer .colophon { margin-top: 12px; font-size: 11px; color: var(--ink-muted); letter-spacing: 0.5px; }
.footer-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.footer-row .links a {
  margin-right: 12px;
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
}
.footer-row .links a:hover { text-decoration: underline; }
.footer-mark {
  font-family: "Oswald", sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--teal);
  font-size: 13px;
}

/* ─── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .esc-key { width: 38px; height: 38px; }
  .esc-key-text { font-size: 12px; }
  .wordmark { font-size: 18px; }
  .wordmark .sub { font-size: 9px; letter-spacing: 2px; }
  .topbar nav { width: 100%; margin-left: 0; gap: 12px; flex-wrap: wrap; font-size: 11px; }
  .page { padding: 24px 18px 40px; }
  .masthead h1 { font-size: 28px; }
  .masthead .vol { float: none; margin-top: 8px; display: block; }
  .essay-title { font-size: 19px; }
  .article-head h1 { font-size: 26px; }
}
