:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #1b1f23;
  --muted: #626b73;
  --line: #d9ddd8;
  --accent: #176b52;
  --accent-2: #9a3412;
  --code-bg: #111717;
  --code-fg: #d8f3dc;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent), transparent 55%);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

.site-header,
.site-footer,
main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: grid;
  gap: 0;
  font-weight: 750;
  text-decoration: none;
  line-height: 1.25;
}

.prompt {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 650;
}

nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

nav a.active,
nav a:hover {
  background: #e7ece7;
  color: var(--ink);
}

.hero {
  min-height: calc(100vh - 148px);
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: 56px;
  padding: 48px 0 30px;
}

.eyebrow,
.post-meta,
time {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 6.8rem);
}

.subtitle {
  margin: 14px 0 0;
  color: var(--accent-2);
  font-size: 1.35rem;
  font-weight: 700;
}

.intro {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.06rem;
}

.terminal-panel {
  border: 1px solid #243232;
  border-radius: 8px;
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: 0 20px 60px rgb(20 27 24 / 0.16);
}

.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid #263636;
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #cc5f52;
}

.terminal-bar span:nth-child(2) {
  background: #d3a937;
}

.terminal-bar span:nth-child(3) {
  background: #4d9a6a;
}

pre {
  margin: 0;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 22px;
  font: 0.92rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

p code,
li code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: #e8ece8;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 12px 0 18px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.section-head h2,
.page-title h1 {
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

.post-card,
.post-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-card {
  padding: 22px;
}

.post-card h3,
.post-row h2 {
  margin: 10px 0 8px;
}

.post-card p,
.post-row p,
.page-title p,
.article header p {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  margin-left: 8px;
  color: var(--accent-2);
}

.page-title {
  padding: 52px 0 26px;
  border-bottom: 1px solid var(--line);
}

.page-title h1,
.article h1 {
  font-size: clamp(2.2rem, 6vw, 4.6rem);
}

.post-list {
  display: grid;
  gap: 14px;
  padding: 28px 0 56px;
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 30px 0 60px;
}

.taxonomy-card {
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
}

.taxonomy-card span,
.taxonomy-card small {
  color: var(--muted);
}

.taxonomy-card strong {
  font-size: 1.4rem;
  line-height: 1.15;
}

.archive {
  display: grid;
  gap: 34px;
  padding: 30px 0 60px;
}

.archive-month {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.archive-month h2 {
  margin: 0;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-list a {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.archive-list small {
  color: var(--muted);
}

.post-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  padding: 22px;
}

.article {
  max-width: 820px;
  margin: 0 auto;
  padding: 52px 0 72px;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 820px) 220px;
  align-items: start;
  gap: 54px;
  max-width: 1110px;
  margin: 0 auto;
}

.article-shell .article {
  width: 100%;
  margin: 0;
}

.article-toc {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  margin-top: 64px;
  padding: 18px 0 18px 18px;
  border-left: 1px solid var(--line-dark);
  color: var(--muted-dark);
}

.article-toc h2 {
  margin: 0 0 12px;
  color: var(--ink-dark);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.article-toc ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc a {
  display: block;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: none;
}

.article-toc a:hover {
  color: #0d7a4b;
}

.article-toc .toc-level-4,
.article-toc .toc-level-5 {
  padding-left: 14px;
}

.article header {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.article-body {
  padding-top: 24px;
}

.comments-section {
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.comments-section h2 {
  margin: 0 0 18px;
  font-size: 1.4rem;
}

.comments-placeholder {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.article-body h2,
.article-body h3 {
  margin-top: 2.1em;
}

.article-body li + li {
  margin-top: 0.35em;
}

.site-footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 42px;
  }

  .post-grid,
  .post-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.7rem, 18vw, 4.8rem);
  }
}

/* Premium visual pass */
:root {
  --bg: #080b0a;
  --surface: #0f1412;
  --paper: #f6f4ed;
  --paper-2: #ebe7dc;
  --ink: #e9efe8;
  --ink-dark: #1c241f;
  --muted: #a8b3aa;
  --muted-dark: #5d675f;
  --line: rgb(220 232 220 / 0.14);
  --line-dark: #d7d1c3;
  --accent: #69d39a;
  --accent-strong: #21b36b;
  --amber: #d89045;
  --red: #d35650;
  --max: 1160px;
}

html {
  background: var(--bg);
}

body.home {
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 12%, rgb(105 211 154 / 0.12), transparent 28rem),
    linear-gradient(180deg, #080b0a 0%, #0d1210 58%, var(--paper) 58%, var(--paper) 100%);
  text-rendering: geometricPrecision;
}

body.page {
  color: var(--ink-dark);
  background: var(--paper);
  text-rendering: geometricPrecision;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: rgb(8 11 10 / 0.76);
  backdrop-filter: blur(18px);
}

.page .site-header {
  color: var(--ink);
}

.page main {
  min-height: calc(100vh - 156px);
}

nav a {
  border: 1px solid transparent;
  border-radius: 999px;
}

nav a.active,
nav a:hover {
  border-color: var(--line);
  background: rgb(255 255 255 / 0.06);
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: calc(100vh - 78px);
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
  gap: 44px;
  padding: 54px 0 42px;
  overflow: hidden;
}

.hero-immersive::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, #0d1210 78%, var(--paper));
}

.hero-image {
  position: absolute;
  inset: 0 calc(50% - 50vw);
  width: 100vw;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
  filter: saturate(0.95) contrast(1.08);
}

.hero-copy,
.terminal-panel {
  position: relative;
  z-index: 2;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 750;
  text-transform: uppercase;
}

h1 {
  max-width: 8ch;
  color: var(--ink);
  font-size: clamp(3.4rem, 10vw, 8rem);
}

.subtitle {
  color: var(--amber);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 780;
}

.intro {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  color: var(--ink);
  background: rgb(255 255 255 / 0.08);
  text-decoration: none;
  font-weight: 750;
}

.button.primary {
  border-color: rgb(105 211 154 / 0.5);
  background: linear-gradient(135deg, var(--accent-strong), #8ee0ab);
  color: #07100b;
  box-shadow: 0 18px 48px rgb(33 179 107 / 0.22);
}

.button.light {
  border-color: var(--line-dark);
  background: rgb(255 255 255 / 0.48);
  color: var(--ink-dark);
}

.terminal-panel {
  border-color: rgb(143 197 166 / 0.24);
  background: rgb(9 15 13 / 0.84);
  box-shadow: 0 28px 80px rgb(0 0 0 / 0.44);
  backdrop-filter: blur(10px);
}

.terminal-bar {
  border-bottom-color: rgb(255 255 255 / 0.09);
}

.terminal-bar span {
  background: var(--red);
}

.terminal-bar span:nth-child(2) {
  background: var(--amber);
}

.terminal-bar span:nth-child(3) {
  background: var(--accent);
}

pre {
  color: #d7f6dd;
}

.signal-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: -22px 0 58px;
  border: 1px solid rgb(255 255 255 / 0.11);
  border-radius: 8px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.12);
  box-shadow: 0 28px 90px rgb(0 0 0 / 0.28);
}

.signal-strip div {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 22px;
  background: rgb(13 18 16 / 0.9);
}

.signal-strip strong {
  color: var(--ink);
}

.signal-strip span {
  color: var(--muted);
  font-size: 0.94rem;
}

.section-head,
.post-grid,
.page-title,
.post-list,
.article,
.site-footer {
  color: var(--ink-dark);
}

.section-head {
  border-top-color: var(--line-dark);
  padding-top: 34px;
}

.section-head a:hover,
.post-grid a:hover,
.post-list a:hover,
.article a:hover,
.site-footer a:hover {
  color: #0d7a4b;
}

.post-card,
.post-row,
.taxonomy-card {
  border-color: var(--line-dark);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.72), rgb(255 255 255 / 0.36)),
    var(--paper-2);
  box-shadow: 0 16px 34px rgb(48 43 32 / 0.08);
}

