:root {
  --text: #1d1d1f;
  --muted: #6e6e73;
  --body: #fbfbfd;
  --soft: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(29, 29, 31, 0.1);
  --blue: #06c;
  --blue-hover: #004c99;
  --shadow: 0 24px 70px rgba(29, 29, 31, 0.1);
  --header: rgba(251, 251, 253, 0.78);
  --header-line: rgba(29, 29, 31, 0.08);
  --hero-background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(232, 237, 245, 0.9) 58%, rgba(255, 255, 255, 0.96));
  --hero-base: #f2f4f8;
  --hero-subtitle: #515154;
  --glow-one: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0, rgba(196, 209, 228, 0.7) 44%, rgba(196, 209, 228, 0) 72%);
  --glow-two: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0, rgba(220, 229, 242, 0.44) 46%, rgba(220, 229, 242, 0) 72%);
  --dock: rgba(255, 255, 255, 0.54);
  --dock-border: rgba(255, 255, 255, 0.62);
  --dock-item: rgba(255, 255, 255, 0.58);
  --dock-item-hover: rgba(255, 255, 255, 0.84);
  --card: rgba(255, 255, 255, 0.74);
  --solid-card: #fff;
  --card-shadow: 0 18px 48px rgba(29, 29, 31, 0.06);
  --feature-background: radial-gradient(circle at 78% 18%, rgba(205, 216, 231, 0.92), rgba(255, 255, 255, 0) 38%), rgba(255, 255, 255, 0.78);
  --contact-background: radial-gradient(circle at 88% 18%, rgba(205, 216, 231, 0.78), rgba(255, 255, 255, 0) 44%), rgba(255, 255, 255, 0.78);
  --control: rgba(255, 255, 255, 0.76);
  --tooltip: #1d1d1f;
  --tooltip-text: #f5f5f7;
  --focus: rgba(0, 102, 204, 0.35);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --body: #111214;
  --soft: rgba(26, 28, 32, 0.9);
  --panel: rgba(32, 34, 39, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --blue: #2997ff;
  --blue-hover: #63b3ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --header: rgba(17, 18, 20, 0.78);
  --header-line: rgba(255, 255, 255, 0.08);
  --hero-background: linear-gradient(145deg, rgba(45, 48, 54, 0.82), rgba(25, 28, 33, 0.74) 58%, rgba(38, 41, 47, 0.82));
  --hero-base: rgba(34, 37, 42, 0.76);
  --hero-subtitle: #c8c8cd;
  --glow-one: radial-gradient(circle, rgba(151, 165, 188, 0.36) 0, rgba(65, 75, 90, 0.28) 44%, rgba(32, 35, 40, 0) 72%);
  --glow-two: radial-gradient(circle, rgba(180, 190, 207, 0.2) 0, rgba(64, 72, 84, 0.16) 46%, rgba(32, 35, 40, 0) 72%);
  --dock: rgba(19, 21, 24, 0.5);
  --dock-border: rgba(255, 255, 255, 0.1);
  --dock-item: rgba(255, 255, 255, 0.06);
  --dock-item-hover: rgba(255, 255, 255, 0.1);
  --card: rgba(32, 34, 39, 0.78);
  --solid-card: rgba(34, 36, 41, 0.84);
  --card-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  --feature-background: radial-gradient(circle at 78% 18%, rgba(92, 105, 124, 0.5), rgba(35, 38, 43, 0) 38%), rgba(32, 34, 39, 0.86);
  --contact-background: radial-gradient(circle at 88% 18%, rgba(92, 105, 124, 0.44), rgba(35, 38, 43, 0) 44%), rgba(32, 34, 39, 0.86);
  --control: rgba(42, 45, 51, 0.88);
  --tooltip: #f5f5f7;
  --tooltip-text: #1d1d1f;
  --focus: rgba(41, 151, 255, 0.48);
  --star-far-low: 0.28;
  --star-far-high: 0.58;
  --star-near-low: 0.48;
  --star-near-mid: 0.62;
  --star-near-high: 0.82;
  color-scheme: dark;
}

:root[data-theme="dark"].starfield-active {
  --star-far-low: 0.08;
  --star-far-high: 0.2;
  --star-near-low: 0.12;
  --star-near-mid: 0.18;
  --star-near-high: 0.28;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  color: var(--text);
  background: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  transition: color 220ms ease, background-color 220ms ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(236, 244, 255, 0.86) 0 0.9px, transparent 1.6px),
    radial-gradient(circle, rgba(209, 224, 246, 0.78) 0 0.75px, transparent 1.45px),
    radial-gradient(circle, rgba(245, 248, 255, 0.84) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(214, 230, 251, 0.76) 0 0.8px, transparent 1.5px);
  background-size: 149px 137px, 223px 197px, 307px 269px, 401px 347px;
  background-position: 17px 23px, 83px 47px, 139px 101px, 211px 163px;
}

