:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: rgba(10, 18, 32, 0.84);
  --panel-solid: #0a1220;
  --panel-2: #111827;
  --text: #f8fafc;
  --muted: #94a3b8;
  --faint: #475569;
  --line: rgba(34, 197, 94, 0.24);
  --line-hot: rgba(34, 211, 238, 0.42);
  --green: #22c55e;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --amber: #facc15;
  --danger: #fb7185;
  --shadow-green: 0 0 24px rgba(34, 197, 94, 0.22);
  --shadow-cyan: 0 0 32px rgba(34, 211, 238, 0.18);
  --radius: 8px;
  --max: 1180px;
  --cn: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: "Fira Code", "Cascadia Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", "Microsoft YaHei Mono", monospace;
  --display: "Share Tech Mono", var(--mono);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 15px/1.78 var(--cn);
  background:
    linear-gradient(rgba(34, 197, 94, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(244, 114, 182, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(34, 211, 238, 0.13), transparent 26rem),
    linear-gradient(180deg, #070914 0%, #05070d 54%, #070b12 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  animation: grid-drift 22s ease-in-out infinite alternate;
  overflow-x: hidden;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at var(--cursor-x, 50%) var(--cursor-y, 20%), rgba(34, 211, 238, 0.13), transparent 18rem),
    linear-gradient(115deg, transparent 0 44%, rgba(34, 197, 94, 0.055) 48%, transparent 52% 100%);
  opacity: 0.78;
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--pink));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.7);
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

::selection {
  color: #020617;
  background: var(--green);
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.23;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: overlay;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 9px 12px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: #020617;
  color: var(--text);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(18px);
}

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

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: min(52vw, 360px);
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0;
}

.brand-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid var(--green);
  box-shadow: inset 0 0 14px rgba(34, 197, 94, 0.5), var(--shadow-green);
  clip-path: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
  animation: mark-pulse 2.8s ease-in-out infinite;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  transition: border-color 180ms ease-out, color 180ms ease-out, background-color 180ms ease-out, box-shadow 180ms ease-out;
}

.site-nav a:hover {
  border-color: var(--line);
  background: rgba(34, 197, 94, 0.08);
  color: var(--text);
  box-shadow: inset 0 0 18px rgba(34, 197, 94, 0.08);
}

.site-main {
  padding: 56px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 30px;
  align-items: center;
  min-height: calc(100vh - 168px);
  padding: 24px 0 48px;
}

.hero-copy,
.terminal-panel,
.post-card,
.post-content,
.toc-panel,
.archive-list {
  animation: rise-in 520ms ease-out both;
}

.terminal-panel {
  animation-delay: 90ms;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font: 400 13px/1.4 var(--mono);
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero h1,
.post-header h1 {
  max-width: 900px;
  font-size: clamp(40px, 7vw, 90px);
  text-shadow: 0 0 28px rgba(34, 211, 238, 0.22);
}

.hero h1 {
  width: min(100%, 12ch);
  overflow-wrap: normal;
  word-break: keep-all;
}

.hero-description {
  max-width: 720px;
  margin: 22px 0 0;
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.85;
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.glitch::before {
  color: var(--cyan);
  transform: translate(2px, -1px);
  clip-path: inset(0 0 58% 0);
  animation: glitch-slice 4.8s steps(2, end) infinite;
}

.glitch::after {
  color: var(--pink);
  transform: translate(-2px, 1px);
  clip-path: inset(54% 0 0 0);
  animation: glitch-slice 5.6s steps(2, end) infinite reverse;
}

.terminal-panel,
.post-card,
.toc-panel,
.post-content,
.archive-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-green);
}

.terminal-panel {
  overflow: hidden;
  min-height: 370px;
}

.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
}

.terminal-bar span:nth-child(2) {
  background: var(--amber);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.72);
}

.terminal-bar span:nth-child(3) {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(251, 113, 133, 0.72);
}

.terminal-panel pre {
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: #bbf7d0;
  font-size: 14px;
}

