/* ==========================================================================
   Md Hasan — personal site
   Hand-written static CSS. No build step.
   Palette: dark-first, single violet→cyan accent, light theme via [data-theme].
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */

:root {
  /* Dark (default) */
  --bg:            #0a0c10;
  --bg-soft:       #0f1218;
  --surface:       #14181f;
  --surface-2:     #1a1f28;
  --border:        #232935;
  --border-strong: #2f3745;

  --text:          #e8ecf3;
  --text-soft:     #b8c1cf;
  --muted:         #8b95a5;

  --accent:        #8b7cff;
  --accent-2:      #34d9f0;
  --accent-soft:   rgba(139, 124, 255, 0.14);
  --accent-line:   rgba(139, 124, 255, 0.35);
  --on-accent:     #0a0c10;

  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, .7);
  --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, .8);

  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --wrap: 1120px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);

  --font-sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:            #fbfbfd;
  --bg-soft:       #f4f5f9;
  --surface:       #ffffff;
  --surface-2:     #f5f6fa;
  --border:        #e3e6ee;
  --border-strong: #cdd3e0;

  --text:          #10141c;
  --text-soft:     #3d4553;
  --muted:         #667085;

  --accent:        #5a45e0;
  --accent-2:      #0c9fc4;
  --accent-soft:   rgba(90, 69, 224, 0.10);
  --accent-line:   rgba(90, 69, 224, 0.28);
  --on-accent:     #ffffff;

  --shadow-sm: 0 1px 2px rgba(16, 20, 28, .06);
  --shadow-md: 0 12px 28px -14px rgba(16, 20, 28, .22);
  --shadow-lg: 0 30px 60px -28px rgba(16, 20, 28, .28);

  color-scheme: light;
}

/* ----------------------------------------------------------- 2. Base reset */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

img, svg, video { display: block; max-width: 100%; height: auto; }

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

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--on-accent); }

/* Scrollbar (WebKit) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ------------------------------------------------------- 3. Typography */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); }

p { text-wrap: pretty; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------- 4. Layout */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--flush-bottom { padding-bottom: 0; }
.section + .section { padding-top: 0; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--grad);
}

.section-sub {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.02rem;
}

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0;
}

/* -------------------------------------------------------------- 5. Nav */

.skip-link {
  position: absolute;
  left: .75rem;
  top: -100px;
  z-index: 999;
  padding: .65rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: .75rem; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.01em;
  font-size: 1.02rem;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--grad);
  color: #08090c;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: -.03em;
  box-shadow: 0 4px 14px -4px var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: .2rem;
  list-style: none;
  padding: 0;
}
.nav__links a {
  position: relative;
  display: block;
  padding: .5rem .82rem;
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-size: .92rem;
  font-weight: 500;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .18rem;
  translate: -50% 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.nav__actions { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }

.theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun  { display: none; }

.nav__burger { display: none; }

/* ------------------------------------------------------------ 6. Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .78rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease),
              background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary {
  background: var(--grad);
  color: #08090c;
  box-shadow: 0 10px 26px -12px var(--accent);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px var(--accent); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .92rem;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------- 7. Hero */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero__bg::before {
  /* grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .5;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 72%);
}
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .26;
  animation: float 18s var(--ease) infinite alternate;
}
.hero__blob--a {
  width: 460px; height: 460px;
  background: var(--accent);
  top: -170px; right: -60px;
}
.hero__blob--b {
  width: 380px; height: 380px;
  background: var(--accent-2);
  top: 140px; left: -140px;
  opacity: .16;
  animation-delay: -7s;
}
[data-theme="light"] .hero__blob--a { opacity: .16; }
[data-theme="light"] .hero__blob--b { opacity: .11; }

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-30px, 40px, 0) scale(1.12); }
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .38rem .9rem .38rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 500;
}
.status__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, .55);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.hero__title {
  margin-top: 1.5rem;
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.hero__role {
  margin-top: .9rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: -.01em;
}

.hero__bio {
  margin-top: 1.3rem;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.04rem;
}
.hero__bio strong { color: var(--text-soft); font-weight: 600; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.socials {
  display: flex;
  gap: .5rem;
  margin-top: 1.75rem;
}
.socials a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.socials a:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }

/* Portrait */
.portrait { position: relative; justify-self: center; width: min(330px, 78vw); }
.portrait__glow {
  position: absolute;
  inset: -14%;
  background: var(--grad);
  border-radius: 50%;
  filter: blur(50px);
  opacity: .24;
  animation: float 14s var(--ease) infinite alternate;
}
.portrait__img {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.portrait__ring {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px dashed var(--accent-line);
  animation: spin 38s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.portrait__chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .05em;
  color: var(--text-soft);
  white-space: nowrap;
}
.portrait__chip svg { width: 13px; height: 13px; color: var(--accent); }
.portrait__chip--1 { top: 8%;  left: -12%; animation: bob 6s ease-in-out infinite; }
.portrait__chip--2 { bottom: 12%; right: -14%; animation: bob 6s ease-in-out infinite 3s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

/* -------------------------------------------------------------- 8. Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  padding: 1.5rem 1.25rem;
  background: var(--bg-soft);
  text-align: center;
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------- 9. Cards */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 1.1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card__icon svg { width: 20px; height: 20px; }

.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .95rem; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.15rem;
}

/* Tag pills */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.tag {
  padding: .26rem .68rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .03em;
}

/* --------------------------------------------------------- 10. Timeline */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  padding-left: 2.1rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-line), var(--border) 55%, transparent);
}

