/* ===== tokens ===== */
:root,
[data-theme='dark'] {
  --bg: #07090f;
  --bg-2: #0b0f17;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #0e131c;
  --panel-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf5;
  --muted: #8a94a7;
  --accent: #38e8c6;
  --accent-2: #7c8cff;
  --green: #3fe08a;
  --red: #ff5c70;
  --amber: #ffb454;
  --code-bg: #05080d;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --glow: rgba(56, 232, 198, 0.16);
  --on-accent: #04110e;
}
[data-theme='light'] {
  --bg: #f6f7fb;
  --bg-2: #eef0f6;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-solid: #ffffff;
  --panel-2: rgba(10, 20, 40, 0.05);
  --border: rgba(10, 20, 40, 0.1);
  --border-strong: rgba(10, 20, 40, 0.2);
  --text: #0c1220;
  --muted: #566074;
  --accent: #0a8f7a;
  --accent-2: #4455e0;
  --green: #17803d;
  --red: #c9253a;
  --amber: #9a6400;
  --code-bg: #f1f3f9;
  --shadow: 0 20px 50px -20px rgba(30, 40, 80, 0.25), 0 0 0 1px rgba(10, 20, 40, 0.07);
  --glow: rgba(10, 143, 122, 0.14);
  --on-accent: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mono, code, pre, kbd { font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; z-index: 200; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.t-dim { color: var(--muted); }
.t-ok { color: var(--green); }
.t-err { color: var(--red); }
.t-head { color: var(--accent-2); }
.grad { background: linear-gradient(95deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme='dark'] .only-light, [data-theme='light'] .only-dark { display: none !important; }

/* ===== chrome: progress, glow ===== */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 120; pointer-events: none; }
.cursor-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 0.4s; background: radial-gradient(520px circle at var(--gx, 50%) var(--gy, 30%), var(--glow), transparent 60%); }
.has-glow .cursor-glow { opacity: 1; }
main, .site-footer { position: relative; z-index: 1; }

/* ===== header ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { font-family: 'Fira Code', monospace; font-size: 0.93rem; color: var(--text); display: inline-flex; align-items: center; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-user { color: var(--accent); }
.brand-at, .brand-path { color: var(--muted); }
.brand-host { color: var(--accent-2); }
.cursor { display: inline-block; width: 0.55em; height: 1.05em; margin-left: 4px; background: var(--accent); vertical-align: -0.15em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { font-family: 'Fira Code', monospace; font-size: 0.85rem; color: var(--muted); padding: 7px 12px; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--text); background: var(--panel-2); }
.tools { display: flex; gap: 6px; align-items: center; }
.btn-icon { background: none; border: 1px solid transparent; color: var(--muted); height: 36px; min-width: 36px; padding: 0 8px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-family: 'Fira Code', monospace; font-size: 0.72rem; }
.btn-icon:hover { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.btn-icon kbd { border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 5px; font-size: 0.68rem; color: var(--muted); }
.icon { display: block; flex: none; }

/* ===== hero ===== */
.hero-wrap { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.hero-wrap::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background:
  radial-gradient(900px 420px at 18% 10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
  radial-gradient(800px 460px at 90% 70%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%); }
.hero-wrap::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg)); }
.hero { position: relative; z-index: 2; display: grid; grid-template-columns: 1.02fr 1fr; gap: 44px; align-items: center; padding-top: 76px; padding-bottom: 96px; min-height: min(86vh, 760px); }
.status-pill { display: inline-flex; align-items: center; gap: 9px; padding: 5px 13px 5px 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--panel); font-family: 'Fira Code', monospace; font-size: 0.74rem; color: var(--muted); backdrop-filter: blur(6px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.5rem, 6.4vw, 4.5rem); line-height: 1.02; margin: 20px 0 14px; letter-spacing: -0.035em; font-weight: 700; }
.roleline { font-family: 'Fira Code', monospace; font-size: clamp(0.95rem, 1.8vw, 1.15rem); color: var(--accent); min-height: 1.7em; margin: 0 0 16px; }
.roleline .prompt { color: var(--muted); margin-right: 8px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 58ch; margin: 0; }
.hero-meta { font-size: 0.8rem; color: var(--muted); margin: 20px 0 24px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); color: var(--text); font-weight: 500; font-size: 0.92rem; transition: transform 0.15s, border-color 0.15s, background 0.15s; backdrop-filter: blur(6px); }
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(95deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; font-family: 'Fira Code', monospace; }

.terminal { background: color-mix(in srgb, var(--code-bg) 88%, transparent); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(10px); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--panel); border-bottom: 1px solid var(--border); }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar b { margin-left: 10px; font-size: 0.76rem; color: var(--muted); font-weight: 500; }
.terminal-body { margin: 0; padding: 18px 18px 20px; font-size: 0.79rem; line-height: 1.62; overflow-x: auto; white-space: pre; min-height: 360px; }