.terminal-panel code::after {
  content: "_";
  display: inline-block;
  margin-left: 4px;
  color: var(--green);
  animation: cursor-blink 1.1s steps(2, start) infinite;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  transition: border-color 180ms ease-out, background-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

.post-card:hover {
  border-color: var(--line-hot);
  background: rgba(10, 18, 32, 0.95);
  box-shadow: var(--shadow-cyan);
  transform: translateY(-3px);
}

.post-card-meta,
.post-meta,
.post-card-footer,
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.post-card h2 {
  margin-top: 18px;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.post-card h2 a:hover,
.archive-item:hover span,
.read-link:hover,
.tag-row a:hover {
  color: var(--cyan);
}

.post-card p {
  margin: 16px 0 0;
  color: #cbd5e1;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.post-card-footer {
  margin-top: auto;
  justify-content: space-between;
}

.read-link {
  color: var(--green);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.tag-row a {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 999px;
  color: #a5f3fc;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-shell,
.archive-shell,
.taxonomy-shell {
  max-width: var(--max);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 30px;
  min-width: 0;
}

.post-header h1 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-header.compact h1 {
  font-size: clamp(38px, 6vw, 72px);
}

.post-meta {
  margin-top: 18px;
}

.post-header .tag-row {
  margin-top: 18px;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 22px;
  align-items: start;
}

.toc-panel {
  position: sticky;
  top: 94px;
  order: 2;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
}

.toc-title {
  margin-bottom: 12px;
  color: var(--green);
  font-family: var(--display);
  font-size: 20px;
}

.toc-panel ol,
.toc-panel ul {
  margin: 0;
  padding-left: 16px;
}

.toc-panel li {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.toc-panel a:hover {
  color: var(--cyan);
}

.post-content {
  min-width: 0;
  max-width: 100%;
  padding: clamp(20px, 4vw, 42px);
  overflow: hidden;
}

.post-content * {
  min-width: 0;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content > :last-child {
  margin-bottom: 0;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  scroll-margin-top: 96px;
  margin: 2.1em 0 0.7em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-content h2 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #e0f2fe;
  font-size: clamp(30px, 4vw, 44px);
}

.post-content h3 {
  color: #bbf7d0;
  font-size: 28px;
}

.post-content h4 {
  color: #fce7f3;
  font-size: 22px;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content table,
.post-content blockquote,
.post-content details {
  margin: 1.1em 0;
}

.post-content p,
.post-content li {
  color: #dbeafe;
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-content a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.45);
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-content strong {
  color: #fff;
}

.post-content em {
  color: #fbcfe8;
}

.post-content hr {
  height: 1px;
  margin: 34px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-hot), transparent);
}

.post-content blockquote {
  margin-left: 0;
  padding: 14px 18px;
  border-left: 3px solid var(--pink);
  background: rgba(244, 114, 182, 0.08);
  color: #fce7f3;
  overflow-wrap: anywhere;
}

.post-content details {
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.06);
}

.post-content summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--cyan);
}

.post-content details > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}

.post-content table {
  display: block;
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-spacing: 0;
  border-collapse: collapse;
  white-space: nowrap;
}

.post-content th,
.post-content td {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  vertical-align: top;
  max-width: 560px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.post-content th {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  text-align: left;
}

.post-content tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.42);
}

.post-content code,
.post-content kbd {
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.82);
  color: #a7f3d0;
  font-family: var(--mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-content code {
  padding: 0.15em 0.38em;
}

.post-content kbd {
  padding: 0.1em 0.45em;
  box-shadow: inset 0 -1px rgba(255, 255, 255, 0.18);
}

.post-content pre,
figure.highlight {
  position: relative;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  margin: 1.3em 0;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: var(--radius);
  background: #020617;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9), 0 18px 50px rgba(0, 0, 0, 0.32);
}

.post-content pre {
  padding: 18px;
  white-space: pre;
}

.post-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #d1fae5;
  font-size: 13px;
  overflow-wrap: normal;
  word-break: normal;
  white-space: pre;
}

figure.highlight {
  padding: 0;
}

figure.highlight table {
  display: table;
  margin: 0;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  white-space: pre;
}

figure.highlight td {
  padding: 0;
  border: 0;
}

figure.highlight .gutter {
  width: 1%;
  user-select: none;
  border-right: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(15, 23, 42, 0.88);
  color: #64748b;
  text-align: right;
}

figure.highlight .gutter pre {
  padding: 18px 10px;
}

figure.highlight .code pre {
  padding: 18px;
  min-width: max-content;
}

figure.highlight pre {
  margin: 0;
  overflow: visible;
  background: transparent;
  color: #d1fae5;
  font-size: 13px;
  line-height: 1.65;
}

