:root {
  --bg: #151617;
  --surface: #1b1d1e;
  --ink: #f1f0ea;
  --muted: #9b9d97;
  --faint: #989b93;
  --line: #343637;
  --acid: #c8ff3d;
  --danger: #ff8d78;
  --serif: Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 5px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--acid);
  color: #111;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.site-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.wrap {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
}

.main-nav {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a[aria-current] {
  color: var(--ink);
}

.main-nav .nav-prefix {
  color: var(--acid);
}

main {
  flex: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 18px;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 em {
  font-family: var(--serif);
  font-weight: 400;
}

.hero {
  max-width: 920px;
  padding: clamp(64px, 10vw, 112px) 0 clamp(64px, 8vw, 96px);
}

.hero h1,
.about-page h1,
.not-found h1 {
  max-width: 880px;
  margin-bottom: 26px;
  font-size: clamp(3.25rem, 8.8vw, 7.5rem);
  font-weight: 500;
  letter-spacing: -0.073em;
  line-height: 0.91;
}

.hero-copy {
  max-width: 465px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.post-index {
  padding-bottom: 100px;
}

.folder-index {
  padding-bottom: 100px;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid var(--line);
}

.folder-card {
  display: grid;
  min-height: 174px;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  gap: 13px;
  align-items: start;
  padding: 25px 24px 23px 17px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 60%);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.folder-card:nth-child(-n + 2) {
  border-top: 1px solid var(--line);
}

.folder-card:hover {
  background: rgba(200, 255, 61, 0.045);
  border-color: #555b45;
}

.folder-card-index,
.folder-card-label,
.folder-card-count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.folder-card-index {
  padding-top: 3px;
}

.folder-card-content {
  display: grid;
  justify-items: start;
  gap: 13px;
}

.folder-card-label {
  color: var(--acid);
}

.folder-card-name {
  overflow-wrap: anywhere;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.folder-card-count {
  letter-spacing: 0.02em;
  text-transform: none;
}

.folder-card-arrow {
  justify-self: end;
  color: var(--faint);
  font-size: 18px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.folder-card:hover .folder-card-arrow {
  color: var(--acid);
  transform: translate(2px, -2px);
}

.folder-wrap {
  width: min(100% - 48px, 900px);
}

.folder-heading {
  padding: 60px 0 55px;
}

.folder-heading .back-link {
  margin-bottom: 70px;
}

.folder-heading .eyebrow {
  margin-bottom: 18px;
}

.folder-heading h1 {
  margin: 0 0 14px;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.9;
  overflow-wrap: anywhere;
}

.folder-intro {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-heading span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.post-row {
  border-bottom: 1px solid var(--line);
}

.post-row-link {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 35px;
  gap: 0 18px;
  align-items: start;
  padding: 30px 10px 30px 0;
  transition: padding 0.23s ease, background 0.23s ease;
}

.post-row-link:hover {
  padding-right: 0;
  padding-left: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.post-number {
  padding-top: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.post-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  align-items: center;
  margin-bottom: 9px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-row-meta span::before {
  margin-right: 5px;
  color: var(--acid);
  content: "#";
}

.post-row-meta .post-folder::before {
  content: "/";
}

.post-row h3 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.post-row p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.row-arrow {
  align-self: center;
  color: var(--faint);
  font-size: 21px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.post-row-link:hover .row-arrow {
  color: var(--acid);
  transform: translate(3px, -3px);
}

.empty-state {
  padding: 48px 0;
  color: var(--muted);
}

.quiet-link,
.back-link,
.preview-link {
  transition: color 0.2s ease;
}

.quiet-link:hover,
.back-link:hover,
.preview-link:hover {
  color: var(--acid);
}

.reading-wrap {
  width: min(100% - 48px, 780px);
}

.post {
  padding: 74px 0 112px;
}

.back-link,
.preview-link {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.post-header {
  padding: 57px 0 50px;
  border-bottom: 1px solid var(--line);
}

.post-header h1 {
  max-width: 770px;
  margin: 0 0 20px;
  font-size: clamp(2.75rem, 7vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.post-deck {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.article-body {
  padding-top: 48px;
  color: #dadad4;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.75;
}

.article-body > * {
  margin: 0 0 27px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 55px;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.article-body h1 {
  font-size: 2.2rem;
}

.article-body h2 {
  font-size: 1.75rem;
}

.article-body h3 {
  font-size: 1.35rem;
}

.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--acid);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-body strong {
  color: var(--ink);
}

.article-body ul,
.article-body ol {
  padding-left: 1.25em;
}

.article-body li {
  padding-left: 0.2em;
  margin-bottom: 8px;
}

.article-body li::marker {
  color: var(--acid);
}

.article-body blockquote {
  margin-left: 0;
  padding-left: 22px;
  border-left: 2px solid var(--acid);
  color: var(--muted);
  font-style: italic;
}

.article-body hr {
  height: 1px;
  border: 0;
  background: var(--line);
}

.article-body code {
  padding: 0.14em 0.35em;
  border: 1px solid #393b3c;
  border-radius: 3px;
  background: #202223;
  color: #e7e9df;
  font-family: var(--mono);
  font-size: 0.78em;
}

.article-body pre {
  overflow-x: auto;
  margin: 34px 0;
  padding: 21px 23px;
  border: 1px solid #333536;
  border-radius: 4px;
  background: #111212;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #dce1c9;
  font-size: 13px;
  line-height: 1.65;
}

.article-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 38px 0;
  border: 1px solid #343636;
  border-radius: 3px;
  background: var(--surface);
}

.article-body table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
}

.article-body th,
.article-body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.article-body th {
  color: var(--ink);
  background: #202122;
  font-weight: 600;
}

.about-page {
  padding: clamp(88px, 14vw, 158px) 0 132px;
}

.about-page h1 {
  margin-bottom: 55px;
}

.about-copy {
  max-width: 625px;
  color: #d6d6d0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.65;
}

.about-copy p {
  margin-bottom: 24px;
}

.about-copy .about-note {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}

.about-links {
  max-width: 625px;
  margin-top: 58px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.about-links h2 {
  margin: 0 0 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-links ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.about-links a:hover {
  border-color: var(--acid);
  color: var(--ink);
  transform: translateX(3px);
}

.not-found {
  position: relative;
  isolation: isolate;
  max-width: 760px;
  padding: clamp(100px, 17vw, 190px) 0 clamp(120px, 18vw, 210px);
}

.not-found > :not(.not-found-code) {
  position: relative;
  z-index: 1;
}

.not-found h1 {
  margin-bottom: 25px;
}

.not-found-code {
  position: absolute;
  top: 50%;
  right: clamp(-12px, 8vw, 96px);
  z-index: 0;
  margin: 0;
  color: var(--acid);
  font-family: var(--mono);
  font-size: clamp(8rem, 28vw, 22rem);
  font-weight: 700;
  letter-spacing: -0.12em;
  line-height: 0.7;
  opacity: 0.06;
  transform: translateY(-48%);
  user-select: none;
}

.not-found-copy {
  max-width: 455px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 23px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--acid);
  color: #111;
}

.button-primary:hover {
  background: #dbff7a;
}

@media (max-width: 650px) {
  .wrap,
  .reading-wrap,
  .folder-wrap,
  .admin-wrap,
  .editor-wrap {
    width: min(100% - 32px, 1120px);
  }

  .site-header {
    min-height: 68px;
  }

  .main-nav {
    gap: 17px;
    font-size: 11px;
  }

  .hero {
    padding-top: 82px;
  }

  .folder-grid {
    grid-template-columns: 1fr;
  }

  .folder-card:nth-child(2) {
    border-top: 0;
  }

  .folder-card {
    min-height: 148px;
    padding: 22px 18px 20px 12px;
  }

  .folder-heading {
    padding-top: 43px;
    padding-bottom: 42px;
  }

  .folder-heading .back-link {
    margin-bottom: 55px;
  }

  .post-row-link {
    grid-template-columns: 30px minmax(0, 1fr) 20px;
    gap: 10px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .post-row-link:hover {
    padding-left: 5px;
  }

  .post-row h3 {
    font-size: 1.35rem;
  }

  .post-row-meta {
    gap: 6px 10px;
    font-size: 11px;
  }

  .post {
    padding-top: 49px;
  }

  .post-header {
    padding-top: 45px;
    padding-bottom: 39px;
  }

  .article-body {
    padding-top: 38px;
    font-size: 18px;
  }

  .article-body pre {
    margin-right: -2px;
    margin-left: -2px;
    padding: 16px;
  }

  .article-body img {
    margin: 28px 0;
  }

  .about-copy {
    font-size: 20px;
  }

  .about-links ul {
    grid-template-columns: 1fr;
  }

  .not-found {
    padding-top: 110px;
    padding-bottom: 135px;
  }

  .not-found-copy {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--acid);
  color: #111;
}
.skip-link:focus { top: 12px; }
.post-header h1, .post-row h3, .post-row p, .article-body { overflow-wrap: anywhere; }
.article-body pre { overflow-wrap: normal; }
.archive-search { margin: 24px 0; color: var(--muted); font-size: 13px; }
.archive-search label { display: block; margin-bottom: 8px; }
.archive-search > div { display: flex; gap: 10px; }
.archive-search input { min-width: 0; min-height: 44px; flex: 1; padding: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.pagination { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; color: var(--muted); font-size: 13px; }
.pagination a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: underline; }
.pagination span { align-self: center; }
