/* ==========================================================================
   Md. Moneruzzaman — portfolio
   assets/css/style.css
   Editorial direction: Fraunces display over Karla, warm paper ground,
   oxblood accent, hairline rules.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted — no external requests)
   -------------------------------------------------------------------------- */

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

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/fraunces-var-italic.woff2') format('woff2-variations');
}

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

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

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

@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/karla-700.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
   -------------------------------------------------------------------------- */

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --band: #f1ece3;
  --ink: #1a1714;
  --muted: #5c544a;
  --rule: #ded6c9;
  --rule-strong: #c9bfae;
  --accent: #8c3b2e;
  --accent-ink: #7a3226;
  --accent-soft: rgba(140, 59, 46, 0.09);
  --on-accent: #ffffff;
  --shadow-lift: 0 18px 40px -28px rgba(26, 23, 20, 0.5);
  --overlay: rgba(26, 23, 20, 0.9);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-bn: 'Noto Sans Bengali', 'Nirmala UI', 'Vrinda', var(--font-body);

  --shell: 1180px;
  --gutter: 4.5rem;
  --radius: 5px;
  --radius-lg: 10px;
  --header-h: 5.125rem;

  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
}

[data-theme='dark'] {
  --bg: #161311;
  --surface: #1f1b18;
  --band: #1c1815;
  --ink: #f3ede3;
  --muted: #a89e90;
  --rule: #332d27;
  --rule-strong: #4a4139;
  --accent: #d98a6a;
  --accent-ink: #e39b7d;
  --accent-soft: rgba(217, 138, 106, 0.13);
  --on-accent: #1a1714;
  --shadow-lift: 0 18px 44px -26px rgba(0, 0, 0, 0.85);
  --overlay: rgba(10, 8, 7, 0.93);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   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.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.017em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

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

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

figure {
  margin: 0;
}

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

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

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

.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(--radius);
  font-weight: 700;
  font-size: 0.9375rem;
}

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

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) 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-display);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

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

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

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

.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;
  height: 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.is-current::after,
.navlinks a:hover::after {
  transform: scaleX(1);
}

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

.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: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

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

.theme-toggle svg {
  width: 17px;
  height: 17px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.theme-toggle .icon-sun,
.theme-toggle .label-light {
  display: none;
}

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

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

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

.nav-burger svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.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. Sections
   -------------------------------------------------------------------------- */

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

.section--flat {
  border-top: 0;
}

.section--band {
  background: var(--band);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
}

.section__title {
  font-size: clamp(2rem, 3.4vw, 2.625rem);
}

.section__lede {
  margin-top: 0.875rem;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.0625rem;
}

.section__aside {
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: right;
  flex: none;
  max-width: 22ch;
}

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

.hero {
  padding-block: clamp(3.5rem, 7vw, 5.75rem) 4.5rem;
}

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

.hero__standfirst {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.hero__name {
  margin-top: 1.125rem;
  font-size: clamp(2.375rem, 5.6vw, 4.375rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.04;
  overflow-wrap: normal;
  word-break: keep-all;
}

.hero__deck {
  margin-top: 1.375rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.6875rem);
  line-height: 1.42;
  max-width: 28ch;
}

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

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

.hero__portrait {
  position: relative;
}

.hero__portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--band);
}

[data-theme='dark'] .hero__portrait img {
  filter: brightness(0.92) saturate(0.95);
}

.hero__caption {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hero__caption::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  flex: none;
  transform: translateY(-0.28em);
}

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

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

.btn svg {
  width: 17px;
  height: 17px;
  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(--ink);
  color: var(--bg);
}

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

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

/* --------------------------------------------------------------------------
   7. Figures band
   -------------------------------------------------------------------------- */

.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  padding-block: 2.5rem;
  border-block: 1px solid var(--rule);
  background: var(--band);
}

.figures__item dt {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.6vw, 2.9375rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.figures__item dd {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   8. Prose + interests
   -------------------------------------------------------------------------- */

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

.prose p + p {
  margin-top: 1.125rem;
}

.prose {
  max-width: 62ch;
  color: var(--muted);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.interests {
  display: grid;
  gap: 1.5rem;
}

.interests__item {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.interests__item h3 {
  font-size: 1.1875rem;
}

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

/* --------------------------------------------------------------------------
   9. Project entries
   -------------------------------------------------------------------------- */

.entry {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
}

.entry:first-of-type {
  margin-top: 0;
}

.entry__year {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.2rem;
}

.entry__title {
  font-size: clamp(1.375rem, 2.2vw, 1.625rem);
}

.entry__meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.entry__text {
  margin-top: 0.875rem;
  color: var(--muted);
  max-width: 68ch;
}

.entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.125rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 1.875rem;
  padding-inline: 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

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

.career__item {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2.5rem;
  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-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
  padding-top: 0.3rem;
}

.career__role {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.25;
}

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

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

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

.career__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--rule-strong);
}

/* --------------------------------------------------------------------------
   11. Publication + writing lists
   -------------------------------------------------------------------------- */

.pubgroup + .pubgroup {
  margin-top: 3.25rem;
}

.pubgroup__label {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ink);
}

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

.pub__venue {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.35rem;
}

.pub__title {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.34;
  color: var(--ink);
}

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

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

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

.pub__authors b {
  color: var(--ink);
  font-weight: 600;
}

.writing__title-bn {
  font-family: var(--font-bn);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--ink);
}