figure.highlight figcaption {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.highlight .comment,
.highlight .quote {
  color: #64748b;
}

.highlight .keyword,
.highlight .selector-tag,
.highlight .subst {
  color: #67e8f9;
}

.highlight .number,
.highlight .literal,
.highlight .variable,
.highlight .template-variable,
.highlight .tag .attr {
  color: #facc15;
}

.highlight .string,
.highlight .doctag {
  color: #86efac;
}

.highlight .title,
.highlight .section,
.highlight .selector-id {
  color: #f9a8d4;
}

.highlight .type,
.highlight .class .title {
  color: #c4b5fd;
}

.copy-code {
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.88);
  color: var(--cyan);
  font: 600 11px/1 var(--mono);
  transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
}

.copy-code:hover {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
}

.katex-display,
mjx-container[display="true"],
.MathJax_Display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 0;
  overscroll-behavior-x: contain;
}

.post-content .katex,
.post-content mjx-container,
.post-content .MathJax {
  color: #ecfeff;
}

.post-content .mermaid {
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: var(--radius);
  background: rgba(2, 6, 23, 0.7);
}

.post-content .task-list-item {
  list-style: none;
}

.post-content input[type="checkbox"] {
  accent-color: var(--green);
}

.post-content .note,
.post-content .tip,
.post-content .warning,
.post-content .danger {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(34, 197, 94, 0.08);
}

.post-content .warning {
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.08);
}

.post-content .danger {
  border-color: rgba(251, 113, 133, 0.44);
  background: rgba(251, 113, 133, 0.08);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: var(--max);
  margin: 22px auto 0;
}

.post-nav a {
  min-height: 86px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  overflow-wrap: anywhere;
  transition: border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}

.post-nav a:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.post-nav a:only-child {
  grid-column: span 2;
}

.post-nav span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
}

.archive-list {
  padding: 24px;
}

.archive-list h2 {
  margin: 22px 0 10px;
  color: var(--green);
  font-size: 32px;
}

.archive-list h2:first-child {
  margin-top: 0;
}

.archive-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  min-width: 0;
}

.archive-item time {
  color: var(--muted);
}

.archive-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.taxonomy-card,
.taxonomy-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-green);
}

.taxonomy-card {
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

.taxonomy-card:hover {
  border-color: var(--line-hot);
  box-shadow: var(--shadow-cyan);
  transform: translateY(-2px);
}

.taxonomy-name {
  color: var(--text);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.taxonomy-count {
  color: var(--green);
  font: 600 12px/1.4 var(--mono);
}

.taxonomy-empty {
  margin: 0;
  padding: 22px;
  color: var(--muted);
}

.pagination {
  margin-top: 28px;
  text-align: center;
}

.pagination .page-number,
.pagination .extend,
.pagination span {
  display: inline-flex;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.pagination .current,
.pagination a:hover {
  border-color: var(--green);
  color: var(--green);
}

.site-footer {
  border-top: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(5, 7, 13, 0.8);
}

.footer-inner {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-title {
  color: var(--green);
  font-family: var(--display);
  font-size: 26px;
}

.site-footer p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 42px 28px, -24px 42px, 0 0, 0 0, 0 0;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mark-pulse {
  0%,
  100% {
    opacity: 0.78;
    transform: rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: rotate(30deg);
  }
}

@keyframes glitch-slice {
  0%,
  92%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
  94% {
    opacity: 0.6;
    transform: translate(3px, -1px);
  }
  96% {
    opacity: 0.45;
    transform: translate(-2px, 1px);
  }
}

@keyframes cursor-blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

.footer-meta {
  justify-content: flex-end;
}

.reveal-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease-out, transform 420ms ease-out;
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .post-layout,
  .post-list {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .toc-panel {
    position: relative;
    top: auto;
    order: -1;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }

  .site-main {
    padding-top: 34px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .brand {
    max-width: calc(100vw - 58px);
    font-size: clamp(18px, 5.4vw, 24px);
  }

  .hero h1 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(28px, 7.8vw, 46px);
    line-height: 1.05;
    white-space: nowrap;
  }

  .post-header h1 {
    font-size: clamp(34px, 10vw, 58px);
  }

  .post-content {
    padding: 18px;
  }

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

  .post-nav a:only-child {
    grid-column: auto;
  }

  .footer-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .header-inner,
  .footer-inner,
  .site-main {
    width: min(var(--max), calc(100% - 22px));
  }

  .terminal-panel pre,
  .post-content pre,
  figure.highlight .code pre {
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(28px, 8.8vw, 38px);
    white-space: nowrap;
  }

  .copy-code {
    top: 8px;
    right: 8px;
    min-width: 48px;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

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

  body::before {
    opacity: 0.3;
  }

  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
}
