:root {
  --bg: #edf3fb;
  --bg-soft: #e5eef9;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --panel-blue: #eef5ff;
  --text: #16304f;
  --muted: #5d7494;
  --line: rgba(47, 107, 255, 0.14);
  --line-strong: rgba(47, 107, 255, 0.28);
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.08);
  --shadow: 0 18px 48px rgba(47, 107, 255, 0.08);
  --header-bg: rgba(237, 243, 251, 0.82);
  --nav-bg: rgba(255, 255, 255, 0.76);
  --terminal-bg: rgba(255, 255, 255, 0.76);
  --profile-frame-bg: #d9e7f8;
  --chip-bg: #ffffff;
  --cover-base: #e3edf9;
  --cover-dark: #dce9fb;
  --cover-light: #edf4ff;
  --cover-outline: rgba(255, 255, 255, 0.42);
  --button-on-accent: #ffffff;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: min(1120px, calc(100vw - 32px));
}

[data-theme="dark"] {
  --bg: #081321;
  --bg-soft: #0d1a2c;
  --panel: #0f1d30;
  --panel-soft: #112338;
  --panel-blue: #122944;
  --text: #e8f0ff;
  --muted: #9fb3d1;
  --line: rgba(120, 162, 255, 0.16);
  --line-strong: rgba(120, 162, 255, 0.3);
  --accent: #79a9ff;
  --accent-soft: rgba(121, 169, 255, 0.12);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  --header-bg: rgba(8, 19, 33, 0.82);
  --nav-bg: rgba(15, 29, 48, 0.82);
  --terminal-bg: rgba(10, 20, 34, 0.9);
  --profile-frame-bg: #162a44;
  --chip-bg: #13253b;
  --cover-base: #17304d;
  --cover-dark: #10263f;
  --cover-light: #193252;
  --cover-outline: rgba(121, 169, 255, 0.28);
  --button-on-accent: #081321;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(circle at top left, rgba(47, 107, 255, 0.12), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(47, 107, 255, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 22%);
  color: var(--text);
  font-family: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.page-shell {
  position: relative;
  overflow: clip;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
  background-image:
    linear-gradient(to right, transparent 0, transparent calc(100% - 1px), var(--line) calc(100% - 1px)),
    linear-gradient(to bottom, transparent 0, transparent calc(100% - 1px), var(--line) calc(100% - 1px));
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
  animation: grid-drift 20s linear infinite;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.section {
  padding: 34px 0;
}

.section-last {
  padding-bottom: 92px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 0 8px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav,
.brand,
.nav-links,
.hero-actions,
.hero-lines,
.section-heading,
.section-tags,
.panel-head,
.profile-meta,
.footer-row,
.footer-links,
.terminal-top,
.terminal-body p {
  display: flex;
  align-items: center;
}

.nav {
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--nav-bg);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  animation: nav-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-header.is-scrolled .nav {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.brand {
  position: relative;
  overflow: hidden;
  gap: 10px;
  transform-style: preserve-3d;
  will-change: transform;
}

.brand::before,
.nav-links a::before,
.button::before,
.theme-toggle::before,
.section-tags span::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  background: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(47, 107, 255, 0.18), rgba(47, 107, 255, 0) 40%);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: badge-float 3.8s ease-in-out infinite;
}

.brand-copy,
.eyebrow,
.nav-links a,
.hero-lines span,
.terminal-top,
.terminal-body p,
.panel-label,
.panel-index,
.article-meta,
.work-meta,
.stack-key,
.section-tags span,
.footer-row p,
.footer-links a,
.article-back {
  font-family: "IBM Plex Mono", monospace;
}

.brand-copy {
  font-size: 0.86rem;
  font-weight: 600;
}

.nav-links {
  gap: 6px;
}

.nav-links a {
  position: relative;
  overflow: hidden;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
  animation: nav-fade 700ms ease backwards;
  transform-style: preserve-3d;
  will-change: transform;
}

.nav-links a:nth-child(1) {
  animation-delay: 100ms;
}

.nav-links a:nth-child(2) {
  animation-delay: 160ms;
}

.nav-links a:nth-child(3) {
  animation-delay: 220ms;
}

.nav-links a:nth-child(4) {
  animation-delay: 280ms;
}

.nav-links a.is-active {
  color: var(--accent);
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.08);
}

.hero {
  padding-top: 28px;
}

.hero-grid,
.intro-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.hero-copy,
.panel,
.profile-card,
.article-card,
.work-card,
.stack-item,
.article-block,
.article-quote,
.article-stage,
.article-note {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy,
.panel,
.profile-card,
.article-block,
.article-quote,
.article-note {
  border-radius: var(--radius-xl);
}

.hero-copy {
  position: relative;
  display: grid;
  align-content: end;
  padding: 34px;
  min-height: 560px;
  background: var(--panel-blue);
  isolation: isolate;
}

.hero-copy::before,
.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}

.hero-copy::before {
  top: 28px;
  right: 28px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.18), rgba(47, 107, 255, 0));
  transform: translate3d(calc(var(--hero-shift-x, 0) * 1px), calc(var(--hero-shift-y, 0) * 1px), 0);
  animation: pulse-orb 6s ease-in-out infinite;
}