body::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.94) 0 1.25px, transparent 2px),
    radial-gradient(circle, rgba(225, 237, 255, 0.9) 0 1.05px, transparent 1.85px),
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1.4px, transparent 2.15px);
  background-size: 281px 251px, 397px 359px, 557px 487px;
  background-position: 31px 61px, 151px 103px, 277px 211px;
}

:root[data-theme="dark"] body::before {
  animation: stars-twinkle-far 9.6s ease-in-out infinite;
}

:root[data-theme="dark"] body::after {
  animation: stars-twinkle-near 6.8s ease-in-out -2.4s infinite;
}

.starfield-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
}

.starfield-canvas[hidden] {
  display: none;
}

:root[data-theme="dark"].starfield-active .starfield-canvas {
  opacity: 1;
}

body > main,
body > .site-footer {
  position: relative;
  z-index: 1;
}

@keyframes stars-twinkle-far {
  0%,
  100% {
    opacity: var(--star-far-low);
    filter: brightness(0.78) drop-shadow(0 0 1px rgba(210, 226, 250, 0.3));
  }

  50% {
    opacity: var(--star-far-high);
    filter: brightness(1.3) drop-shadow(0 0 1.5px rgba(220, 234, 255, 0.42));
  }
}

@keyframes stars-twinkle-near {
  0%,
  100% {
    opacity: var(--star-near-low);
    filter: brightness(0.82) drop-shadow(0 0 1.5px rgba(225, 237, 255, 0.38));
  }

  42% {
    opacity: var(--star-near-high);
    filter: brightness(1.42) drop-shadow(0 0 2px rgba(235, 244, 255, 0.5));
  }

  72% {
    opacity: var(--star-near-mid);
    filter: brightness(0.96) drop-shadow(0 0 1.5px rgba(225, 237, 255, 0.4));
  }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
  backdrop-filter: saturate(180%) blur(18px);
}

.nav {
  width: min(1080px, calc(100% - 32px));
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active {
  font-weight: 600;
}

.icon-button,
.scroll-top {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--control);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.icon-button {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.js .icon-button {
  display: inline-flex;
}

.icon-button svg,
.scroll-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button:hover,
.scroll-top:hover {
  background: var(--dock-item-hover);
}

.icon-button:focus-visible,
.scroll-top:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 20;
  width: max-content;
  max-width: 160px;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--tooltip-text);
  background: var(--tooltip);
  box-shadow: var(--card-shadow);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.icon-sun {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

.hero {
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 84px);
  margin: 16px auto 0;
  padding: 72px 40px 34px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.hero-silver {
  background: var(--hero-background), var(--hero-base);
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-glow-one {
  right: -90px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  background: var(--glow-one);
}

.hero-glow-two {
  left: 12%;
  top: 18%;
  width: 220px;
  height: 220px;
  background: var(--glow-two);
}

.hero-content {
  position: relative;
  text-align: center;
  margin: auto 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-size: 72px;
  line-height: 1.02;
  font-weight: 750;
}

.hero-subtitle {
  margin: 14px auto 0;
  color: var(--hero-subtitle);
  font-size: 24px;
  line-height: 1.38;
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--blue);
  font-size: 16px;
}

.hero-actions a,
.section-link,
.card-link,
.project-card a,
.site-footer a {
  color: var(--blue);
}

.hero-actions a {
  padding: 4px 0;
  transition: color 180ms ease, transform 180ms ease;
}

.hero-actions a:hover {
  transform: translateY(-1px);
}

.hero-actions a:hover,
.section-link:hover,
.card-link:hover,
.project-card a:hover,
.site-footer a:hover {
  color: var(--blue-hover);
}

.hero-dock {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--dock-border);
  border-radius: 18px;
  background: var(--dock);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(18px);
}

.hero-dock a {
  min-height: 92px;
  padding: 18px;
  border-radius: 14px;
  background: var(--dock-item);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 180ms ease, background 180ms ease;
}

.hero-dock a:hover {
  transform: translateY(-3px);
  background: var(--dock-item-hover);
}

.hero-dock span,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.hero-dock strong {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.32;
}

.section {
  width: min(1080px, calc(100% - 32px));
  margin: 96px auto;
}

.compact-section {
  margin-top: 48px;
}

.section-soft {
  width: 100%;
  padding: 84px max(16px, calc((100% - 1080px) / 2));
  background: var(--soft);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 28px;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -6px;
}

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

.section h2 {
  font-size: 40px;
  line-height: 1.12;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.feature-card,
.list-card,
.project-card,
.glass-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.feature-card,
.list-card,
.project-card,
.project-strip article,
.article-pagination a,
.hero-dock a {
  position: relative;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.feature-card::before,
.list-card::before,
.project-card::before,
.project-strip article::before,
.article-pagination a::before,
.hero-dock a::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(255, 255, 255, 0.42), transparent 34%);
  transition: opacity 180ms ease;
}

:root[data-theme="dark"] .feature-card::before,
:root[data-theme="dark"] .list-card::before,
:root[data-theme="dark"] .project-card::before,
:root[data-theme="dark"] .project-strip article::before,
:root[data-theme="dark"] .article-pagination a::before,
:root[data-theme="dark"] .hero-dock a::before {
  background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(185, 213, 255, 0.16), transparent 36%);
}