.post-card {
  min-height: 210px;
  padding: 24px;
}

.post-card h3 {
  font-size: 1.45rem;
}

.post-card p,
.post-row p,
.page-title p,
.article header p {
  color: var(--muted-dark);
}

.post-meta,
time {
  color: #127249;
}

.tag {
  color: #9a4a16;
}

.archive-month,
.archive-list a {
  border-color: var(--line-dark);
}

.page-title,
.article header,
.comments-section,
.site-footer {
  border-color: var(--line-dark);
}

.page-title h1,
.article h1 {
  max-width: none;
  color: var(--ink-dark);
}

.article-body pre {
  border-radius: 8px;
  background: #0b100e;
}

p code,
li code {
  background: #e4e0d5;
  color: #243026;
}

@media (max-width: 860px) {
  body.home {
    background:
      radial-gradient(circle at 78% 4%, rgb(105 211 154 / 0.1), transparent 20rem),
      linear-gradient(180deg, #080b0a 0%, #0d1210 64%, var(--paper) 64%, var(--paper) 100%);
  }

  .site-header {
    position: static;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 48px 0 56px;
  }

  .hero-image {
    opacity: 0.42;
  }

  h1 {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .terminal-panel {
    max-width: 100%;
  }

  .signal-strip {
    grid-template-columns: 1fr;
    margin-top: -18px;
  }

  .taxonomy-grid,
  .archive-month,
  .archive-list a {
    grid-template-columns: 1fr;
  }

  .archive-list a {
    gap: 4px;
  }

  .article-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .article-shell .article {
    order: 2;
  }

  .article-toc {
    position: static;
    order: 1;
    width: 100%;
    max-height: none;
    margin: 28px 0 0;
    padding: 16px;
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    background: rgb(255 255 255 / 0.36);
  }
}