.hero-copy::after {
  left: -40px;
  bottom: 80px;
  width: 120px;
  height: 120px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: float-orb 7.5s ease-in-out infinite;
}

.hero-copy h1,
.section-heading h2,
.profile-meta h2,
.intro-lead,
.article-card h3,
.work-copy h3,
.article-title,
.article-block h2,
.article-stage h2,
.article-quote h2 {
  margin: 0;
  letter-spacing: -0.05em;
}

.hero-copy h1 {
  max-width: 8ch;
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 0.92;
  text-shadow: 0 10px 34px rgba(47, 107, 255, 0.1);
}

.hero-text,
.section-text,
.profile-meta p,
.article-card p,
.intro-note,
.article-summary,
.article-block p,
.article-stage p,
.article-note p {
  color: var(--muted);
}

.hero-text {
  margin: 16px 0 0;
  font-size: 0.95rem;
}

.hero-actions {
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: lowercase;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

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

.button::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -120%;
  width: 60%;
  background: rgba(255, 255, 255, 0.2);
  transform: skewX(-20deg);
  transition: transform 420ms ease;
}

.button:hover::after {
  transform: translateX(260%) skewX(-20deg);
}

.button-primary {
  background: var(--accent);
  color: var(--button-on-accent);
  border-color: var(--accent);
}

.button-primary:hover {
  box-shadow: 0 14px 30px rgba(47, 107, 255, 0.18);
}

.button-secondary {
  background: var(--panel);
  color: var(--accent);
}

.hero-lines {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.hero-lines span {
  color: var(--muted);
  font-size: 0.76rem;
  transition: transform 220ms ease, color 220ms ease;
}

.hero-terminal {
  position: relative;
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--terminal-bg);
  overflow: hidden;
}

.hero-terminal::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 44%;
  opacity: 0.44;
  background: linear-gradient(180deg, rgba(47, 107, 255, 0), rgba(47, 107, 255, 0.12), rgba(47, 107, 255, 0));
  animation: terminal-scan 4.8s linear infinite;
  pointer-events: none;
}

.hero-terminal::after,
.work-card::before,
.stack-item::before,
.profile-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 34%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.terminal-top,
.terminal-body p {
  justify-content: space-between;
  gap: 12px;
}

.terminal-top {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  margin-right: auto;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: dot-blink 1.8s ease-in-out infinite;
}

.terminal-body {
  position: relative;
  padding: 10px 14px 12px;
}

.terminal-body p {
  margin: 0;
  padding: 7px 0;
  color: var(--text);
  font-size: 0.75rem;
}

.terminal-key {
  color: var(--accent);
}

.terminal-body p span:last-child {
  position: relative;
}

.terminal-body p:last-child span:last-child::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.96em;
  margin-left: 0.32em;
  vertical-align: -0.08em;
  background: currentColor;
  animation: terminal-caret 1s steps(1) infinite;
}

.profile-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 18px;
  min-height: 560px;
  background: var(--panel-soft);
  overflow: hidden;
}

.profile-frame {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--profile-frame-bg);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  animation: portrait-drift 12s ease-in-out infinite;
}

.profile-meta {
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.profile-meta h2 {
  font-size: 1.4rem;
  line-height: 1;
}

.profile-meta p {
  margin: 0;
  font-size: 0.82rem;
  text-align: right;
}

.section-heading {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  position: relative;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1;
}

.section-text {
  margin: 0;
  max-width: 260px;
  font-size: 0.88rem;
}

.section-tags {
  gap: 8px;
  margin-left: auto;
}

.hero-lines span,
.section-tags span,
.panel-label,
.panel-index,
.article-meta,
.work-meta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: transform;
}