.feature-card:hover,
.list-card:hover,
.project-card:hover,
.project-strip article:hover,
.article-pagination a:hover {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  transform: translateY(-3px);
  box-shadow: 0 22px 58px rgba(29, 29, 31, 0.11);
}

:root[data-theme="dark"] .feature-card:hover,
:root[data-theme="dark"] .list-card:hover,
:root[data-theme="dark"] .project-card:hover,
:root[data-theme="dark"] .project-strip article:hover,
:root[data-theme="dark"] .article-pagination a:hover {
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.26);
}

.feature-card:hover::before,
.list-card:hover::before,
.project-card:hover::before,
.project-strip article:hover::before,
.article-pagination a:hover::before,
.hero-dock a:hover::before {
  opacity: 1;
}

.feature-card > *,
.list-card > *,
.project-card > *,
.project-strip article > *,
.article-pagination a > *,
.hero-dock a > * {
  position: relative;
}

.feature-card {
  min-height: 220px;
  padding: 28px;
}

.card-link {
  display: inline-flex;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease, transform 180ms ease;
}

.feature-card:hover .card-link,
.list-card:hover .card-link {
  transform: translateX(2px);
}

.feature-card-large {
  grid-row: span 2;
  min-height: 456px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--feature-background);
}

.feature-card h3,
.project-strip h3,
.list-card h2,
.project-card h2,
.glass-panel h2 {
  margin: 10px 0 10px;
  font-size: 24px;
  line-height: 1.2;
}

.feature-card p,
.project-strip p,
.list-card p,
.project-card p,
.glass-panel p,
.about-preview p,
.page-hero p {
  color: var(--muted);
  line-height: 1.72;
}

.project-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.project-strip article {
  min-height: 230px;
  padding: 28px;
  border-radius: 18px;
  background: var(--solid-card);
}

.project-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.about-preview {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 28px;
  align-items: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 15px;
  transition: background 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.button-link:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
}

.page-hero {
  width: min(920px, calc(100% - 32px));
  margin: 88px auto 0;
  text-align: center;
}

.page-hero p {
  max-width: 680px;
  margin: 18px auto 0;
  font-size: 18px;
}

.post-controls {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.search-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--card-shadow);
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.search-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--focus);
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.category-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--control);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.category-chip:hover,
.category-chip.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 36%, var(--line));
  background: var(--dock-item-hover);
}

.category-chip:hover {
  transform: translateY(-1px);
}

.empty-posts {
  margin-top: 28px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.empty-posts p {
  margin: 0 0 18px;
  color: var(--muted);
}

.list-grid,
.project-grid,
.about-layout {
  display: grid;
  gap: 16px;
}

.list-card,
.project-card,
.glass-panel {
  padding: 28px;
}

.list-card h2,
.project-card h2 {
  font-size: 28px;
}

.project-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.project-card a {
  margin-top: auto;
  font-size: 15px;
}

.about-hero {
  max-width: 860px;
}

.about-layout {
  grid-template-columns: repeat(3, 1fr);
}

.plain-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

.contact-panel {
  background: var(--contact-background);
}

.not-found {
  min-height: calc(100vh - 132px);
  display: grid;
  place-items: center;
}

.not-found .button-link {
  margin-top: 26px;
}

.article-page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--blue);
  box-shadow: 0 0 12px color-mix(in srgb, var(--blue) 55%, transparent);
}

.article-hero {
  max-width: 820px;
  margin: 88px auto 64px;
  text-align: center;
}

.article-back {
  display: inline-flex;
  margin-bottom: 32px;
  color: var(--blue);
  font-size: 14px;
}

.article-hero h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.08;
}

.article-summary {
  max-width: 680px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.7;
}

