/* ==========================================================================
   Zikra Amin — portfolio
   assets/css/style.css
   "Signal": dark-first, Sora over IBM Plex, indigo accent, data-grid motif.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/sora-var.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plex-sans-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/plex-sans-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/plex-sans-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plex-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/plex-mono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans Bengali';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/noto-bengali-400.woff2') format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+1CD0, U+200C-200D, U+25CC, U+A8F1;
}

@font-face {
  font-family: 'Noto Sans Bengali';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/noto-bengali-600.woff2') format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+1CD0, U+200C-200D, U+25CC, U+A8F1;
}

/* --------------------------------------------------------------------------
   2. Tokens — dark is the default
   -------------------------------------------------------------------------- */

:root,
[data-theme='dark'] {
  --bg: #0a0c14;
  --surface: #10131e;
  --elevated: #151a28;
  --chip: #171c2e;
  --ink: #e7e9f4;
  --muted: #8b92ac;
  --rule: #1e2434;
  --rule-strong: #2c3346;
  --accent: #7f8bf8;
  --accent-ink: #98a2fa;
  --accent-rgb: 127, 139, 248;
  --on-accent: #0a0c14;
  --gold: #d8b25f;
  --gold-soft: #191610;
  --overlay: rgba(4, 5, 10, 0.94);
  --shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f1f2f8;
  --surface: #ffffff;
  --elevated: #f7f8fc;
  --chip: #e6e8fa;
  --ink: #11131e;
  --muted: #535a74;
  --rule: #dfe2ee;
  --rule-strong: #c6cbdd;
  --accent: #3b47c4;
  --accent-ink: #333ead;
  --accent-rgb: 59, 71, 196;
  --on-accent: #ffffff;
  --gold: #7c5e18;
  --gold-soft: #fbf6e8;
  --overlay: rgba(10, 12, 20, 0.92);
  --shadow: 0 24px 60px -38px rgba(17, 19, 30, 0.5);
  color-scheme: light;
}

:root {
  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-bn: 'Noto Sans Bengali', 'Nirmala UI', 'Vrinda', var(--font-body);

  --shell: 1200px;
  --gutter: 3.75rem;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --header-h: 4.75rem;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

body.is-locked {
  overflow: hidden;
}

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

p {
  margin: 0;
}

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

img {
  max-width: 100%;
  display: block;
}

figure {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

.bn {
  font-family: var(--font-bn);
  line-height: 1.8;
}

.mono {
  font-family: var(--font-mono);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .masthead {
    background: var(--bg);
  }
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark span {
  color: var(--accent);
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navlinks a {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  padding-block: 0.35rem;
  transition: color 0.2s var(--ease);
}

.navlinks a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.navlinks a:hover,
.navlinks a.is-current {
  color: var(--ink);
}

.navlinks a:hover::after,
.navlinks a.is-current::after {
  transform: scaleX(1);
}

.masthead__tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  min-width: 44px;
  padding-inline: 0.875rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--rule-strong);
}

.theme-toggle svg,
.nav-burger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.theme-toggle svg {
  stroke: var(--accent);
}

.theme-toggle .icon-moon,
.theme-toggle .label-dark {
  display: none;
}

[data-theme='light'] .theme-toggle .icon-moon,
[data-theme='light'] .theme-toggle .label-dark {
  display: inline;
}

[data-theme='light'] .theme-toggle .icon-sun,
[data-theme='light'] .theme-toggle .label-light {
  display: none;
}

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-burger svg {
  stroke: currentColor;
  width: 18px;
  height: 18px;
}

.nav-burger .icon-close {
  display: none;
}

.nav-burger[aria-expanded='true'] .icon-close {
  display: block;
}

.nav-burger[aria-expanded='true'] .icon-menu {
  display: none;
}

/* --------------------------------------------------------------------------
   5. Section scaffolding
   -------------------------------------------------------------------------- */

.section {
  padding-block: 5rem;
}

.section--rule {
  border-top: 1px solid var(--rule);
}

.section--surface {
  background: var(--surface);
  border-block: 1px solid var(--rule);
}

.section__head {
  margin-bottom: 2.75rem;
}

.section__kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 0.875rem;
}

.section__title {
  font-size: clamp(1.875rem, 3.6vw, 2.625rem);
  font-weight: 800;
}

.section__lede {
  margin-top: 1rem;
  max-width: 58ch;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 6vw, 4.75rem) 3.5rem;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.25rem 0.8125rem;
  border-radius: var(--r-sm);
  background: var(--chip);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
}

