:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: rgba(12, 18, 27, 0.78);
  --line: rgba(148, 163, 184, 0.2);
  --text: #e8eef8;
  --muted: #9eacbd;
  --soft: #c9d4e3;
  --cyan: #22d3ee;
  --green: #7ddc8a;
  --amber: #f7c873;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.12), transparent 28rem),
    linear-gradient(180deg, #070a0f 0%, #0a0e14 48%, #090b10 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, rgba(0, 0, 0, 0.45), transparent);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 10, 15, 0.78);
  backdrop-filter: blur(18px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  max-width: var(--max);
  min-height: 68px;
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

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

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.nav-links a {
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

.page-hero {
  width: calc(100% - 32px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 78px 0 42px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 18px;
  padding: 6px 10px;
  border: 1px solid rgba(125, 220, 138, 0.28);
  border-radius: 999px;
  color: var(--green);
  background: rgba(125, 220, 138, 0.08);
  font: 700 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-copy {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: clamp(17px, 2vw, 21px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
  font-weight: 750;
}

.button.primary {
  border-color: rgba(34, 211, 238, 0.52);
  color: #021016;
  background: var(--cyan);
}

.section {
  width: calc(100% - 32px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 0 76px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.08;
}

.section-head p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.card {
  display: flex;
  min-height: 154px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: var(--panel);
  flex-direction: column;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(14, 22, 33, 0.9);
}

.card-kicker {
  color: var(--green);
  font: 700 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.card h3 {
  margin: 16px 0 8px;
  font-size: 22px;
  line-height: 1.25;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card strong {
  margin-top: auto;
  padding-top: 18px;
  color: var(--cyan);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(12, 18, 27, 0.74);
}

.tag-pill.featured {
  border-color: rgba(34, 211, 238, 0.34);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}

.timeline {
  display: grid;
  gap: 14px;
}

.year-block {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(12, 18, 27, 0.7);
}

.year-block h2 {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post-row {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  grid-template-columns: 112px minmax(0, 1fr);
}

.post-row time {
  color: var(--muted);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post-row a {
  color: var(--text);
  font-weight: 750;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-row a:hover {
  color: var(--cyan);
}

.article-shell {
  width: calc(100% - 32px);
  max-width: 920px;
  margin: 0 auto;
  padding: 58px 0 88px;
}

.article-hero {
  padding: 54px 0 34px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  color: var(--muted);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article-meta a {
  color: var(--cyan);
}

.article-content {
  max-width: 100%;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(12, 18, 27, 0.72);
}

.article-content,
.article-content p,
.article-content li {
  color: var(--soft);
  font-size: 17px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-content p {
  width: min(calc(100vw - 120px), 62ch);
  max-width: 100%;
  margin: 0 0 18px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 34px 0 14px;
  color: var(--text);
  line-height: 1.28;
}

.article-content h1 {
  font-size: 34px;
}

.article-content h2 {
  font-size: 28px;
}

.article-content h3 {
  font-size: 22px;
}

.article-content a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(34, 211, 238, 0.28);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px;
  padding-left: 1.45em;
}

.article-content li + li {
  margin-top: 8px;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 22px auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: #101722;
}

.article-content blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--cyan);
  color: var(--soft);
  background: rgba(34, 211, 238, 0.08);
}

.article-content code {
  padding: 0.12em 0.35em;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  color: var(--amber);
  background: rgba(3, 7, 18, 0.65);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.article-content pre,
.article-content figure.highlight {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: #05080d;
}

.article-content pre code,
.article-content figure.highlight code {
  padding: 0;
  border: 0;
  background: transparent;
}

.article-content figure.highlight table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
}

.article-content figure.highlight .gutter {
  width: 42px;
  padding-right: 12px;
  color: #64748b;
  user-select: none;
}

.article-content figure.highlight .code {
  max-width: 100%;
}

.article-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.article-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
}

.article-nav a {
  flex: 1;
  min-height: 64px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(12, 18, 27, 0.72);
}

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

.about-panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(12, 18, 27, 0.72);
  grid-template-columns: minmax(0, 1fr) 260px;
}

.about-panel p {
  margin: 0 0 14px;
  color: var(--soft);
}

.profile-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: #101722;
}

.profile-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.profile-card div {
  padding: 16px;
  color: var(--muted);
}

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: #06080c;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  max-width: var(--max);
  min-height: 104px;
  margin: 0 auto;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--soft);
}

@media (max-width: 900px) {
  .grid.cols-2,
  .grid.cols-3,
  .about-panel {
    grid-template-columns: 1fr;
  }

  .profile-card {
    max-width: 320px;
  }
}

@media (max-width: 720px) {
  .nav-inner {
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .page-hero {
    padding-top: 48px;
  }

  .nav-inner,
  .page-hero,
  .section,
  .article-shell,
  .footer-inner {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
  }

  .article-content {
    width: 100%;
    max-width: 100%;
  }

  .article-content > * {
    max-width: calc(100vw - 72px);
  }

  .article-content p,
  .article-content li,
  .article-content h1,
  .article-content h2,
  .article-content h3,
  .article-content h4,
  .article-content h5,
  .article-content h6 {
    max-width: calc(100vw - 120px);
  }

  .article-content p {
    width: 270px !important;
    max-width: 270px !important;
  }

  .article-content pre,
  .article-content figure.highlight,
  .article-content table {
    width: calc(100vw - 72px);
    max-width: calc(100vw - 72px);
  }

  h1 {
    font-size: clamp(31px, 9vw, 36px);
    line-height: 1.08;
    word-break: break-all;
  }

  .hero-copy,
  .section-head p {
    width: 100%;
    max-width: 100%;
    word-break: break-all;
  }

  .hero-actions,
  .section-head,
  .footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

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

  .article-shell {
    padding-top: 30px;
  }

  .article-content {
    padding: 20px;
  }

  .article-content,
  .article-content p,
  .article-content li,
  .article-content a {
    font-size: 16px;
    word-break: break-all;
  }

  .article-content h1 {
    font-size: 28px;
  }

  .article-content h2 {
    font-size: 23px;
  }

  .article-nav {
    flex-direction: column;
  }

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