.article-meta {
  margin: 20px 0 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 720px);
  justify-content: center;
  gap: 48px;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 84px;
  padding: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.article-toc > p {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 700;
}

.article-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc li + li {
  margin-top: 9px;
}

.article-toc .toc-level-3 {
  padding-left: 12px;
}

.article-toc a:hover {
  color: var(--text);
}

.article-toc a.active {
  color: var(--blue);
  font-weight: 700;
}

.article-content {
  min-width: 0;
  padding: 44px 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  font-size: 17px;
  line-height: 1.9;
}

.article-content h2,
.article-content h3 {
  scroll-margin-top: 84px;
  line-height: 1.3;
}

.article-content h2 {
  margin: 2.4em 0 0.8em;
  font-size: 30px;
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  margin: 2em 0 0.7em;
  font-size: 22px;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin: 1.15em 0;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5em;
}

.article-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--blue);
  color: var(--muted);
}

.article-content blockquote p {
  margin: 0;
}

.code-block {
  position: relative;
  margin: 1.6em 0;
}

.article-content pre {
  max-width: 100%;
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: 14px;
  line-height: 1.65;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--control);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease, background-color 160ms ease;
}

.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.code-copy:hover {
  color: var(--text);
  background: var(--dock-item-hover);
}

.article-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.article-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--soft);
  font-size: 0.9em;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 8px;
}

.article-pagination {
  max-width: 958px;
  margin: 28px auto 96px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.article-pagination a {
  min-height: 112px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.article-pagination a:last-child {
  text-align: right;
}

.article-pagination span,
.article-pagination strong {
  display: block;
}

.article-pagination span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.article-pagination strong {
  line-height: 1.45;
}

.site-footer {
  width: min(1080px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 12;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: var(--card-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top[data-tooltip]::after {
  top: auto;
  bottom: calc(100% + 9px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  body::before,
  body::after {
    animation: none;
    filter: none;
  }

  :root[data-theme="dark"] body::before {
    opacity: 0.32;
  }

  :root[data-theme="dark"] body::after {
    opacity: 0.48;
  }

  .hero-actions a:hover,
  .button-link:hover,
  .hero-dock a:hover,
  .feature-card:hover,
  .list-card:hover,
  .project-card:hover,
  .project-strip article:hover,
  .article-pagination a:hover,
  .category-chip:hover,
  .feature-card:hover .card-link,
  .list-card:hover .card-link {
    transform: none;
  }

  .feature-card::before,
  .list-card::before,
  .project-card::before,
  .project-strip article::before,
  .article-pagination a::before,
  .hero-dock a::before {
    display: none;
  }

  .starfield-canvas {
    display: none;
  }
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    padding: 64px 22px 22px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 56px;
  }

  .hero-subtitle {
    font-size: 21px;
  }

  .hero-dock,
  .feature-grid,
  .post-controls,
  .project-strip,
  .project-grid,
  .about-layout,
  .about-preview {
    grid-template-columns: 1fr;
  }

  .feature-card-large {
    min-height: 300px;
  }

  .section {
    margin: 72px auto;
  }

  .section-soft {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .article-layout {
    grid-template-columns: minmax(0, 720px);
  }

  .article-aside {
    display: none;
  }
}

@media (max-width: 720px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-hero {
    margin-top: 64px;
  }

  .article-hero h1 {
    font-size: 42px;
  }

  .article-summary {
    font-size: 17px;
  }

  .article-content {
    padding: 30px 24px;
    font-size: 16px;
  }

  .article-pagination {
    grid-template-columns: 1fr;
  }

  .article-pagination > span {
    display: none;
  }

  .article-pagination a:last-child {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .nav {
    min-height: 58px;
    gap: 14px;
  }

  .nav-links {
    gap: 13px;
    font-size: 13px;
  }

  .hero {
    width: calc(100% - 20px);
    margin-top: 10px;
    border-radius: 14px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 44px;
  }

  .hero-subtitle {
    font-size: 19px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .hero-dock a {
    min-height: 82px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .category-filter {
    justify-content: flex-start;
  }

  .section h2 {
    font-size: 32px;
  }

  .page-hero {
    margin-top: 64px;
  }

  .page-hero p {
    font-size: 16px;
  }

  .feature-card,
  .list-card,
  .project-card,
  .glass-panel,
  .project-strip article {
    padding: 22px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

.scroll-top {
  right: 14px;
  bottom: 14px;
}
}

.admin-form {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  box-shadow: var(--shadow-soft);
}

.admin-form textarea {
  resize: vertical;
  line-height: 1.7;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.admin-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.admin-check input {
  width: auto;
  box-shadow: none;
}
