:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.9);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --cyan: #67e8f9;
  --emerald: #34d399;
  --violet: #a78bfa;
  --shadow: 0 26px 60px -18px rgba(2, 6, 23, 0.9);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; overflow-x: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .site-main > * { animation: shell-rise .7s both; }
  .site-main > *:nth-child(2) { animation-delay: .08s; }
  .site-main > *:nth-child(3) { animation-delay: .16s; }
  .article-shell > * { animation: article-reveal .65s both; }
  .article-shell > *:nth-child(2) { animation-delay: .08s; }
  .article-shell > *:nth-child(3) { animation-delay: .14s; }
  .article-body section { animation: article-reveal .65s both; animation-delay: calc(var(--section-index, 0) * 70ms); }
  .feature-card, .related-card, .vote-button { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
  .feature-card:hover, .related-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px -24px rgba(103,232,249,.7); }
}
@keyframes shell-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes article-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  body.skills-page .panel-card { animation: shell-rise .65s both; }
  body.skills-page .panel-card:nth-of-type(2) { animation-delay: .08s; }
  body.skills-page .panel-card:nth-of-type(3) { animation-delay: .16s; }
  body.skills-page .panel-card:nth-of-type(4) { animation-delay: .24s; }
  body.skills-page .stack-layer { transition: transform .35s ease, box-shadow .35s ease; }
  body.skills-page .stack-layer:hover { transform: translateZ(8px) scale(1.02); box-shadow: 0 0 42px rgba(94,234,212,.25), inset 0 0 24px rgba(94,234,212,.12); }
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
#three-bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
.site-shell { position: relative; isolation: isolate; background: radial-gradient(circle at top, rgba(34,211,238,0.14), transparent 28%), var(--bg); }
.site-shell > * { position: relative; z-index: 1; }
.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: rgba(2, 6, 23, 0.72); border-bottom: 1px solid rgba(103, 232, 249, 0.15);
}
.site-header::after { content: ''; display: block; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .45; animation: header-scan 4s ease-in-out infinite; }
@keyframes header-scan { 0%, 100% { transform: scaleX(.25); opacity: .15; } 50% { transform: scaleX(1); opacity: .65; } }
.site-header .inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; overflow: hidden; background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(103,232,249,0.18);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 0.96rem; font-weight: 800; }
.brand-copy span { margin-top: 4px; font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cyan); }
.site-actions { display: flex; align-items: center; gap: 10px; }
.icon-button {
  width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.7); border: 1px solid rgba(103,232,249,0.15); color: var(--text); transition: transform .2s ease;
}
.icon-button:hover { transform: translateY(-1px); }
.search-shell { position: relative; width: min(42vw, 360px); }
.search-shell input {
  width: 100%; background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(148,163,184,0.18); border-radius: 12px; color: var(--text); padding: 0.82rem 0.9rem 0.82rem 2.6rem; font-size: 0.8rem; outline: none;
}
.search-shell input:focus { border-color: rgba(103,232,249,0.5); box-shadow: 0 0 0 3px rgba(34,211,238,0.12); }
.search-shell .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--cyan); }
.search-results {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(420px, 84vw); max-height: 300px; overflow: auto; background: rgba(2,6,23,0.96); border: 1px solid rgba(103,232,249,0.2); border-radius: 16px; padding: 8px; display: none; box-shadow: var(--shadow);
}
.search-results.open { display: block; }
.search-result-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0.7rem 0.8rem; border-radius: 12px; color: var(--text); background: transparent;
}
.search-result-item:hover { background: rgba(14,116,144,0.12); }
.site-main { max-width: 1180px; margin: 0 auto; padding: 30px 18px 64px; }
.hero-panel, .glass-card, .article-shell, .feature-card {
  background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(2,6,23,0.9)); border: 1px solid rgba(103,232,249,0.18); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 0.52rem 0.78rem; border-radius: 999px; border: 1px solid rgba(52,211,153,0.2); background: rgba(6,95,70,0.18); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--emerald); font-weight: 800;
}
.hero-title { margin: 18px 0 12px; font-size: clamp(2.4rem, 5vw, 4.3rem); line-height: .98; letter-spacing: -0.06em; font-weight: 800; }
.hero-copy { color: var(--muted); line-height: 1.8; font-size: 1.06rem; }
.section-head { margin: 54px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-head h2 { margin: 0; font-size: clamp(1.8rem, 2vw, 2.8rem); letter-spacing: -0.05em; }
.grid-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-card { display: block; padding: 22px; }
.feature-card h3 { margin: 0 0 12px; font-size: 1.14rem; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.primary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.primary-cta, .secondary-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.76rem 1rem; border-radius: 12px; font-size: 0.78rem; font-weight: 800; transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.primary-cta { color: #042f2e; background: var(--emerald); border: 1px solid var(--emerald); }
.secondary-cta { color: var(--cyan); background: rgba(8, 47, 73, 0.28); border: 1px solid rgba(103,232,249,0.28); }
.primary-cta:hover, .secondary-cta:hover { transform: translateY(-1px); }
.article-shell {
  max-width: 920px; margin: 24px auto 0; padding: clamp(1.3rem, 3vw, 2.2rem);
}
.article-shell h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 4vw, 3.2rem); letter-spacing: -0.06em; }
.article-shell .lead { margin: 0; color: var(--muted); line-height: 1.8; font-size: 1.06rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 0.42rem 0.72rem; border-radius: 999px; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(8, 47, 73, 0.22); border: 1px solid rgba(103,232,249,0.2); color: var(--cyan);
}
.toc { margin-top: 26px; padding: 18px; border-radius: 18px; background: rgba(15,23,42,0.52); border: 1px solid rgba(125,211,252,0.18); }
.article-body { margin-top: 26px; }
.article-body section { margin-top: 22px; }
.article-body h2 { font-size: clamp(1.25rem, 2vw, 1.8rem); margin: 0 0 10px; }
.article-body p, .article-body li { color: var(--muted); line-height: 1.8; font-size: 1rem; }
.article-body ul, .article-body ol { margin-left: 1.2rem; }
.code-block {
  margin-top: 16px; background: rgba(2,6,23,0.92); border: 1px solid rgba(103,232,249,0.18); border-radius: 16px; padding: 1rem; overflow-x: auto; color: #dbeafe; font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; line-height: 1.7;
}
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.related-card {
  display: block; padding: 18px; border-radius: 18px; background: rgba(15,23,42,0.55); border: 1px solid rgba(103,232,249,0.18); color: var(--text);
}
.related-card span {
  display: inline-block; margin-bottom: 8px; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan);
}
.related-card h3 { margin: 0; font-size: 1.04rem; }
.vote-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.vote-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(148,163,184,0.2); border-radius: 12px; background: rgba(15,23,42,0.7); color: var(--text); padding: 0.75rem 1rem; font-weight: 700; cursor: pointer; transition: transform .2s ease, border-color .2s ease;
}
.vote-button:hover { transform: translateY(-1px); }
.vote-button.is-voted { border-color: rgba(52,211,153,0.6); background: rgba(5,150,105,0.12); color: var(--emerald); }
.vote-button[data-vote='down'].is-voted { color: #fda4af; border-color: rgba(251,113,133,0.4); background: rgba(190,24,93,0.12); }
.article-comments { margin-top: 34px; padding-top: 28px; border-top: 1px solid rgba(103,232,249,0.16); }
.article-comments h2 { margin: 0 0 8px; font-size: 1.35rem; }
.article-comments-intro { margin: 0 0 18px; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.comment-form { display: grid; gap: 12px; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid rgba(148,163,184,.2); border-radius: 12px; background: rgba(2,6,23,.7); color: var(--text); padding: .78rem .9rem; font: inherit; font-size: .82rem; outline: none; }
.comment-form input:focus, .comment-form textarea:focus { border-color: rgba(103,232,249,.6); box-shadow: 0 0 0 3px rgba(34,211,238,.1); }
.comment-form textarea { min-height: 110px; resize: vertical; }
.comment-form button { width: fit-content; border: 1px solid rgba(103,232,249,.35); border-radius: 12px; background: rgba(8,47,73,.35); color: var(--cyan); padding: .72rem 1rem; font-weight: 800; cursor: pointer; }
.comment-form button:hover { background: rgba(8,145,178,.2); }
.comment-list { display: grid; gap: 10px; margin-top: 18px; }
.comment-item { padding: 14px; border: 1px solid rgba(148,163,184,.15); border-radius: 14px; background: rgba(15,23,42,.45); }
.comment-item header { display: flex; justify-content: space-between; gap: 12px; color: var(--cyan); font-size: .76rem; font-weight: 800; }
.comment-item time { color: var(--muted); font-size: .68rem; font-weight: 500; }
.comment-item p { margin: 8px 0 0; color: var(--muted); line-height: 1.65; font-size: .82rem; white-space: pre-wrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
.site-footer {
  position: relative; z-index: 1; border-top: 1px solid rgba(103,232,249,0.12); background: rgba(2,6,23,0.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 24px 18px 38px;
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.04em; }
.footer-links a:hover { color: var(--cyan); }
@media (max-width: 840px) {
  .grid-three, .related-grid { grid-template-columns: 1fr; }
  .site-header .inner { flex-wrap: wrap; }
  .search-shell { width: 100%; }
}
@media (max-width: 540px) {
  .site-main { padding-top: 20px; }
  .hero-title { line-height: 1.04; }
  .brand-copy span { letter-spacing: .08em; }
}
