/* ─── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg:            #0F172A;
  --surface:       #1E293B;
  --surface-2:     #293548;
  --border:        #1E293B;
  --border-mid:    #334155;
  --border-strong: #475569;

  --text:          #F1F5F9;
  --text-muted:    #94A3B8;
  --text-faint:    #64748B;

  --accent:        #3B82F6;
  --accent-hover:  #60A5FA;

  --code:          #22C55E;
  --code-bg:       #0a1f12;

  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --nav-h:    64px;
  --radius:   8px;
  --radius-s: 4px;
  --max-w:    1200px;
  --prose-w:  680px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t:        200ms;
  --t-slow:   400ms;
}

/* ─── Base ───────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* ─── Layout ─────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px)  { .wrap { padding: 0 48px; } }
@media (min-width: 1100px) { .wrap { padding: 0 80px; } }

/* ─── Nav placeholder (pre-load) ────────────────────── */
#site-nav {
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-h);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  z-index: 200;
}

/* ─── Nav ────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-h);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  z-index: 200;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  user-select: none;
}

.nav__logo em {
  font-style: normal;
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav__links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-s);
  transition: color var(--t), background var(--t);
}

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

.nav__links .nav__cta {
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-weight: 500;
  transition: color var(--t), background var(--t), border-color var(--t);
}

.nav__links .nav__cta:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.7);
  color: var(--accent-hover);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav__toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t), background var(--t);
  transform-origin: center;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 767px) {
  .nav__toggle { display: flex; }

  .nav__links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    inset-inline: 0;
    bottom: 0;
    background: rgba(10, 16, 30, 0.97);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 4px;
    border-top: 1px solid var(--border-mid);
  }

  .nav__links.is-open { display: flex; }

  .nav__links a {
    font-size: 18px;
    padding: 12px 8px;
    width: 100%;
  }

  .nav__links .nav__cta {
    margin-top: 12px;
    padding: 12px 20px;
    text-align: center;
    border-radius: var(--radius-s);
  }
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-mid);
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

/* ─── Section base ───────────────────────────────────── */
.section {
  padding: 100px 0;
}

.section--tinted {
  background: rgba(30, 41, 59, 0.28);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section + .section { padding-top: 0; }

.sec-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.sec-label__num { color: var(--accent); }

.sec-label__sep {
  width: 20px;
  height: 1px;
  background: var(--border-mid);
}

.sec-title {
  font-family: var(--font-mono);
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.sec-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 560px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* ─── Page hero (inner pages) ────────────────────────── */
.page-hero {
  padding: calc(var(--nav-h) + 60px) 0 56px;
  border-bottom: 1px solid var(--border);
}

.page-hero__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.page-hero__title {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.page-hero__sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* ─── Breadcrumb ─────────────────────────────────────── */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-decoration: none;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 28px;
  transition: color var(--t);
}

.breadcrumb:hover { color: var(--accent); }

/* ─── Hero (homepage) ────────────────────────────────── */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.11) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 90% 70% at 45% 45%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 45% 45%, black 20%, transparent 75%);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.hero__body {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 44px;
}

.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--code);
  flex-shrink: 0;
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50%       { opacity: 0.6; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);  }
}

.hero__prompt {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 14px;
  margin-bottom: 28px;
}

.hero__gt {
  font-family: var(--font-mono);
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 700;
  color: var(--code);
  line-height: 1.1;
  flex-shrink: 0;
  user-select: none;
}

.hero__name {
  font-family: var(--font-mono);
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.hero__cursor {
  color: var(--code);
  animation: blink 1.15s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero__tagline {
  max-width: 600px;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 48px;
}

.hero__tagline strong {
  color: var(--text);
  font-weight: 500;
}

.hero__copy {
  display: block;
}

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

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

.hero__intro,
.hero__location {
  display: inline;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__scroll {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity var(--t);
}

.hero__scroll:hover { opacity: 1; }

.hero__scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--text-faint), transparent);
  animation: tickDown 2.2s ease-in-out infinite;
}

@keyframes tickDown {
  0%   { transform: scaleY(0); transform-origin: top;    opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top;    opacity: 1; }
  80%  { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ─── About ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  margin-top: 52px;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 80px;
    align-items: start;
  }
}

.about-text p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 18px;
}

.about-text [data-about-content] {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.85;
}

.about-text [data-about-content] p {
  margin: 0;
  white-space: normal;
}

.about-text [data-about-content] p + p {
  margin-top: 1rem;
}

.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 500; }

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
}

.about-meta__key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.about-meta__val {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.about-meta__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ─── Work / Project cards ───────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 52px;
}

@media (min-width: 700px)  { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .work-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  text-decoration: none;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, transparent 55%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-slow);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.card:hover::after { opacity: 1; }
.card[data-hidden="true"] { display: none; }

.card__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.card__title {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.card__body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  flex: 1;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.card__foot {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--code);
  background: var(--code-bg);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius-s);
  padding: 3px 9px;
  line-height: 1.6;
}