/* ===== marquee ===== */
.marquee-wrap { position: relative; z-index: 2; padding: 22px 0; border-bottom: 1px solid var(--border); background: var(--bg); overflow: hidden; }
.marquee { display: flex; width: max-content; gap: 10px; animation: scroll 60s linear infinite; }
.marquee + .marquee { margin-top: 10px; animation-direction: reverse; animation-duration: 75s; }
.marquee-wrap:hover .marquee { animation-play-state: paused; }
.marquee-wrap::before, .marquee-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 110px; z-index: 3; pointer-events: none; }
.marquee-wrap::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee-wrap::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ===== sections ===== */
.section { padding-top: 84px; }
.section-head { margin-bottom: 30px; max-width: 62ch; }
.section-kicker { font-family: 'Fira Code', monospace; font-size: 0.8rem; color: var(--accent); margin: 0 0 8px; }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; }
.section-sub { color: var(--muted); margin: 0; }
.more { margin-top: 16px; font-size: 0.92rem; }

/* metrics */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: -1px; }
.metric { background: var(--bg-2); padding: 26px 22px; }
.metric-num { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric-label { margin-top: 8px; color: var(--muted); font-size: 0.86rem; }

/* pipeline */
.pipeline-card { border: 1px solid var(--border-strong); border-radius: 18px; background: linear-gradient(180deg, var(--panel), transparent); padding: 26px; box-shadow: var(--shadow); }
.pipeline { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pipeline::before { content: ''; position: absolute; left: 6%; right: 6%; top: 26px; height: 2px; background: var(--border-strong); z-index: 0; }
.pipeline-fill { position: absolute; left: 6%; top: 26px; height: 2px; width: 0; z-index: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.7s ease; }
.pipeline.is-fail .pipeline-fill { background: linear-gradient(90deg, var(--accent), var(--red)); }
.stage { position: relative; z-index: 1; text-align: center; }
.stage-dot { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 2px solid var(--border-strong); color: var(--muted); transition: all 0.35s; }
.stage-name { font-weight: 600; font-size: 0.88rem; line-height: 1.25; }
.stage-sub { font-family: 'Fira Code', monospace; font-size: 0.68rem; color: var(--muted); margin-top: 3px; }
.stage.is-active .stage-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); transform: scale(1.08); }
.stage.is-done .stage-dot { border-color: var(--green); color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--bg-2)); }
.stage.is-fail .stage-dot { border-color: var(--red); color: var(--red); background: color-mix(in srgb, var(--red) 12%, var(--bg-2)); box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 18%, transparent); }
.stage.is-warn .stage-dot { border-color: var(--amber); color: var(--amber); }
.pipeline-log { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--code-bg); font-family: 'Fira Code', monospace; font-size: 0.78rem; min-height: 112px; line-height: 1.7; overflow: hidden; }
.pipeline-log .l { display: block; color: var(--muted); }
.pipeline-log .l.ok { color: var(--green); }
.pipeline-log .l.bad { color: var(--red); }
.pipeline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.pipeline-note { margin-left: auto; font-size: 0.74rem; color: var(--muted); font-family: 'Fira Code', monospace; }

/* cards with spotlight */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; color: var(--text); overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
.card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%); }
.card:hover { border-color: var(--border-strong); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card h3 { margin: 14px 0 6px; font-size: 1.02rem; line-height: 1.35; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.card-link:hover { text-decoration: none; transform: translateY(-3px); }
.card-foot { margin-top: 14px !important; font-size: 0.76rem !important; }
.badge { display: inline-block; font-family: 'Fira Code', monospace; font-size: 0.66rem; font-weight: 500; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 60%, transparent); padding: 1px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }

/* stack */
.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 32px; }
.stack-group h3 { margin: 0 0 11px; font-size: 0.78rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 0.84rem; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; white-space: nowrap; }
.chip:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px -8px var(--glow); }
.chip img { display: block; }

/* posts */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row { border-top: 1px solid var(--border); }
.post-row:last-child { border-bottom: 1px solid var(--border); }
.post-link { display: grid; gap: 4px; padding: 18px 8px; color: var(--text); border-radius: 8px; transition: background 0.2s, padding 0.2s; }
.post-link:hover { text-decoration: none; background: var(--panel); padding-left: 16px; }
.post-link:hover .post-title { color: var(--accent); }
.post-meta { font-size: 0.76rem; color: var(--muted); }
.post-title { font-weight: 600; font-size: 1.06rem; transition: color 0.2s; }
.post-summary { color: var(--muted); font-size: 0.92rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-family: 'Fira Code', monospace; font-size: 0.7rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 1px 9px; border-radius: 999px; }

/* ===== inner pages ===== */
.page { padding-top: 56px; padding-bottom: 64px; max-width: 880px; }
.page h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 0 0 12px; letter-spacing: -0.03em; }
.page .section-title { margin-top: 48px; font-size: 1.1rem; font-family: 'Fira Code', monospace; font-weight: 500; }
.plain { padding-left: 20px; }
.crumb { font-size: 0.82rem; margin: 0 0 18px; }
h1 { margin-top: 0; }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 12px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; padding-top: 48px; padding-bottom: 72px; }
.book-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 40px; padding-top: 44px; padding-bottom: 72px; }
.book-layout .article-side { grid-column: 3; }
.article { min-width: 0; max-width: 760px; }
.article-side, .book-side { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }

.toc { font-size: 0.85rem; border-left: 1px solid var(--border); padding-left: 14px; }
.toc-title { margin: 0 0 8px; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 5px 0; }
.toc a { color: var(--muted); }
.toc a:hover, .toc a.active { color: var(--accent); text-decoration: none; }
.toc-l3 { padding-left: 12px; }

.side-nav ol { list-style: none; margin: 0; padding: 0; }
.side-title { font-weight: 600; margin: 0 0 8px; }
.side-title a { color: var(--text); }
.side-nav li a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 0.9rem; }
.side-nav li a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side-nav li a[aria-current='page'] { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 500; }
.num { color: var(--muted); font-size: 0.76rem; margin-right: 6px; }
.side-summary { display: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); align-items: center; gap: 8px; font-size: 0.85rem; list-style: none; }
.side-summary::-webkit-details-marker { display: none; }

.chapter-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.chapter-list a { display: flex; gap: 12px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); transition: border-color 0.2s, transform 0.2s; }
.chapter-list a:hover { border-color: var(--accent); text-decoration: none; transform: translateX(3px); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.pager a { display: grid; gap: 2px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); transition: border-color 0.2s; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .mono { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pager-next { text-align: right; grid-column: 2; }

/* prose */
.prose { font-size: 1rem; }
.prose h2 { font-size: 1.5rem; margin: 2.2em 0 0.6em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); letter-spacing: -0.015em; }
.prose h3 { font-size: 1.15rem; margin: 1.8em 0 0.5em; }
.prose h2, .prose h3 { position: relative; }
.prose .anchor { position: absolute; left: -1.1em; color: var(--muted); opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin: 0.3em 0; }
.prose :not(pre) > code { background: var(--panel-2); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 6px; font-size: 0.88em; }
.prose blockquote { margin: 1.2em 0; padding: 0.2em 1em; border-left: 3px solid var(--border-strong); color: var(--muted); }
.prose img { max-width: 100%; border-radius: 10px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.code { margin: 1.2em 0; border: 1px solid var(--border); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--border); }
.code-lang { font-family: 'Fira Code', monospace; font-size: 0.72rem; color: var(--muted); text-transform: lowercase; }
.code-copy { font-family: 'Fira Code', monospace; font-size: 0.72rem; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 2px 9px; cursor: pointer; }
.code-copy:hover { color: var(--text); border-color: var(--accent); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 0.85rem; line-height: 1.6; }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.callout { margin: 1.4em 0; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); border-left-width: 4px; background: var(--panel); }
.callout p { margin: 0.3em 0 0; color: var(--text); }
.callout-title { font-family: 'Fira Code', monospace; font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 !important; }
.callout-note { border-left-color: var(--accent-2); } .callout-note .callout-title { color: var(--accent-2); }
.callout-tip { border-left-color: var(--green); } .callout-tip .callout-title { color: var(--green); }
.callout-important { border-left-color: #b184ff; } .callout-important .callout-title { color: #b184ff; }
.callout-warning { border-left-color: var(--amber); } .callout-warning .callout-title { color: var(--amber); }

.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--panel); font-weight: 600; font-size: 0.8rem; }
tr:last-child td { border-bottom: 0; }

/* footer */
.site-footer { margin-top: 96px; border-top: 1px solid var(--border); padding: 30px 0; color: var(--muted); font-size: 0.85rem; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 16px; }
main { min-height: 60vh; }

/* palette / search */
dialog { border: 1px solid var(--border-strong); border-radius: 16px; background: color-mix(in srgb, var(--panel-solid) 94%, transparent); color: var(--text); padding: 0; width: min(640px, calc(100vw - 32px)); margin: 11vh auto auto; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
dialog::backdrop { background: rgba(2, 4, 8, 0.65); backdrop-filter: blur(3px); }
.search-box { padding: 14px; }
#search-input { width: 100%; padding: 13px 15px; font-size: 1rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-family: inherit; }
.search-results { list-style: none; margin: 10px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--text); cursor: pointer; }
.search-results a:hover, .search-results a.sel { background: var(--panel-2); text-decoration: none; }
.search-results small { display: block; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.search-hint { margin: 10px 2px 0; font-size: 0.75rem; color: var(--muted); }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 0.72rem; }