.hero__name {
  margin-top: 1.5rem;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
  overflow-wrap: normal;
}

.hero__claim {
  margin-top: 1.125rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.34;
  color: var(--accent-ink);
  max-width: 24ch;
}

.hero__body {
  margin-top: 1.375rem;
  color: var(--muted);
  max-width: 56ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__portrait {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 0.625rem;
}

.hero__portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}

.hero__tagstrip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.375rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.hero__tagstrip span:last-child {
  color: var(--accent);
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.125rem;
  padding-inline: 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.btn--solid {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--solid:hover {
  background: var(--accent-ink);
}

.btn--line {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn--line:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   7. Metrics + award
   -------------------------------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.metrics > div {
  padding: 1.5rem;
  border-right: 1px solid var(--rule);
}

.metrics > div:last-child {
  border-right: 0;
}

.metrics dt {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--accent);
  line-height: 1;
}

.metrics dd {
  margin: 0.4375rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.award {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-top: 1.25rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--gold);
  border-radius: var(--r-md);
  background: var(--gold-soft);
}

.award svg {
  width: 34px;
  height: 34px;
  flex: none;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.award__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--gold);
}

.award__sub {
  margin-top: 0.3125rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   8. Focus grid
   -------------------------------------------------------------------------- */

.focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.focus__item {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
}

.focus__item h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.focus__bn {
  margin-top: 0.375rem;
  font-family: var(--font-bn);
  font-size: 0.9375rem;
  color: var(--accent-ink);
}

.focus__item p {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   9. Projects
   -------------------------------------------------------------------------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.125rem;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.25s var(--ease);
}

.project:hover {
  border-color: var(--rule-strong);
}

.project__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.project__title {
  margin-top: 0.75rem;
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.project__role {
  margin-top: 0.4375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  opacity: 0.85;
}

.project p.project__text {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.linkpill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.875rem;
  padding-inline: 0.6875rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.linkpill:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   10. Career
   -------------------------------------------------------------------------- */

.career__item {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2.25rem;
  padding-top: 1.75rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.career__item:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.career__when {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  padding-top: 0.3rem;
}

.career__role {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.career__org {
  margin-top: 0.3125rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.career__points {
  margin-top: 0.875rem;
  display: grid;
  gap: 0.4375rem;
  max-width: 68ch;
}

.career__points li {
  position: relative;
  padding-left: 1.125rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.career__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 2px;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   11. Research + matrix
   -------------------------------------------------------------------------- */

.research__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 2.5rem;
  align-items: start;
}

.publist {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.pub {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.375rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.pub:last-child {
  border-bottom: 0;
}

.pub__venue {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 0.25rem;
}

.pub__title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--ink);
}

a.pub__title:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pub__meta {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.matrix-card {
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.matrix {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3px;
}

.matrix i {
  display: block;
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(var(--accent-rgb), 0.06);
}

.matrix-card__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
}

.matrix-card__foot span:last-child {
  color: var(--accent);
}

.matrix-card p {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   12. Columns (credentials, leadership)
   -------------------------------------------------------------------------- */

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem;
}

.column__label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}

.column__item {
  padding-block: 0.9375rem;
  border-bottom: 1px solid var(--rule);
}

.column__item h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.column__item p {
  margin-top: 0.3125rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.column__item .mark {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

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

.skillrow {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.skillrow:last-child {
  border-bottom: 0;
}

.skillrow__name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
}

.skillrow__set {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--elevated);
  font-size: 0.875rem;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   14. Gallery
   -------------------------------------------------------------------------- */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.fchip {
  height: 2.375rem;
  padding-inline: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.fchip:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.fchip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery__item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.25s var(--ease);
}

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

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.gallery__item:hover img {
  transform: scale(1.04);
}

.gallery__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem 0.875rem 0.8125rem;
  background: linear-gradient(to top, rgba(6, 7, 12, 0.9), rgba(6, 7, 12, 0));
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.gallery__item:hover .gallery__cap,
.gallery__item:focus-visible .gallery__cap {
  opacity: 1;
  transform: none;
}

.gallery__slot {
  cursor: default;
  border-style: dashed;
  background: var(--elevated);
  display: grid;
  place-content: center;
  gap: 0.375rem;
  padding: 1.25rem;
  text-align: center;
}

.gallery__slot:hover {
  border-color: var(--rule);
}

.gallery__slot svg {
  width: 24px;
  height: 24px;
  margin-inline: auto;
  stroke: var(--rule-strong);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery__slot b {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.gallery__slot code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  opacity: 0.75;
  word-break: break-all;
}

.gallery__item[hidden] {
  display: none;
}

/* Lightbox ---------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

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

.lightbox__frame {
  max-width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  width: auto;
  height: auto;
  margin-inline: auto;
  border-radius: var(--r-md);
  background: #06070c;
}

.lightbox__cap {
  color: #e7e9f4;
  font-size: 0.9375rem;
  text-align: center;
}

.lightbox__count {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #8b92ac;
}

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: grid;
  place-content: center;
  border: 1px solid rgba(231, 233, 244, 0.25);
  border-radius: var(--r-sm);
  background: rgba(16, 19, 30, 0.7);
  color: #e7e9f4;
  cursor: pointer;
}

.lightbox__btn:hover {
  background: rgba(16, 19, 30, 0.95);
}

.lightbox__btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox__prev {
  left: clamp(0.5rem, 2vw, 1.75rem);
}

.lightbox__next {
  right: clamp(0.5rem, 2vw, 1.75rem);
}

.lightbox__close {
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  transform: none;
}

/* --------------------------------------------------------------------------
   15. Contact + footer
   -------------------------------------------------------------------------- */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

.contact__hed {
  font-size: clamp(1.75rem, 3.2vw, 2.375rem);
  font-weight: 800;
  max-width: 17ch;
}

.contact__note {
  margin-top: 1.125rem;
  color: var(--muted);
  max-width: 44ch;
}

.contactlist__row {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  padding-block: 1.0625rem;
  border-top: 1px solid var(--rule);
  color: var(--ink);
}

.contactlist__row:last-child {
  border-bottom: 1px solid var(--rule);
}

a.contactlist__row:hover .contactlist__value {
  color: var(--accent-ink);
}

.contactlist__icon {
  width: 2.375rem;
  height: 2.375rem;
  flex: none;
  display: grid;
  place-content: center;
  border-radius: var(--r-sm);
  background: var(--chip);
}

.contactlist__icon svg {
  width: 17px;
  height: 17px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contactlist__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.contactlist__value {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.copy-btn {
  margin-left: auto;
  flex: none;
  height: 34px;
  padding-inline: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.colophon {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding-block: 2.25rem;
}

.colophon__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.colophon a {
  color: var(--muted);
}

.colophon a:hover {
  color: var(--accent-ink);
}

.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 55;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
    visibility 0.3s var(--ease);
}

.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   16. Page head (gallery, blog)
   -------------------------------------------------------------------------- */

.pagehead {
  padding-block: clamp(2.75rem, 5vw, 4rem) 2.5rem;
}

.pagehead__title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.pagehead__lede {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 58ch;
  font-size: 1.0625rem;
}

/* --------------------------------------------------------------------------
   17. Blog
   -------------------------------------------------------------------------- */

.postlist {
  display: grid;
}

.postcard {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 2rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
  align-items: start;
}

.postcard:last-child {
  border-bottom: 1px solid var(--rule);
}

.postcard__thumb {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--elevated);
}

.postcard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.postcard__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.postcard__title {
  margin-top: 0.5rem;
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-weight: 700;
  color: var(--ink);
}

.postcard a:hover .postcard__title {
  color: var(--accent-ink);
}

.postcard__excerpt {
  margin-top: 0.6875rem;
  color: var(--muted);
  max-width: 64ch;
  font-size: 0.9375rem;
}

.postcard__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
  margin-top: 0.875rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding-inline: 0.6875rem;
  border-radius: var(--r-sm);
  background: var(--chip);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.blog-status {
  padding-block: 3.5rem;
  text-align: center;
  color: var(--muted);
}

.blog-status h3 {
  font-size: 1.375rem;
  color: var(--ink);
  margin-bottom: 0.625rem;
}

.blog-status code {
  display: inline-block;
  margin-top: 0.375rem;
  padding: 0.1875rem 0.4375rem;
  border-radius: 5px;
  background: var(--chip);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.spinner {
  width: 24px;
  height: 24px;
  margin: 0 auto 0.875rem;
  border: 2px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loadmore-wrap {
  display: flex;
  justify-content: center;
  padding-top: 2.25rem;
}

.article {
  max-width: 44rem;
  margin-inline: auto;
  padding-block: 2.5rem 4rem;
}

.article__title {
  font-size: clamp(2rem, 4.4vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.article__meta {
  margin-top: 0.875rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.article__body {
  margin-top: 2rem;
  font-size: 1.0625rem;
  line-height: 1.78;
}

.article__body p,
.article__body ul,
.article__body ol,
.article__body blockquote,
.article__body pre,
.article__body table {
  margin-block: 1.25rem;
}

.article__body h1,
.article__body h2,
.article__body h3 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.article__body h2 {
  font-size: 1.625rem;
}

.article__body h3 {
  font-size: 1.3125rem;
}

.article__body img {
  height: auto;
  border-radius: var(--r-md);
  margin-inline: auto;
}

.article__body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article__body ul,
.article__body ol {
  padding-left: 1.25rem;
  list-style: revert;
}

.article__body li {
  margin-block: 0.375rem;
}

.article__body blockquote {
  padding: 0.25rem 0 0.25rem 1.375rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.article__body pre {
  padding: 1.125rem;
  border-radius: var(--r-md);
  background: var(--elevated);
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.article__body iframe {
  max-width: 100%;
  border-radius: var(--r-md);
}

.article__foot {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  :root {
    --gutter: 2.5rem;
  }

  .research__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .matrix-card {
    position: static;
    max-width: 22rem;
  }

  .focus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --gutter: 1.75rem;
    --header-h: 4.25rem;
  }

  .section {
    padding-block: 3.5rem;
  }

  .navlinks {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem var(--gutter) 1.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .navlinks.is-open {
    transform: none;
  }

  .navlinks a {
    padding-block: 0.875rem;
    border-bottom: 1px solid var(--rule);
    font-size: 1.0625rem;
  }

  .navlinks a::after {
    display: none;
  }

  .nav-burger {
    display: inline-flex;
  }

  .hero__grid,
  .contact__grid,
  .projects {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__portrait {
    max-width: 12rem;
    order: -1;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics > div:nth-child(2) {
    border-right: 0;
  }

  .metrics > div:nth-child(1),
  .metrics > div:nth-child(2) {
    border-bottom: 1px solid var(--rule);
  }

  .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .award {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  :root {
    --gutter: 1.125rem;
  }

  body {
    font-size: 1rem;
  }

  .career__item,
  .pub,
  .skillrow,
  .postcard,
  .focus,
  .columns,
  .gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .career__item {
    padding-top: 1.375rem;
    margin-top: 1.375rem;
  }

  .postcard__thumb {
    aspect-ratio: 16 / 9;
  }

  .hero__actions .btn {
    flex: 1 1 100%;
  }

  .theme-toggle {
    padding-inline: 0;
    width: 44px;
  }

  .theme-toggle span {
    display: none;
  }

  [data-theme='light'] .theme-toggle .label-dark {
    display: none;
  }

  .award {
    flex-direction: column;
    gap: 1rem;
  }

  .to-top {
    right: 1rem;
    bottom: 1rem;
  }
}

/* --------------------------------------------------------------------------
   19. Motion + print
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(1rem);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .masthead,
  .to-top,
  .theme-toggle,
  .nav-burger,
  .lightbox,
  .hero__actions,
  .gallery-filters,
  .loadmore-wrap,
  .matrix-card {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .section {
    padding-block: 1.25rem;
    break-inside: avoid;
  }

  a {
    color: #000;
  }
}