.section-tags span {
  animation: chip-pop 700ms ease backwards;
}

.section-tags span:nth-child(1) {
  animation-delay: 120ms;
}

.section-tags span:nth-child(2) {
  animation-delay: 180ms;
}

.panel-head {
  justify-content: space-between;
  gap: 8px;
}

.intro-grid {
  align-items: stretch;
}

.panel {
  padding: 26px;
}

.intro-panel {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.intro-lead {
  max-width: 16ch;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.04;
}

.intro-stack {
  display: grid;
  gap: 14px;
}

.stack-item {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  transition: transform 220ms ease, box-shadow 220ms ease;
  overflow: hidden;
}

.stack-key {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.stack-item strong {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

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

.article-card,
.work-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.has-curl-surface {
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

.article-card::after,
.work-card::after,
.stack-item::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% -40%;
  width: 42%;
  transform: translateX(-180%) rotate(12deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.reveal.is-visible.article-card::after,
.reveal.is-visible.work-card::after,
.reveal.is-visible.stack-item::after {
  animation: card-sheen 1s ease 240ms both;
}

.article-card {
  min-height: 230px;
  padding: 22px;
  display: grid;
  align-content: start;
}

.article-card h3 {
  margin-top: 18px;
  font-size: 1.22rem;
  line-height: 1.12;
}

.article-card p {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.work-cover {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--line);
  background: var(--cover-base);
  position: relative;
}

.work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
  transform: translate3d(var(--cover-shift-x, 0px), var(--cover-shift-y, 0px), 0) scale(1.03);
}

.work-cover::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--cover-outline);
  border-radius: 14px;
  opacity: 0;
  transform: translate3d(calc(var(--cover-shift-x, 0px) * -0.2), calc(var(--cover-shift-y, 0px) * -0.2), 0) scale(0.96);
  transition: opacity 260ms ease, transform 260ms ease;
}

.work-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(0deg, rgba(8, 19, 33, 0.18), transparent 44%);
  opacity: 0.88;
  transition: opacity 260ms ease;
}

.cover-placeholder {
  display: grid;
  place-items: center;
}

.cover-placeholder span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-dark {
  background: var(--cover-dark);
}

.cover-light {
  background: var(--cover-light);
}

.work-copy {
  padding: 18px;
}

.work-copy h3 {
  margin-top: 14px;
  font-size: 1.16rem;
  line-height: 1.12;
  transition: transform 220ms ease, color 220ms ease;
}

.site-footer {
  padding: 0 0 34px;
}

.footer-row {
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.footer-links {
  gap: 14px;
}

.footer-row p,
.footer-links a {
  color: var(--muted);
  font-size: 0.76rem;
}

.article-page {
  padding: 28px 0 72px;
  background:
    radial-gradient(circle at top right, rgba(47, 107, 255, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(220, 232, 252, 0.72), rgba(237, 243, 251, 0));
}

.article-shell {
  max-width: 980px;
}

.article-top {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.article-title {
  max-width: none;
  font-size: clamp(2.6rem, 4.5vw, 4.8rem);
  line-height: 0.93;
}

.stagger-text {
  display: inline-flex;
  flex-wrap: wrap;
}

.stagger-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  animation: char-rise 680ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 26ms);
}

.stagger-char.is-space {
  width: 0.36em;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  position: relative;
  overflow: hidden;
  color: var(--accent);
  font-size: 0.8rem;
}

.article-author {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(47, 107, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 30px rgba(20, 45, 92, 0.06);
  transform: none;
}

.article-author-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(47, 107, 255, 0.18);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.08);
}

.article-author-copy {
  display: grid;
  gap: 2px;
}

.article-author-copy strong,
.article-author-copy span {
  font-family: "IBM Plex Mono", monospace;
}

.article-author-copy strong {
  color: #17345d;
  font-size: 0.84rem;
}

.article-author-copy span {
  color: #62799a;
  font-size: 0.74rem;
}

.article-content {
  padding: 26px;
  border: 1px solid rgba(47, 107, 255, 0.18);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(232, 240, 255, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 24px 60px rgba(20, 45, 92, 0.08);
  transform: none;
}

.article-content p {
  margin: 0;
  color: #3f5573;
  font-size: 1rem;
  line-height: 1.95;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.article-date,
.article-format,
.article-loading {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
}

.article-loading {
  width: fit-content;
}

.article-prose {
  color: #3f5573;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Space Grotesk", sans-serif;
  line-break: strict;
}

.article-prose > :first-child {
  margin-top: 0;
}

.article-prose > :last-child {
  margin-bottom: 0;
}

.article-prose h2,
.article-prose h3,
.article-prose h4 {
  margin: 2.2em 0 0.7em;
  color: #13294a;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.article-prose h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.article-prose h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
}

.article-prose h4 {
  font-size: 1rem;
}

.article-prose p,
.article-prose ul,
.article-prose ol,
.article-prose pre,
.article-prose blockquote {
  margin: 1.1em 0 0;
}

.article-prose p,
.article-prose li {
  color: #3f5573;
  font-size: 1rem;
  line-height: 1.95;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.4rem;
}

.article-prose li + li {
  margin-top: 0.4em;
}

.article-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.18em;
}

.article-prose strong {
  color: #13294a;
}

.article-prose code {
  padding: 0.14em 0.4em;
  border: 1px solid rgba(47, 107, 255, 0.18);
  border-radius: 8px;
  background: rgba(47, 107, 255, 0.08);
  color: #1848b8;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
}

.article-prose pre {
  position: relative;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid rgba(70, 118, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #0f1b31, #121f38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.article-prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8f0ff;
  font-size: 0.92rem;
}

.article-prose blockquote {
  padding: 14px 18px;
  border-left: 3px solid #2f6bff;
  border-radius: 0 18px 18px 0;
  background: rgba(47, 107, 255, 0.08);
}

.article-prose hr {
  margin: 1.8em 0;
  border: 0;
  border-top: 1px solid rgba(47, 107, 255, 0.18);
}

.article-math {
  margin: 0.9em 0 0;
  overflow-x: auto;
  padding: 4px 0;
}

.article-prose .MathJax {
  font-size: 1.08rem !important;
}

.article-math .MathJax {
  font-size: 1.22rem !important;
}

.article-math mjx-container[display="true"] {
  margin: 0.35em 0 !important;
}

.article-prose .hljs {
  display: block;
  background: transparent;
  color: #dfe9ff;
}

.article-prose .hljs-keyword,
.article-prose .hljs-selector-tag,
.article-prose .hljs-literal,
.article-prose .hljs-type {
  color: #8fb8ff;
}

.article-prose .hljs-title,
.article-prose .hljs-title.function_,
.article-prose .hljs-function .hljs-title {
  color: #f5f8ff;
}

.article-prose .hljs-string,
.article-prose .hljs-regexp,
.article-prose .hljs-number {
  color: #ffd38a;
}

.article-prose .hljs-comment,
.article-prose .hljs-quote {
  color: #7d91b4;
}

.article-prose .hljs-variable,
.article-prose .hljs-attr,
.article-prose .hljs-params {
  color: #bdd3ff;
}

[data-theme="dark"] .article-page {
  background:
    radial-gradient(circle at top right, rgba(121, 169, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(6, 16, 29, 0.72), rgba(8, 19, 33, 0));
}

[data-theme="dark"] .article-author {
  border-color: rgba(121, 169, 255, 0.18);
  background: rgba(15, 29, 48, 0.84);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .article-author-avatar {
  border-color: rgba(121, 169, 255, 0.24);
  box-shadow: 0 0 0 4px rgba(121, 169, 255, 0.1);
}

[data-theme="dark"] .article-author-copy strong {
  color: #edf4ff;
}

[data-theme="dark"] .article-author-copy span {
  color: #97acd0;
}

[data-theme="dark"] .article-content {
  border-color: rgba(121, 169, 255, 0.14);
  background: linear-gradient(180deg, rgba(13, 27, 45, 0.96), rgba(9, 20, 34, 0.98));
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .article-content p,
[data-theme="dark"] .article-prose,
[data-theme="dark"] .article-prose p,
[data-theme="dark"] .article-prose li {
  color: #b3c5e2;
}

[data-theme="dark"] .article-prose h2,
[data-theme="dark"] .article-prose h3,
[data-theme="dark"] .article-prose h4,
[data-theme="dark"] .article-prose strong {
  color: #edf4ff;
}

[data-theme="dark"] .article-date,
[data-theme="dark"] .article-format,
[data-theme="dark"] .article-loading {
  border-color: rgba(121, 169, 255, 0.16);
  background: rgba(19, 37, 59, 0.86);
  color: #8fb8ff;
}

[data-theme="dark"] .article-prose a {
  color: #8fb8ff;
}

[data-theme="dark"] .article-prose code {
  border-color: rgba(121, 169, 255, 0.16);
  background: rgba(121, 169, 255, 0.12);
  color: #b8d0ff;
}

[data-theme="dark"] .article-prose pre {
  border-color: rgba(121, 169, 255, 0.16);
  background: linear-gradient(180deg, #091425, #0e1b32);
}

[data-theme="dark"] .article-prose blockquote {
  border-left-color: #79a9ff;
  background: rgba(121, 169, 255, 0.1);
}

[data-theme="dark"] .article-prose hr {
  border-top-color: rgba(121, 169, 255, 0.16);
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--nav-bg);
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.has-press-feedback {
  -webkit-tap-highlight-color: transparent;
}

.has-press-feedback.is-pressed {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(47, 107, 255, 0.28),
    inset 0 -1px 0 rgba(47, 107, 255, 0.28),
    0 0 0 1px rgba(47, 107, 255, 0.14);
}

[data-theme="dark"] .has-press-feedback.is-pressed {
  border-color: rgba(121, 169, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(121, 169, 255, 0.36),
    inset 0 -1px 0 rgba(121, 169, 255, 0.36),
    0 0 0 1px rgba(121, 169, 255, 0.16);
}

[data-theme="dark"] .brand::before,
[data-theme="dark"] .nav-links a::before,
[data-theme="dark"] .button::before,
[data-theme="dark"] .theme-toggle::before,
[data-theme="dark"] .section-tags span::before {
  background: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(121, 169, 255, 0.22), rgba(121, 169, 255, 0) 42%);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.theme-toggle-label,
.theme-toggle-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
}

.theme-toggle-value {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.collapse-reveal.reveal {
  transform: perspective(1200px) rotateX(-14deg) translateY(22px) scaleY(0.76) scaleX(0.98);
  transform-origin: top center;
  transition:
    opacity 760ms ease,
    transform 760ms cubic-bezier(0.18, 0.82, 0.2, 1);
}

.reveal-delay {
  transition-delay: 120ms;
}

.reveal-delay-2 {
  transition-delay: 220ms;
}

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

.collapse-reveal.reveal.is-visible {
  transform: perspective(1200px) rotateX(0deg) translateY(0) scaleY(1) scaleX(1);
}

.intro-stack.collapse-reveal .stack-item {
  opacity: 0;
  transform: translateY(18px) scaleY(0.8);
  transform-origin: top center;
  transition:
    opacity 560ms ease,
    transform 560ms cubic-bezier(0.18, 0.82, 0.2, 1);
}

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

.intro-stack.collapse-reveal.is-visible .stack-item:nth-child(1) {
  transition-delay: 90ms;
}

.intro-stack.collapse-reveal.is-visible .stack-item:nth-child(2) {
  transition-delay: 170ms;
}

.intro-stack.collapse-reveal.is-visible .stack-item:nth-child(3) {
  transition-delay: 250ms;
}

@keyframes grid-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, 72px, 0);
  }
}

@keyframes badge-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes pulse-orb {
  0%,
  100% {
    transform: translate3d(calc(var(--hero-shift-x, 0) * 1px), calc(var(--hero-shift-y, 0) * 1px), 0) scale(0.94);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(calc(var(--hero-shift-x, 0) * 1px), calc(var(--hero-shift-y, 0) * 1px), 0) scale(1.08);
    opacity: 1;
  }
}

@keyframes terminal-scan {
  from {
    transform: translateY(-130%);
  }
  to {
    transform: translateY(360%);
  }
}

@keyframes terminal-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes card-sheen {
  from {
    transform: translateX(-180%) rotate(12deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  to {
    transform: translateX(420%) rotate(12deg);
    opacity: 0;
  }
}

@keyframes portrait-drift {
  0%,
  100% {
    transform: scale(1.01) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.06) translate3d(0, -6px, 0);
  }
}

@keyframes float-orb {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(12px, -10px, 0) rotate(8deg);
  }
}

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

@keyframes nav-fade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dot-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

@keyframes chip-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes char-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .intro-grid,
  .articles-grid,
  .works-grid,
  .article-layout-home,
  .article-layout-split,
  .article-layout-flow {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .hero-copy,
  .profile-card {
    min-height: auto;
  }

  .article-quote {
    position: static;
  }
}

@media (max-width: 720px) {
  :root {
    --container: min(1120px, calc(100vw - 24px));
  }

  .nav,
  .hero-actions,
  .profile-meta,
  .footer-row,
  .footer-links {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header {
    padding: 10px 0 6px;
  }

  .nav {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    padding: 12px;
    gap: 12px;
    border-radius: 18px;
  }

  .brand {
    width: auto;
    align-self: flex-start;
    justify-content: flex-start;
  }

  .nav-links a {
    min-height: 40px;
    padding: 10px 12px;
    justify-content: center;
    text-align: center;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    align-items: stretch;
  }

  .hero {
    padding-top: 18px;
  }

  .section {
    padding: 28px 0;
  }

  .hero-copy,
  .profile-card,
  .panel,
  .article-content {
    padding: 22px;
  }

  .hero-copy::before {
    top: 18px;
    right: -18px;
    width: 120px;
    height: 120px;
  }

  .hero-copy::after {
    left: auto;
    right: 16px;
    bottom: 18px;
    width: 72px;
    height: 72px;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 15vw, 4rem);
  }

  .button {
    width: 100%;
  }

  .terminal-top,
  .terminal-body p,
  .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .terminal-body p {
    gap: 4px 10px;
  }

  .terminal-top {
    gap: 8px;
  }

  .terminal-dot {
    margin-right: 0;
  }

  .work-copy,
  .article-card,
  .article-content {
    padding: 16px;
  }

  .article-author {
    width: 100%;
    border-radius: 20px;
  }

  .article-prose h2 {
    margin-top: 1.8em;
  }

  .article-prose p,
  .article-prose li {
    font-size: 0.96rem;
  }

  .article-prose .MathJax {
    font-size: 1.02rem !important;
  }

  .article-math .MathJax {
    font-size: 1.12rem !important;
  }

  .profile-meta p {
    text-align: left;
  }

  .section-tags {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .theme-toggle {
    top: auto;
    right: 16px;
    bottom: 16px;
    min-height: 40px;
    padding: 0 10px;
  }

  .grid-overlay {
    background-size: 48px 48px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .has-curl-surface.is-curling {
    box-shadow:
      0 28px 56px rgba(47, 107, 255, 0.14),
      0 14px 30px rgba(8, 19, 33, 0.08);
  }

  [data-theme="dark"] .has-curl-surface.is-curling {
    box-shadow:
      0 28px 56px rgba(121, 169, 255, 0.18),
      0 18px 36px rgba(0, 0, 0, 0.3);
  }

  .nav-links a:hover {
    color: var(--accent);
    border-color: var(--line);
    background: var(--panel);
    transform: translateY(-1px);
  }

  .brand:hover::before,
  .nav-links a:hover::before,
  .button:hover::before,
  .theme-toggle:hover::before,
  .section-tags span:hover::before {
    opacity: 1;
  }

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

  .hero-lines span:hover {
    color: var(--accent);
    transform: translateY(-2px);
  }

  .hero-terminal:hover::after,
  .work-card:hover::before,
  .stack-item:hover::before,
  .profile-card:hover::before {
    opacity: 1;
  }

  .profile-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(47, 107, 255, 0.12);
  }

  .section-tags span:hover,
  .panel-label:hover,
  .panel-index:hover,
  .article-meta:hover,
  .work-meta:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 10px 24px rgba(47, 107, 255, 0.1);
  }

  .stack-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(47, 107, 255, 0.12);
  }

  a.article-card:hover,
  .work-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 22px 44px rgba(47, 107, 255, 0.12);
  }

  .work-card:hover .work-cover img {
    transform: translate3d(var(--cover-shift-x, 0px), var(--cover-shift-y, 0px), 0) scale(1.1);
  }

  .work-card:hover .work-cover::after {
    opacity: 1;
    transform: scale(1);
  }

  .work-card:hover .work-cover::before {
    opacity: 1;
  }

  .work-card:hover .work-copy h3 {
    color: var(--accent);
    transform: translateX(4px);
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .stagger-char {
    opacity: 1;
    transform: none;
    animation: none;
  }

}
