/* ==========================================================================
   Bala Dengale — personal site + blog
   Design tokens
   ========================================================================== */
:root {
  /* dark (default) */
  --bg: #0d1117;
  --bg-soft: #131a23;
  --bg-card: #161f2b;
  --border: #263241;
  --text: #dbe4ef;
  --text-dim: #8b9bb0;
  --accent: #58b6ff;
  --accent-2: #7ee0c3;
  --accent-warm: #ffb86b;
  --code-bg: #0a0e14;
  --header-bg: rgba(13, 17, 23, 0.85);
  --strong: #ffffff;
  --pre-code: #c9d5e3;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --max-w: 960px;
  --radius: 12px;
}

:root[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-soft: #eef1f4;
  --bg-card: #ffffff;
  --border: #d8dee4;
  --text: #1a2230;
  --text-dim: #5b6675;
  --accent: #0969da;
  --accent-2: #1a7f72;
  --accent-warm: #b35900;
  --code-bg: #eef1f4;
  --header-bg: rgba(246, 248, 250, 0.85);
  --strong: #0b0f14;
  --pre-code: #333a47;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; border-radius: var(--radius); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------------------
   Site header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.site-nav .brand {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.site-nav .brand:hover { text-decoration: none; }
.brand-name .dot { color: var(--accent); }
.brand-desc {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
}
.site-nav ul { display: flex; gap: 26px; list-style: none; }
.site-nav ul a {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.site-nav ul a:hover { color: var(--text); text-decoration: none; }
.site-nav ul a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* hamburger toggle (mobile only) */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.12s;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  margin: 2.5px 0;
  transition: transform 0.2s, opacity 0.2s;
}
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
/* longhand on purpose: side gutters come from .container so the hero
   never touches the screen edge (padding shorthand would zero them) */
.hero { padding-top: 88px; padding-bottom: 64px; }
.hero-grid > *, .skill-grid > *, .facts > *, .flagship-grid > * { min-width: 0; }

/* status pill (hero) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.status-pill .pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2.2s infinite;
}
.status-pill b { color: var(--text); font-weight: 600; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(126, 224, 195, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(126, 224, 195, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 224, 195, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .status-pill .pulse { animation: none; }
}

.hero .kicker {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 30px;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(92deg, #1f6feb, #2ea3a2); color: #fff; border: none; }
.btn-ghost { color: var(--text); background: var(--bg-card); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 44px;
}
.fact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.fact .k { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim); }
.fact .v { font-weight: 600; margin-top: 4px; }

/* --------------------------------------------------------------------------
   Flagship initiative card (home — VKS Polaris)
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 10px;
}
.flagship {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  position: relative;
  overflow: hidden;
}
.flagship::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
}
.flagship-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 34px;
  align-items: start;
}
.flagship h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.flagship h2 .grad {
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.flagship .blurb { color: var(--text-dim); font-size: 0.98rem; }
.flagship .blurb + .blurb { margin-top: 12px; }
.flagship .fine {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.section .sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: -14px 0 32px;
  max-width: 640px;
}
.chapters {
  margin-top: 20px;
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.hl-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.hl-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.hl-list li { display: flex; gap: 13px; align-items: flex-start; }
.hl-list .ico {
  flex: none;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.hl-list b { display: block; font-size: 0.93rem; color: var(--text); }
.hl-list .d { font-size: 0.83rem; color: var(--text-dim); line-height: 1.5; }

/* stat band */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.stat .n {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .l {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section h2 {
  font-size: 1.6rem;
  font-weight: 750;
  margin-bottom: 26px;
  letter-spacing: -0.01em;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
/* home: exactly 4 domains → clean 2×2 on desktop */
.skill-grid.domains { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.skill-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s, transform 0.12s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.skill-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--accent-2); }
.skill-card p { font-size: 0.9rem; color: var(--text-dim); overflow-wrap: break-word; }
.skill-card.ai::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
}
.skill-card.ai::after {
  content: "AI";
  float: right;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 1px 7px;
  opacity: 0.85;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-soft);
}

/* --------------------------------------------------------------------------
   Blog listing
   -------------------------------------------------------------------------- */
.page-head { padding: 64px 0 16px; }
.page-head h1 { font-size: 2.3rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.page-head p { color: var(--text-dim); max-width: 620px; }

.post-list { display: flex; flex-direction: column; gap: 18px; padding: 32px 0 72px; }
.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s, transform 0.12s;
}
.post-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.post-card .meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.post-card .meta .dot { color: var(--border); }
.post-card h2 { font-size: 1.25rem; line-height: 1.35; margin-bottom: 10px; }
.post-card:hover h2 { color: var(--accent); }
.post-card p.excerpt { color: var(--text-dim); font-size: 0.95rem; }
.tag-sm {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
  background: var(--bg-soft);
}

/* --------------------------------------------------------------------------
   Work experience timeline
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 26px; margin-top: 18px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.45;
}
.job { position: relative; padding: 0 0 40px 24px; }
.job::before {
  content: "";
  position: absolute;
  left: -26px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.job .when {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-warm);
  letter-spacing: 0.05em;
}
.job h3 { font-size: 1.15rem; margin: 4px 0 2px; }
.job .where { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 12px; }
.job ul { margin: 10px 0 0 18px; color: var(--text-dim); font-size: 0.94rem; }
.job ul li { margin-bottom: 6px; }
.job ul li::marker { color: var(--accent); }

/* --------------------------------------------------------------------------
   Blog post (rich content typography)
   -------------------------------------------------------------------------- */
/* longhand: side gutters come from .container */
.post-header { padding-top: 64px; padding-bottom: 4px; max-width: 760px; margin: 0 auto; }
.post-header .meta {
  display: flex; gap: 14px; align-items: center;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-dim); flex-wrap: wrap;
}
.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 14px 0 10px;
}
.post-header .subtitle { font-size: 1.1rem; color: var(--text-dim); font-style: italic; }
.post-header .tag-row { margin: 16px 0 0; }