.writing__title-en {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--muted);
}

a.writing__link:hover .writing__title-bn,
a.writing__link:hover .writing__title-en {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   12. Credential columns
   -------------------------------------------------------------------------- */

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

.column__label {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1.25rem;
}

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

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

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

.column__item .mark {
  color: var(--accent);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   13. Skill rows
   -------------------------------------------------------------------------- */

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

.skillrow__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding-inline: 0.8125rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

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

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

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

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

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

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

.gallery__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.75rem 1rem 0.875rem;
  background: linear-gradient(to top, rgba(12, 10, 9, 0.88), rgba(12, 10, 9, 0));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  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: translateY(0);
}

/* Empty slot the owner replaces with a real photo */
.gallery__slot {
  cursor: default;
  background: var(--band);
  border-style: dashed;
  display: grid;
  place-content: center;
  gap: 0.375rem;
  padding: 1.5rem;
  text-align: center;
}

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

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

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

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

/* 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%);
  max-height: 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(--radius);
  background: #0c0a09;
}

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

.lightbox__count {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: #a89e90;
}

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-content: center;
  border: 1px solid rgba(243, 237, 227, 0.28);
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.6);
  color: #f3ede3;
  cursor: pointer;
}

.lightbox__btn:hover {
  background: rgba(20, 17, 15, 0.9);
}

.lightbox__btn svg {
  width: 20px;
  height: 20px;
  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 {
  position: absolute;
  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, 4.5rem);
  align-items: start;
}

.contact__hed {
  font-size: clamp(1.875rem, 3.4vw, 2.5rem);
  max-width: 16ch;
}

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

.contactlist {
  display: grid;
}

.contactlist__row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 1.125rem;
  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);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contactlist__icon {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: grid;
  place-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
}

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

.contactlist__label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.contactlist__value {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.copy-btn {
  margin-left: auto;
  flex: none;
  height: 36px;
  padding-inline: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

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

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

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

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

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

.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 55;
  width: 46px;
  height: 46px;
  display: grid;
  place-content: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  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: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   16. Blog
   -------------------------------------------------------------------------- */

.pagehead {
  padding-block: clamp(3rem, 6vw, 4.5rem) 3rem;
}

.pagehead__title {
  font-size: clamp(2.5rem, 5.5vw, 3.75rem);
  letter-spacing: -0.025em;
}

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

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.75rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.chip {
  height: 2.25rem;
  padding-inline: 0.9375rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

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

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

.postlist {
  display: grid;
  gap: 0;
}

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

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

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

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

.postcard__date {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.postcard__title {
  margin-top: 0.5rem;
  font-size: clamp(1.375rem, 2.3vw, 1.75rem);
  color: var(--ink);
}

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

.postcard__excerpt {
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 66ch;
}

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

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

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

.blog-status code {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.875rem;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 1rem;
  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.5rem;
}

/* Single post ------------------------------------------------------------- */

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

.article__title {
  font-size: clamp(2.125rem, 4.6vw, 3.125rem);
  letter-spacing: -0.024em;
}

.article__meta {
  margin-top: 1rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}

.article__body {
  margin-top: 2.25rem;
  font-size: 1.125rem;
  line-height: 1.78;
  color: var(--ink);
}

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

.article__body h1,
.article__body h2,
.article__body h3,
.article__body h4 {
  margin-top: 2.5rem;
  margin-bottom: 0.875rem;
}

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

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

.article__body img {
  height: auto;
  border-radius: var(--radius);
  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.4rem;
}

.article__body blockquote {
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--muted);
}

.article__body pre {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--band);
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-size: 0.9375rem;
}

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

.article__foot {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   17. Mobile
   -------------------------------------------------------------------------- */

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

  .entry,
  .career__item,
  .pub {
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1.75rem;
  }

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

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

  .section {
    padding-block: 4rem;
  }

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

  .navlinks.is-open {
    transform: translateY(0);
  }

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

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

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

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

  .hero {
    padding-block: 2.5rem 3.25rem;
  }

  .hero__portrait {
    max-width: 10.5rem;
    order: -1;
    margin-bottom: 0.25rem;
  }

  .hero__caption {
    font-size: 0.75rem;
    margin-top: 0.625rem;
  }

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

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

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

  .section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2.25rem;
  }

  .section__aside {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 1.25rem;
  }

  body {
    font-size: 1rem;
  }

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

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

  .pub {
    gap: 0.5rem;
  }

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

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

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

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

  .wordmark {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }

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

  .theme-toggle span {
    display: none;
  }

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

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

/* --------------------------------------------------------------------------
   18. Motion + print
   -------------------------------------------------------------------------- */

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

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s 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,
  .blog-filters,
  .loadmore-wrap {
    display: none !important;
  }

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

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

  a {
    color: #000;
  }
}