/* ─── Work tabs ─────────────────────────────────────── */
.work-tabs {
  display: flex;
  gap: 4px;
  margin-top: 36px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}

.work-tab {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  padding: 7px 18px;
  cursor: pointer;
  transition: color var(--t), background var(--t);
  letter-spacing: 0.02em;
}

.work-tab:hover { color: var(--text); }

.work-tab[aria-selected="true"] {
  color: var(--text);
  background: var(--surface-2);
}

/* ─── Timeline ───────────────────────────────────────── */
.timeline-groups {
  display: flex;
  flex-direction: column;
  gap: 52px;
  margin-top: 52px;
}

.timeline-group__head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border-mid);
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-mid);
  transition: border-color var(--t);
}

.timeline-item:hover::before { border-color: var(--accent); }

.timeline-item--current::before {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
}

.timeline-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.timeline-item__period {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  margin-bottom: 5px;
  letter-spacing: 0.03em;
}

.timeline-item__current {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--code);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-s);
  padding: 2px 8px;
}

.timeline-item__title {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 3px;
}

.timeline-item__sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.timeline-item__body {
  font-size: 13.5px;
  color: var(--text-faint);
  line-height: 1.7;
}

/* ─── Full-page timeline (experience / education) ────── */
.page-timeline .timeline-item           { padding-bottom: 48px; }
.page-timeline .timeline-item__title    { font-size: 16px; }
.page-timeline .timeline-item__sub      { font-size: 14px; }
.page-timeline .timeline-item__body     { font-size: 14px; line-height: 1.75; }

.timeline-item__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.skill-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-s);
  padding: 3px 10px;
}

.timeline-group__foot {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.work-foot { margin-top: 32px; }

/* ─── Skills ─────────────────────────────────────────── */
.skills-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-top: 52px;
}

@media (min-width: 700px)  { .skills-layout { grid-template-columns: 1fr 1fr; gap: 64px; } }
@media (min-width: 1000px) { .skills-layout { grid-template-columns: 1fr 1fr 1fr; } }

.skill-group__head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.skill-group__list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-s);
  padding: 6px 13px;
  transition: color var(--t), border-color var(--t), background var(--t);
}

.skill-tag:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* ─── Blog (homepage post list) ──────────────────────── */
.post-list {
  margin-top: 52px;
  border-top: 1px solid var(--border-mid);
}

.post {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border-mid);
  text-decoration: none;
  cursor: pointer;
}

@media (min-width: 640px) {
  .post { grid-template-columns: 100px 1fr auto; align-items: center; }
}

.post:hover .post__title { color: var(--accent); }

.post__date { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.post__title {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  transition: color var(--t);
}

.post__cat { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }

.blog__foot { margin-top: 32px; }

/* ─── Contact ────────────────────────────────────────── */
.contact-inner { max-width: 580px; }

.contact-body {
  font-size: 16.5px;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 24px 0 40px;
}

.contact-links { display: flex; flex-wrap: wrap; gap: 14px; }

/* ─── Blog index ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 32px 0 0;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-s);
  padding: 6px 14px;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
  letter-spacing: 0.03em;
}

.filter-btn:hover { color: var(--text-muted); border-color: var(--border-strong); }

.filter-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.posts { margin-top: 48px; }

.post-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

.post-item {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-mid);
  text-decoration: none;
}

.post-item:first-child { border-top: 1px solid var(--border-mid); }

.post-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.post-item__date,
.post-item__readtime { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.post-item__cat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-s);
  padding: 2px 9px;
}

.post-item__title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color var(--t);
}

.post-item:hover .post-item__title { color: var(--accent); }

.post-item__excerpt {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 680px;
  margin-bottom: 14px;
}

.post-item__tags { display: flex; flex-wrap: wrap; gap: 7px; }

.post-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--code);
  background: var(--code-bg);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius-s);
  padding: 3px 9px;
}

.post-item[data-hidden="true"] { display: none; }

.posts__foot { margin-top: 40px; display: flex; align-items: center; gap: 16px; }

.posts__empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  padding: 40px 0;
  display: none;
}

.posts__empty.is-visible { display: block; }

/* ─── Active filter strip ────────────────────────────── */
.active-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 14px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-s);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.active-filter strong { color: var(--accent); font-weight: 500; }

.active-filter__clear {
  margin-left: auto;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: var(--radius-s);
  transition: color var(--t), background var(--t);
  white-space: nowrap;
}

.active-filter__clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.active-filter[hidden] { display: none; }

/* ─── Blog post ───────────────────────────────────────── */
.post-wrap {
  padding-top: calc(var(--nav-h) + 56px);
  padding-bottom: 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
}

@media (min-width: 900px) {
  .post-wrap { grid-template-columns: minmax(0, var(--prose-w)) 220px; gap: 80px; align-items: start; }
}

.post-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 32px;
  margin-bottom: 48px;
}

.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