.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 84px;
  font-size: 1.06rem;
  line-height: 1.78;
}
.article h2 {
  font-size: 1.55rem;
  margin: 48px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.article h3 { font-size: 1.2rem; margin: 34px 0 12px; color: var(--accent-2); }
.article h4 { font-size: 1.02rem; margin: 26px 0 10px; color: var(--accent-warm); }
.article p { margin: 0 0 20px; }
.article strong { color: var(--strong); }
.article blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  padding: 14px 20px;
  border-radius: 0 10px 10px 0;
  margin: 24px 0;
  color: var(--text-dim);
  font-style: italic;
}
.article blockquote p { margin: 0; }
.article ul, .article ol { margin: 0 0 20px 24px; }
.article li { margin-bottom: 8px; }
.article li::marker { color: var(--accent); }
.article code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--accent-warm);
}
.article pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 26px 0;
  line-height: 1.55;
}
.article pre code { background: none; border: none; padding: 0; color: var(--pre-code); font-size: 0.86rem; }
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  font-size: 0.94rem;
  display: block;
  overflow-x: auto;
}
.article th, .article td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.article th { background: var(--bg-card); color: var(--accent-2); font-weight: 650; }
.article tr:nth-child(even) td { background: var(--bg-soft); }
.article hr { border: none; border-top: 1px solid var(--border); margin: 44px 0; }
.article img { margin: 10px 0; }
.article .toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 36px;
}
.article .toc h4 { margin: 0 0 10px; color: var(--text); }
.article .toc ul { margin: 0 0 0 4px; list-style: none; }
.article .toc li { margin-bottom: 6px; }
.article .toc a { font-size: 0.94rem; color: var(--text-dim); }
.article .toc a:hover { color: var(--accent); }