/* ===== reveal on scroll (JS adds .js) ===== */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ===== responsive ===== */
@media (max-width: 1020px) {
  .book-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .book-layout .article-side, .article-layout .article-side { display: none; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 72px; min-height: 0; }
  .terminal-body { min-height: 0; }
  .cards, .cards-2 { grid-template-columns: 1fr 1fr; }
  .stack { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: repeat(3, 1fr); row-gap: 22px; }
  .pipeline::before, .pipeline-fill { display: none; }
  .book-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .book-side { position: static; max-height: none; }
  .side-summary { display: inline-flex; }
  .side-details[open] .side-nav { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
}
@media (max-width: 560px) {
  .cards, .cards-2 { grid-template-columns: 1fr; }
  .brand-path, .brand-at, .brand-host { display: none; }
  .nav a { padding: 6px 7px; font-size: 0.8rem; }
  .header-inner { gap: 6px; }
  .btn-icon kbd { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: auto; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline-note { margin-left: 0; width: 100%; }
  .section { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee { flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee-wrap::before, .marquee-wrap::after { display: none; }
}


/* ===== home redesign ===== */
#bg-net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body.home { background: radial-gradient(1200px 600px at 15% -10%, rgba(96,165,250,0.10), transparent 60%), radial-gradient(900px 500px at 100% 10%, rgba(232,121,249,0.08), transparent 60%), var(--bg); background-attachment: fixed; }
.home .site-header { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; min-height: calc(100vh - 60px); padding-top: 48px; padding-bottom: 48px; }
.hero2-title { font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; }
.hero2-sub { color: var(--text); opacity: 0.85; font-size: 1.12rem; margin: 0 0 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 28px 40px; margin: 28px 0 30px; }
.stat-num { font-size: 2.1rem; font-weight: 600; color: var(--cyan); line-height: 1.1; }
.stat dd { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; max-width: 16ch; }
.btn-grad { background: var(--grad); border: 0; color: #fff; padding: 10px 18px; box-shadow: 0 8px 30px -10px rgba(167,139,250,0.6); }
.btn-grad:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.term { background: color-mix(in srgb, var(--code-bg) 88%, transparent); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 30px 80px -30px rgba(96,165,250,0.35); overflow: hidden; backdrop-filter: blur(8px); }
.term-body { padding: 16px 18px 4px; font-size: 0.8rem; line-height: 1.65; height: 400px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.term-body a { color: var(--accent); }
.term-line { display: flex; gap: 8px; align-items: center; padding: 4px 18px 16px; font-size: 0.8rem; }
.term-line input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; caret-color: var(--green); padding: 0; }
.term-hint { color: var(--muted); }

.section-head { margin-bottom: 22px; }
.section-h { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 6px; letter-spacing: -0.02em; }
.section-head p { margin: 0; }
.home .section { padding-top: 72px; }

.glass { background: var(--glass); border: 1px solid var(--border); border-radius: 14px; padding: 20px; backdrop-filter: blur(10px); transition: border-color .2s, transform .2s, box-shadow .2s; color: var(--text); display: block; }
.glass:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 12px 40px -18px rgba(96,165,250,0.45); transform: translateY(-2px); text-decoration: none; }
.glass h3 { margin: 12px 0 10px; font-size: 1.02rem; }
.glass-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--grad); }
.xp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.xp-grid .chip { background: color-mix(in srgb, var(--panel-2) 80%, transparent); font-size: 0.8rem; padding: 4px 10px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: grid; gap: 14px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(#60a5fa, #a78bfa, #e879f9); opacity: 0.5; border-radius: 2px; }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -28px; top: 18px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 2px solid var(--accent); color: var(--accent); }
.tl-card { margin-left: 14px; }
.tl-card h3 { margin: 0 0 6px; }
.tl-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.exp { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--glass); }
.exp-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: baseline; }
.exp-row:last-child { border-bottom: 0; }
.exp-period { color: var(--muted); font-size: 0.8rem; }
.exp-role { font-weight: 500; }
.exp-org { color: var(--accent); font-size: 0.9rem; }
.contact { text-align: center; padding-bottom: 24px; }

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.no-motion .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

@media (max-width: 960px) {
  .hero2 { grid-template-columns: 1fr; min-height: 0; }
  .xp-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .xp-grid { grid-template-columns: 1fr; }
  .exp-row { grid-template-columns: 1fr; gap: 2px; }
  .stats { gap: 18px 28px; }
  .stat-num { font-size: 1.7rem; }
  .term-body { height: 260px; }
}

/* tokens used by the home redesign (built on the existing accent colours) */
:root, [data-theme='dark'] {
  --grad: linear-gradient(95deg, var(--accent), var(--accent-2));
  --glass: rgba(16, 22, 36, 0.55);
  --cyan: var(--accent);
  --net: 56, 232, 198;
}
[data-theme='light'] {
  --grad: linear-gradient(95deg, var(--accent), var(--accent-2));
  --glass: rgba(255, 255, 255, 0.75);
  --cyan: var(--accent);
  --net: 10, 143, 122;
}

/* ===== writing page ===== */
.wr { padding-top: 56px; padding-bottom: 40px; }
.wr-head { max-width: 760px; margin-bottom: 28px; }
.wr-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 14px; }
.wr-count { color: var(--muted); font-size: 0.82rem; margin-top: 14px; }
.wr-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 36px; }
.wr-chip { font: inherit; font-size: 0.84rem; color: var(--muted); background: var(--glass); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.wr-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.wr-chip.on { color: var(--on-accent, #fff); background: var(--grad); border-color: transparent; }
.wr-tag { font-family: 'Fira Code', monospace; font-size: 0.76rem; }
.wr-section { margin-bottom: 44px; }
.wr-h { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 14px; }

.wr-book { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; padding: 28px; position: relative; overflow: hidden; }
.wr-book::before { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 220px at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); pointer-events: none; }
.wr-book:hover { transform: none; }
.wr-book-main { position: relative; }
.wr-kicker { font-size: 0.76rem; color: var(--accent); margin: 0 0 8px; }
.wr-status { color: var(--amber); }
.wr-book h2 { font-size: 1.5rem; margin: 0 0 10px; letter-spacing: -0.02em; }
.wr-book h2 a { color: var(--text); }
.wr-book h2 a:hover { color: var(--accent); text-decoration: none; }
.wr-start { margin-top: 10px; }
.wr-chapters { list-style: none; margin: 0; padding: 0; position: relative; border-left: 1px solid var(--border); padding-left: 16px; align-self: center; }
.wr-chapters a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 0.92rem; }
.wr-chapters a:hover { background: var(--panel-2); text-decoration: none; color: var(--accent); }

.wr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.wr-post { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.wr-post h3 { margin: 0; font-size: 1.08rem; line-height: 1.4; }
.wr-post:hover h3 { color: var(--accent); }
.wr-post p { margin: 0; color: var(--muted); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wr-post .tags { margin-top: auto; padding-top: 4px; }
.wr-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 0.75rem; color: var(--muted); }
.wr-src { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); }
.wr-src.ext { color: var(--accent-2, var(--accent)); border-color: color-mix(in srgb, var(--accent-2, var(--accent)) 40%, transparent); }
.is-hidden { display: none !important; }

@media (max-width: 760px) {
  .wr-book { grid-template-columns: 1fr; padding: 22px; }
  .wr-chapters { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .wr-grid { grid-template-columns: 1fr; }
}

/* ===== about page ===== */
.ab { padding-top: 56px; padding-bottom: 40px; }
.ab-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.ab-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 16px; }
.ab-hero p { max-width: 62ch; }
.ab-card { padding: 24px; position: sticky; top: 90px; }
.ab-card:hover { transform: none; }
.ab-card-title { font-size: 0.8rem; margin: 0 0 16px; color: var(--text); }
.ab-glance { margin: 0; display: grid; gap: 12px; }
.ab-glance div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; }
.ab-glance dt { color: var(--muted); font-size: 0.78rem; }
.ab-glance dd { margin: 0; font-weight: 500; }
.ab-sub { color: var(--muted); font-size: 0.78rem; margin: 20px 0 8px; }
.ab-focus { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ab-focus li { padding: 8px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-size: 0.9rem; }
.ab-period { color: var(--accent); font-size: 0.76rem; margin: 0 0 4px !important; }
@media (max-width: 900px) { .ab-hero { grid-template-columns: 1fr; } .ab-card { position: static; } }

/* ===== primary nav: 7 items + mobile menu ===== */
.nav-toggle { display: none; margin-left: auto; }
.nav a.active { color: var(--text); background: var(--panel-2); }
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cert { display: flex; gap: 14px; align-items: flex-start; }
.cert h3 { margin: 2px 0 6px; font-size: 0.98rem; line-height: 1.35; }
.cert p { margin: 0; font-size: 0.78rem; }
.cert-status { color: var(--amber); }
@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 10px 16px 16px; margin: 0; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 20px 40px -20px rgba(0,0,0,.6); }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px !important; font-size: 0.95rem !important; }
  .site-header .header-inner { position: relative; }
  .tools { margin-left: 4px; }
  .cert-grid { grid-template-columns: 1fr; }
}