.tl-item { position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -2.1rem;
  top: 9px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.tl-item--now::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tl-date {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .73rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tl-role {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.tl-org {
  color: var(--text-soft);
  font-size: .95rem;
  font-weight: 500;
}
.tl-body { margin-top: .6rem; color: var(--muted); font-size: .95rem; max-width: 68ch; }
.tl-body ul { margin: .5rem 0 0; padding-left: 1.15rem; }
.tl-body li { margin-bottom: .3rem; }
.tl-body li::marker { color: var(--accent); }

/* --------------------------------------------------------- 11. Projects */

.proj {
  overflow: hidden;
  padding: 0;
}
.proj__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.proj__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease), filter .4s var(--ease);
}
.proj:hover .proj__media img { transform: scale(1.055); }
.proj__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--surface) 72%, transparent), transparent 58%);
}
.proj__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.proj__meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.proj__body h3 { margin: .5rem 0 .5rem; }
.proj__body p { color: var(--muted); font-size: .94rem; flex: 1; }
.proj__body .tags { margin-bottom: 1.1rem; }

.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ----------------------------------------------------- 12. Publications */

.pub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.35rem;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pub:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }

.pub__year {
  display: grid;
  place-items: center;
  align-self: start;
  min-width: 66px;
  padding: .55rem .5rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.pub__title { font-size: 1.1rem; line-height: 1.35; }
.pub__authors { margin-top: .35rem; color: var(--text-soft); font-size: .9rem; }
.pub__authors .me { color: var(--accent); font-weight: 600; }
.pub__venue {
  margin-top: .25rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pub__abs { margin-top: .75rem; color: var(--muted); font-size: .93rem; }
.pub__links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* ------------------------------------------------------------ 13. Skills */

.skill-group { padding: 1.5rem 1.6rem; }
.skill-group h3 {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.02rem;
  margin-bottom: 1rem;
}
.skill-group h3 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.skill-list { display: flex; flex-wrap: wrap; gap: .45rem; }

/* -------------------------------------------------------------- 14. Blog */

.post-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-block: 1px solid var(--border); }
.post-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem .4rem;
  background: var(--bg);
  transition: background-color .25s var(--ease), padding-inline .25s var(--ease);
}
.post-row:hover { background: var(--surface); padding-inline: 1.1rem .4rem; }
.post-row__date { color: var(--muted); font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; }
.post-row__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
.post-row__desc { margin-top: .25rem; color: var(--muted); font-size: .93rem; }