.post-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 88px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.post-footer .btn { min-width: 200px; justify-content: center; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.site-footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer .links { display: flex; gap: 20px; flex-wrap: wrap; }
@media (max-width: 768px) {
  .site-footer .links { gap: 12px 16px; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .site-nav ul { gap: 16px; }
  .hero { padding: 56px 0 40px; }
  .article { font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   Theme toggle (top-right of nav)
   -------------------------------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.12s, border-color 0.12s;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* --------------------------------------------------------------------------
   Hero with portrait (home)
   -------------------------------------------------------------------------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 44px;
  align-items: center;
}
.hero-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

/* --------------------------------------------------------------------------
   Life page — family, hobbies, collage gallery
   -------------------------------------------------------------------------- */
.family {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  align-items: center;
}
.family img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.family h3 { font-size: 1.05rem; margin-bottom: 6px; }
.family p { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 8px; }

/* compact horizontal hobby tiles */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.hobby-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.hobby-card .emoji { font-size: 1.5rem; flex: none; }
.hobby-card h3 { font-size: 0.95rem; margin: 0 0 3px; color: var(--accent-2); }
.hobby-card p { font-size: 0.82rem; color: var(--text-dim); margin: 0; }

/* collage gallery — dense grid, feature tiles span wider */
.gallery-group { margin-bottom: 36px; }
.gallery-group h3 {
  font-size: 1.02rem;
  color: var(--accent-2);
  margin-bottom: 12px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  grid-auto-rows: 150px;
  grid-auto-flow: dense;
  gap: 10px;
}
.gallery figure {
  position: relative;
  margin: 0;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.gallery figure.wide { grid-column: span 2; }
.gallery figure.tall { grid-row: span 2; }
.gallery figure.feature { grid-column: span 2; grid-row: span 2; }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 12px 9px;
  font-size: 0.75rem;
  color: #eaf2fb;
  line-height: 1.35;
  background: linear-gradient(180deg, transparent, rgba(4, 10, 18, 0.85));
  pointer-events: none;
}
.gallery figcaption .when {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--accent);
  margin-bottom: 1px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 8, 14, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #e6edf3;
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.55);
  padding: 7px 16px;
  border-radius: 999px;
  max-width: 90%;
  text-align: center;
}
.lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 26px;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
}

/* Mobile hardening — keep every card visually distinct: borders, shadows
   and inner padding are reasserted so nothing flattens out on small
   viewports (fix: cards losing their edges on mobile). */
@media (max-width: 768px) {
  .container { padding: 0 28px; }
  main { overflow-x: hidden; }

  /* hamburger menu: links collapse into a panel under the header */
  .site-nav { flex-wrap: nowrap; height: auto; padding: 10px 0; gap: 14px; }
  .nav-right { margin-left: auto; gap: 10px; }
  .brand-desc { white-space: normal; font-size: 0.58rem; line-height: 1.45; max-width: 46vw; }
  .nav-toggle { display: inline-flex; }
  .site-nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
    padding: 10px 20px 16px;
    display: none;
  }
  .site-header.nav-open ul { display: flex; }
  .site-nav ul a {
    display: block;
    font-size: 1rem;
    padding: 13px 4px;
    border-bottom: 1px solid var(--border);
  }
  .site-nav ul li:last-child a { border-bottom: none; }
  .site-nav ul a.active { border-bottom-color: transparent; border-bottom-width: 1px; }

  .hero { padding-top: 64px; padding-bottom: 48px; }
  .hero h1 { font-size: clamp(1.85rem, 7vw, 2.25rem); line-height: 1.22; margin-bottom: 16px; }
  .hero p.lede { font-size: 1rem; line-height: 1.72; margin-bottom: 26px; }
  .hero .cta-row { gap: 10px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-avatar { width: 132px; height: 132px; }
  .hero .cta-row .btn { flex: 1 1 auto; justify-content: center; padding: 10px 16px; }
  .status-pill {
    font-size: 0.7rem;
    padding: 6px 12px;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .section { padding: 52px 0; }
  .section h2 { font-size: 1.35rem; }
  .flagship h2 { font-size: 1.25rem; }
  .flagship .eyebrow { font-size: 0.68rem; letter-spacing: 0.12em; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
  .stat { padding: 10px 8px; border-radius: 8px; }
  .stat .n { font-size: 1.3rem; }
  .stat .l { font-size: 0.6rem; letter-spacing: 0.04em; }

  /* card integrity: border + shadow + padding preserved on mobile */
  .skill-card, .fact, .post-card, .flagship, .stat, .hobby-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
    min-width: 0;
    overflow-wrap: break-word;
  }
  .skill-card, .fact, .post-card { padding: 20px 18px; }
  .post-footer .btn { flex: 1 1 auto; min-width: 0; }
  .flagship { padding: 22px 18px; }
  .flagship-grid { grid-template-columns: 1fr; gap: 24px; }
  .hl-list .d { overflow-wrap: break-word; }
  .tag { max-width: 100%; white-space: normal; }

  .skill-grid, .hobby-grid { grid-template-columns: 1fr; }
  .skill-grid.domains { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .family { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 130px; }
  .gallery figure.feature { grid-column: span 2; grid-row: span 2; }
  .article { font-size: 1rem; padding: 36px 28px 84px; }
  .post-footer { padding: 28px 28px 88px; }
  .page-head p { line-height: 1.75; }
  .hero p.lede { line-height: 1.75; }
}