/* ===== experience timeline ===== */
.xtl { list-style: none; margin: 0; padding: 0; position: relative; }
.xtl::before { content: ''; position: absolute; left: 185px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent-2, var(--accent))); opacity: 0.45; }
.xtl-item { display: grid; grid-template-columns: 160px 24px 1fr; gap: 0 14px; align-items: start; padding-bottom: 18px; }
.xtl-item:last-child { padding-bottom: 0; }
.xtl-date { display: flex; flex-direction: column; align-items: flex-end; padding-top: 16px; font-size: 0.8rem; color: var(--text); text-align: right; }
.xtl-to { color: var(--muted); font-size: 0.74rem; }
.xtl-to::before { content: '→ '; }
.xtl-node { width: 14px; height: 14px; margin: 20px auto 0; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); position: relative; z-index: 1; }
.xtl-item.current .xtl-node { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.xtl-item.current .xtl-node::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: xtl-ping 2.2s ease-out infinite; }
@keyframes xtl-ping { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.8); opacity: 0; } }
.xtl-card { padding: 16px 20px; }
.xtl-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.xtl-org { margin: 0; color: var(--accent); font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }
.xtl-now { font-size: 0.68rem; color: var(--green, var(--accent)); border: 1px solid color-mix(in srgb, var(--green, var(--accent)) 45%, transparent); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 640px) {
  .xtl::before { left: 6px; }
  .xtl-item { grid-template-columns: 14px 1fr; gap: 6px 14px; }
  .xtl-date { grid-column: 2; grid-row: 1; flex-direction: row; gap: 8px; align-items: baseline; padding-top: 0; text-align: left; }
  .xtl-node { grid-column: 1; grid-row: 1; margin: 3px 0 0; }
  .xtl-card { grid-column: 2; grid-row: 2; }
}