.post-meta__date,
.post-meta__readtime { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.post-meta__cat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-s);
  padding: 2px 9px;
}

.post-title {
  font-family: var(--font-mono);
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.post-excerpt { font-size: 17px; color: var(--text-muted); line-height: 1.7; font-weight: 300; }

.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }

/* ─── Prose ──────────────────────────────────────────── */
.prose { font-size: 16.5px; color: var(--text-muted); line-height: 1.85; }

.prose h2 {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 52px 0 16px;
}

.prose h3 { font-family: var(--font-sans); font-size: 17px; font-weight: 600; color: var(--text); margin: 36px 0 12px; }
.prose p { margin-bottom: 22px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 500; }
.prose em { font-style: italic; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-hover); }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 22px; }
.prose li { margin-bottom: 8px; }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--code);
  background: var(--code-bg);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius-s);
  padding: 2px 6px;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 28px 0;
}

.prose pre code { background: none; border: none; padding: 0; font-size: 13.5px; line-height: 1.65; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 20px;
  margin: 28px 0;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

.prose blockquote p { color: var(--text); margin: 0; font-style: italic; }

/* ─── Post nav ───────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-mid);
}

.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--t), transform var(--t);
}

.post-nav__link:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post-nav__link--next { text-align: right; }
.post-nav__dir { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.post-nav__title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }

/* ─── Post / project sidebar ─────────────────────────── */
.post-sidebar,
.project-sidebar { position: sticky; top: calc(var(--nav-h) + 28px); }

/* ─── Meta card (shared sidebar widget) ──────────────── */
.meta-card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-card__key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.meta-card__val { font-size: 14.5px; font-weight: 500; color: var(--text); line-height: 1.4; }
.meta-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.tag-link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--code);
  background: var(--code-bg);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius-s);
  padding: 3px 9px;
  text-decoration: none;
  transition: border-color var(--t), background var(--t);
}

.tag-link:hover { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); }

/* ─── Certifications ─────────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) { .cert-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cert-grid { grid-template-columns: repeat(3, 1fr); } }

.cert-card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--t), transform var(--t);
}

.cert-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.cert-card__year { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); letter-spacing: 0.04em; }
.cert-card__title { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; }
.cert-card__issuer { font-size: 13.5px; color: var(--text-muted); }

.cert-card__id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ─── Projects index ─────────────────────────────────── */
.project-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

.projects-empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  padding: 40px 0;
  display: none;
}

.projects-empty.is-visible { display: block; }

/* ─── Project detail ─────────────────────────────────── */
.project-header {
  padding: calc(var(--nav-h) + 60px) 0 56px;
  border-bottom: 1px solid var(--border);
}

.project-header__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }

.project-header__cat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-s);
  padding: 3px 10px;
}

.project-header__year { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.project-title {
  font-family: var(--font-mono);
  font-size: clamp(24px, 3.8vw, 44px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.project-summary {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 680px;
  font-weight: 300;
  margin-bottom: 20px;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.project-body {
  padding: 64px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}

@media (min-width: 900px) {
  .project-body { grid-template-columns: minmax(0, var(--prose-w)) 220px; gap: 80px; align-items: start; }
}

.project-sections { display: flex; flex-direction: column; gap: 48px; }

.project-section__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.project-section__title { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 16px; }

.project-section__body { font-size: 15.5px; color: var(--text-muted); line-height: 1.85; }
.project-section__body p { margin-bottom: 16px; }
.project-section__body p:last-child { margin-bottom: 0; }
.project-section__body strong { color: var(--text); font-weight: 500; }
.project-section__body ul { padding-left: 20px; margin-top: 12px; }
.project-section__body li { margin-bottom: 8px; }

.section-divider { border: none; border-top: 1px solid var(--border-mid); margin: 0; }

.related { border-top: 1px solid var(--border); padding-top: 56px; padding-bottom: 80px; }

.related__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.related-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }

.related-card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: border-color var(--t), transform var(--t);
}

.related-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.related-card__title { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.related-card__body { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }

/* ─── Footer ─────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

.footer__row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 640px) {
  .footer__row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer__copy { font-size: 13px; color: var(--text-faint); }

.footer__copy em {
  font-style: normal;
  font-family: var(--font-mono);
  color: var(--text-faint);
}

.footer__nav { display: flex; gap: 24px; list-style: none; }

.footer__nav a {
  font-size: 13px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--t);
}

.footer__nav a:hover { color: var(--text-muted); }

/* ─── Fade-in animation ──────────────────────────────── */
.fi {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.fi.on {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html               { scroll-behavior: auto; }
  .fi                { opacity: 1; transform: none; transition: none; }
  .hero__cursor      { animation: none; }
  .hero__dot         { animation: none; }
  .hero__scroll-line { animation: none; }
  .btn               { transition: none; }
  .card              { transition: none; }
}

/* ─── Focus visible ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* ─── Screen reader utility ──────────────────────────── */
.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