.empty-state {
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-align: center;
}
.empty-state__icon {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-state__icon svg { width: 24px; height: 24px; }
.empty-state p { color: var(--muted); max-width: 46ch; }

/* ----------------------------------------------------------- 15. Contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: .95rem;
  padding: 1.05rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.contact-card:hover { border-color: var(--accent-line); transform: translateX(4px); }
.contact-card__icon {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.contact-card__icon svg { width: 18px; height: 18px; }
.contact-card__label { color: var(--muted); font-size: .76rem; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.contact-card__value { font-weight: 500; font-size: .97rem; word-break: break-word; }

.form { display: grid; gap: 1.05rem; }
.field { display: grid; gap: .42rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-soft); }
.field input, .field textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: .96rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ------------------------------------------------------------ 16. CTA band */

.cta-band {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-align: center;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: -50% 25% auto;
  height: 320px;
  background: var(--grad);
  filter: blur(90px);
  opacity: .18;
  pointer-events: none;
}
.cta-band h2 { position: relative; }
.cta-band p { position: relative; margin: .85rem auto 0; max-width: 52ch; color: var(--muted); }
.cta-band .hero__cta { position: relative; justify-content: center; }

/* ------------------------------------------------------------ 17. Footer */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
  margin-top: clamp(3rem, 7vw, 5rem);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.footer p { color: var(--muted); font-size: .88rem; }
.footer__links { display: flex; gap: 1.25rem; }
.footer__links a { color: var(--muted); font-size: .88rem; transition: color .2s var(--ease); }
.footer__links a:hover { color: var(--accent); }

/* -------------------------------------------------------- 18. Page header */

.page-head {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
}
.page-head::before {
  content: "";
  position: absolute;
  top: -240px; left: 50%;
  translate: -50% 0;
  width: 620px; height: 380px;
  background: var(--grad);
  filter: blur(110px);
  opacity: .16;
  pointer-events: none;
}
.page-head h1 { position: relative; font-size: clamp(2.1rem, 5.5vw, 3.2rem); }
.page-head p { position: relative; margin-top: .9rem; max-width: 62ch; color: var(--muted); font-size: 1.05rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s var(--ease);
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.back-link:hover svg { transform: translateX(-3px); }

/* ------------------------------------------------------------- 19. Prose */

.prose {
  max-width: 76ch;
  margin-inline: auto;
  color: var(--text-soft);
  font-size: 1.03rem;
}
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  margin-top: 2.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  font-size: 1.6rem;
}
.prose h3 { margin-top: 2rem; font-size: 1.2rem; }
.prose h2 + *, .prose h3 + * { margin-top: .85rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--accent); }
.prose code {
  padding: .14em .42em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: .86em;
  color: var(--text);
}
.prose blockquote {
  padding: .9rem 1.25rem;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: .97rem;
}
.prose blockquote p { margin: 0; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.prose th, .prose td {
  padding: .68rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.prose thead th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 600;
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: var(--surface-2); }
.prose td:not(:first-child) { text-align: right; font-family: var(--font-mono); font-size: .84rem; }

.article-hero {
  aspect-ratio: 21 / 9;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------- 20. Reveal FX */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------- 21. Responsive */

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__bio, .hero__cta, .socials { margin-inline: auto; }
  .hero__cta, .socials { justify-content: center; }
  .portrait { order: -1; width: min(240px, 62vw); margin-bottom: 1rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 80px; }

  .nav__burger { display: grid; }

  .nav__links {
    position: fixed;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__links a { padding: .8rem 1rem; font-size: 1rem; border-radius: var(--radius); }
  .nav__links a.is-active::after { display: none; }
  .nav__links a.is-active { background: var(--accent-soft); color: var(--accent); }

  .post-row { grid-template-columns: 1fr; gap: .45rem; }
  .post-row > svg { display: none; }
  .pub { grid-template-columns: 1fr; gap: .9rem; }
  .pub__year { justify-self: start; }
  .portrait__chip--1 { left: -6%; }
  .portrait__chip--2 { right: -6%; }
}

@media (max-width: 620px) {
  .hero__blob--a { width: 280px; height: 280px; top: -120px; right: -80px; opacity: .20; }
  .hero__blob--b { width: 240px; height: 240px; opacity: .12; }
}

@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero__cta { flex-direction: column; }
}