/* ===== certifications timeline ===== */
.cert-issuer { display: inline-flex; align-items: center; gap: 8px; }
.cert-issuer img { display: block; }
.xtl-cert .xtl-item.expired .xtl-node { border-color: var(--amber); background: var(--bg); }
.xtl-cert::before { background: linear-gradient(var(--accent-2, var(--accent)), var(--amber)); }
.cert-pill { font-size: 0.68rem; border-radius: 999px; padding: 1px 8px; border: 1px solid color-mix(in srgb, var(--green, var(--accent)) 45%, transparent); color: var(--green, var(--accent)); }
.cert-pill.is-expired { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }

/* ===== skills ===== */
.core { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 26px; }
.core-tile { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), var(--glass); }
.core-tile b { display: block; font-size: 1rem; }
.core-tile small { color: var(--muted); font-size: 0.7rem; }
.sk-logo { width: calc(var(--s) + 16px); height: calc(var(--s) + 16px); flex: none; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); display: grid; place-items: center; position: relative; }
.sk-logo img { position: relative; z-index: 1; }
.sk-logo img + img { position: absolute; }
.sk-mono { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--s) * 0.5); font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sk-logo:has(img) .sk-mono { opacity: 0; }
.sk-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sk-tab { font: inherit; font-size: 0.84rem; color: var(--muted); background: var(--glass); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.sk-tab span { font-family: 'Fira Code', monospace; font-size: 0.7rem; padding: 0 6px; border-radius: 999px; background: var(--panel-2); }
.sk-tab:hover { color: var(--text); }
.sk-tab.on { color: var(--on-accent, #fff); background: var(--grad); border-color: transparent; }
.sk-tab.on span { background: rgba(0, 0, 0, 0.18); }
.sk-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sk-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--glass); font-size: 0.9rem; transition: border-color .15s, transform .15s; }
.sk-tile:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-1px); }
@media (max-width: 960px) { .core { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .core { grid-template-columns: 1fr 1fr; } .sk-grid { grid-template-columns: 1fr 1fr; } .sk-tile { font-size: 0.82rem; } }
.core-tile > div { min-width: 0; }
.core-tile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) { .core { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .core { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sk-tile { padding: 8px 10px; gap: 10px; } }
.core { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ab-hero .cta { margin-top: 22px; }
@media (max-width: 960px) { .core { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .core { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== hero fact strip ===== */
.stats { display: inline-grid; grid-auto-flow: column; grid-auto-columns: auto; gap: 0; margin: 26px 0 30px; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--glass); backdrop-filter: blur(8px); overflow: hidden; }
.stat { padding: 14px 22px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat-num { font-size: 1.35rem; white-space: nowrap; }
.stat dd { max-width: none; white-space: nowrap; font-size: 0.76rem; }
@media (max-width: 560px) {
  .stats { display: grid; grid-auto-flow: row; width: 100%; }
  .stat { border-left: 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 16px; }
  .stat:first-child { border-top: 0; }
  .stat dd { margin: 0; }
  .stat-num { font-size: 1.1rem; }
}
.term-body { height: 440px; } @media (max-width: 600px) { .term-body { height: 300px; } }

/* ===== skills: coloured brand badges ===== */
.skx { display: grid; gap: 26px; padding: 26px 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--glass); backdrop-filter: blur(8px); }
.skx-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.skx-h .icon { color: var(--accent); }
.skx-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skx-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 7px; background: var(--bg); color: var(--fg); font-size: 0.92rem; font-weight: 500; line-height: 1.2; box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 6px 18px -10px var(--bg); transition: transform .15s, filter .15s; }
.skx-badge:hover { transform: translateY(-2px); filter: brightness(1.08); }
.skx-badge img { display: block; flex: none; }
[data-theme='dark'] .skx-badge[style*="--bg:#000000"], [data-theme='dark'] .skx-badge[style*="--bg:#141414"], [data-theme='dark'] .skx-badge[style*="--bg:#232F3E"], [data-theme='dark'] .skx-badge[style*="--bg:#24292F"] { box-shadow: 0 0 0 1px rgba(255,255,255,0.14) inset; }
@media (max-width: 560px) { .skx { padding: 18px 16px; } .skx-badge { font-size: 0.84rem; padding: 6px 10px; } }

/* ===== projects: accent cards ===== */
.pj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pj { --ac: #58a6ff; display: flex; flex-direction: column; padding: 24px; border-radius: 16px; border: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(8px); transition: border-color .25s, box-shadow .25s, transform .25s; }
.pj-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.pj-icon { width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--ac); background: color-mix(in srgb, var(--ac) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ac) 28%, transparent); transition: background .25s, color .25s; }
.pj-tag { font-size: 0.74rem; padding: 4px 10px; border-radius: 6px; color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ac) 40%, transparent); white-space: nowrap; }
.pj h3 { margin: 0 0 10px; font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; transition: color .25s; }
.pj p { margin: 0 0 18px; color: var(--muted); font-size: 0.93rem; line-height: 1.65; }
.pj-tech { list-style: none; margin: auto 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.pj-tech li { font-size: 0.8rem; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-2); transition: border-color .25s; }
.pj:hover { border-color: color-mix(in srgb, var(--ac) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ac) 25%, transparent), 0 18px 50px -24px var(--ac); transform: translateY(-3px); }
.pj:hover h3 { color: var(--ac); }
.pj:hover .pj-icon { background: color-mix(in srgb, var(--ac) 24%, transparent); }
.pj:hover .pj-tech li { border-color: color-mix(in srgb, var(--ac) 35%, var(--border)); }
[data-theme='light'] .pj-tag, [data-theme='light'] .pj-icon, [data-theme='light'] .pj:hover h3 { color: color-mix(in srgb, var(--ac) 68%, #000); }
@media (max-width: 1000px) { .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pj-grid { grid-template-columns: 1fr; } .pj { padding: 20px; } }

/* ===== about on home ===== */
#about .ab-hero { grid-template-columns: 1.4fr 1fr; align-items: center; }
.ab-title { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -0.03em; line-height: 1.12; margin: 0 0 16px; }
.hero2 { min-height: 0; padding-top: 72px; padding-bottom: 24px; }
@media (max-width: 900px) { #about .ab-hero { grid-template-columns: 1fr; } }

/* ---------- hand-drawn diagrams in posts ---------- */
.sketch { margin: 1.8em 0; padding: 14px 10px 10px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: var(--panel-solid); }
.sketch svg { display: block; width: 100%; height: auto; overflow: visible; }
.sketch figcaption { font-family: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive; font-size: 1.25rem; line-height: 1.3; color: var(--muted); text-align: center; margin-top: 6px; }
.sketch path.s { fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sketch path.h { fill: none; stroke-width: 1.3; stroke-linecap: round; opacity: 0.38; }
.sketch path.a { stroke: var(--accent); }
.sketch path.b { stroke: var(--accent-2); }
.sketch path.r { stroke: var(--red); }
.sketch path.y { stroke: var(--amber); }
.sketch path.g { stroke: var(--green); }
.sketch path.m, .sketch path.m2 { stroke: var(--muted); }
.sketch .f { stroke: none; }
.sketch .f.a { fill: var(--accent); } .sketch .f.b { fill: var(--accent-2); } .sketch .f.r { fill: var(--red); }
.sketch .f.g { fill: var(--green); } .sketch .f.y { fill: var(--amber); }
.sketch text { font-family: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive; font-size: 22px; fill: var(--text); paint-order: stroke fill; stroke: var(--panel-solid); stroke-width: 6px; stroke-linejoin: round; }
.sketch text.big { font-size: 27px; font-weight: 700; }
.sketch text.m { fill: var(--muted); }
.sketch text.r { fill: var(--red); } .sketch text.g { fill: var(--green); }
.sketch text.code { font-family: 'Fira Code', ui-monospace, monospace; font-size: 14.5px; }
/* animations */
.sketch .anim-playhead { animation: sk-play 4.5s linear infinite; }
@keyframes sk-play { from { transform: translateX(0); } to { transform: translateX(600px); } }
.sketch .anim-grow { transform-box: fill-box; transform-origin: left center; animation: sk-grow 3.5s ease-out infinite; }
.sketch .anim-grow.d2 { animation-duration: 3.5s; }
@keyframes sk-grow { 0% { transform: scaleX(0); } 55%, 100% { transform: scaleX(1); } }
.sketch .anim-fill { transform-box: fill-box; transform-origin: center bottom; animation: sk-fill 4s ease-in infinite; }
@keyframes sk-fill { 0% { transform: scaleY(0.05); } 70% { transform: scaleY(0.88); } 76%, 92% { transform: scaleY(0.88); opacity: 1; } 100% { transform: scaleY(0.05); opacity: 0.2; } }
.sketch .anim-kill { animation: sk-kill 4s steps(1) infinite; }
@keyframes sk-kill { 0% { opacity: 0; } 70% { opacity: 1; } 96% { opacity: 0; } }
.sketch .anim-needle { transform-box: view-box; transform-origin: 190px 200px; animation: sk-needle 4s ease-in-out infinite; }
@keyframes sk-needle { 0% { transform: rotate(110deg); } 60%, 85% { transform: rotate(0deg); } 100% { transform: rotate(110deg); } }
.sketch .anim-knob { transform-box: view-box; transform-origin: 160px 130px; animation: sk-knob 4s ease-in-out infinite; }
@keyframes sk-knob { 0%, 20% { transform: rotate(-40deg); } 55%, 85% { transform: rotate(95deg); } 100% { transform: rotate(-40deg); } }
.no-motion .sketch [class*='anim-'] { animation: none !important; }
.no-motion .sketch .anim-kill { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sketch [class*='anim-'] { animation: none !important; } }
@media (max-width: 640px) { .sketch { overflow-x: auto; -webkit-overflow-scrolling: touch; } .sketch svg { min-width: 600px; } }

/* ---------- reading typography (posts) ---------- */
.prose { font-size: 1.065rem; line-height: 1.8; color: color-mix(in srgb, var(--text) 84%, var(--muted)); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.3em; }
.prose > p:first-child { font-size: 1.18rem; color: var(--text); }
.prose strong { color: var(--text); font-weight: 650; }
.prose em { color: var(--text); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color 0.15s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose h2 { font-size: clamp(1.45rem, 2.6vw, 1.8rem); font-weight: 750; line-height: 1.25; letter-spacing: -0.025em; color: var(--text); margin: 2.9em 0 0.75em; padding: 0; border: 0; }
.prose h2::before { content: ''; display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--grad); margin-bottom: 16px; }
.prose h3 { font-size: 1.22rem; font-weight: 700; color: var(--text); letter-spacing: -0.015em; }
.prose :not(pre) > code { color: color-mix(in srgb, var(--accent) 70%, var(--text)); background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); font-size: 0.84em; padding: 0.12em 0.42em; }
.prose strong code { background: transparent; }
.prose li { margin: 0.45em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose .table-wrap { margin: 1.6em 0; }
.prose th { font-family: 'Fira Code', monospace; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.prose td { line-height: 1.55; }
.prose tbody tr:hover td { background: var(--panel-2); }
.prose .code { margin: 1.4em 0; }
.callout { padding: 14px 18px; }
.callout p { line-height: 1.7; }
.callout-key { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel-solid)); }
.callout-key .callout-title { color: var(--accent); }
.callout-key p:not(.callout-title) { font-size: 1.12rem; font-weight: 600; color: var(--text); }
.callout-key strong { background: none; }
.callout > :last-child { margin-bottom: 0 !important; }
.pj-quote { position: relative; margin: 0 0 18px; padding: 14px 16px 14px 18px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ac) 30%, var(--border)); border-left: 3px solid var(--ac); background: color-mix(in srgb, var(--ac) 7%, transparent); }
.pj-quote p { margin: 0 0 10px; font-size: 0.88rem; line-height: 1.6; font-style: italic; color: var(--text); }
.pj-quote footer { font-size: 0.8rem; color: var(--ac); }
.pj-quote footer strong { font-weight: 650; }
[data-theme='light'] .pj-quote footer { color: color-mix(in srgb, var(--ac) 68%, #000); }
.cert-id { margin: 6px 0 0; font-size: 0.76rem; color: var(--muted); letter-spacing: 0.02em; }
.cert-id a { color: var(--accent); }
.skx-subs { display: grid; gap: 10px; }
.skx-sub { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 14px; }
.skx-sub-l { margin: 0; font-size: 0.86rem; color: var(--muted); }
@media (max-width: 720px) { .skx-sub { grid-template-columns: 1fr; gap: 6px; } .skx-sub + .skx-sub { margin-top: 6px; } }

/* ---------- throttling simulator ---------- */
.sim { margin: 1.8em 0; padding: 16px 18px 14px; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 16px; background: var(--panel-solid); }
.sim-head { font-weight: 650; color: var(--text); margin-bottom: 12px; font-size: 0.98rem; }
.sim-badge { display: inline-block; font-family: 'Fira Code', monospace; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 1px 8px; margin-right: 6px; vertical-align: 1px; }
.sim-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin-bottom: 10px; }
.sim-controls label { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; font-size: 0.86rem; color: var(--muted); }
.sim-controls input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.sim-controls output { font-family: 'Fira Code', monospace; font-size: 0.82rem; color: var(--text); grid-row: 1; grid-column: 2; }
#sim-svg { display: block; width: 100%; height: auto; }
.sim-t { font-family: 'Fira Code', monospace; font-size: 12px; fill: var(--text); }
.sim-m { fill: var(--muted); }
.sim-run { fill: color-mix(in srgb, var(--green) 70%, transparent); }
.sim-thr { fill: color-mix(in srgb, var(--red) 22%, transparent); stroke: color-mix(in srgb, var(--red) 55%, transparent); stroke-dasharray: 3 3; }
.sim-out { margin-top: 8px; font-size: 0.95rem; line-height: 1.65; color: var(--text); }
.sim-good { color: var(--green); } .sim-bad { color: var(--red); }
.sim-note { margin: 10px 0 0 !important; font-size: 0.78rem; color: var(--muted); }
@media (max-width: 640px) { .sim-controls { grid-template-columns: 1fr; } }
.prose :not(pre) > code { overflow-wrap: anywhere; }

/* Predict-first boxes: a question, with the answer hidden until clicked */
.predict { margin: 1.4em 0; border: 1px dashed var(--accent-2); border-radius: 12px; background: var(--panel); }
.predict summary { cursor: pointer; padding: 12px 16px; list-style: none; color: var(--text); }
.predict summary::-webkit-details-marker { display: none; }
.predict summary::after { content: "Show answer"; display: block; margin-top: 6px; font-size: 0.8rem; color: var(--accent-2); }
.predict[open] summary::after { content: "Hide answer"; }
.predict-tag { display: inline-block; margin-right: 6px; font-family: 'Fira Code', monospace; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-2); }
.predict-answer { padding: 0 16px 12px; border-top: 1px solid var(--border); }
.predict-answer p { margin: 0.7em 0 0; }

/* TL;DR and Going deeper callouts, h4 inside posts */
.callout-tldr { border-left-color: var(--accent); } .callout-tldr .callout-title { color: var(--accent); }
.callout-deeper { border-style: dashed; border-left-style: solid; border-left-color: var(--muted); } .callout-deeper .callout-title { color: var(--muted); }
.prose h4 { font-size: 1.02rem; font-weight: 700; margin: 1.5em 0 0.4em; color: var(--text); }

/* Industry under each experience entry */
.xtl-domain { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; }
