/* =====================================================================
   Thowfiqur Bari Chowdhury — Portfolio
   Editorial identity · charcoal (dark, default) + warm paper (light)
   Typography: Instrument Serif (display) · Inter (text) · JetBrains Mono (labels)
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* type scale (≈1.25) */
  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: clamp(20px, 1.6vw, 22px);
  --fs-xl: clamp(24px, 2.4vw, 32px);
  --fs-2xl: clamp(34px, 4.2vw, 56px);

  /* spacing scale (8px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --shell: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 6px;
  --radius-lg: 10px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1116;
  --surface: #14181E;
  --surface-2: #1A1F27;
  --text: #E9EBEE;
  --text-2: #C3C8CF;
  --muted: #8E97A2;
  --line: rgba(233, 235, 238, .09);
  --line-strong: rgba(233, 235, 238, .2);
  --accent: #5B9BFF;
  --accent-soft: rgba(91, 155, 255, .12);
  --on-solid: #0E1116;
  --solid: #E9EBEE;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -24px rgba(0, 0, 0, .8);
  --ok: #4ADE80;
  /* illustration palette */
  --m-bg: #12161C;
  --m-1: #1C2129;
  --m-2: #262C36;
  --m-ink: #8E97A2;
  --m-warm-a: #9C7A5A;
  --m-warm-b: #6E8A78;
  --m-warm-c: #7E6F8F;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F1EA;
  --surface: #FAF8F3;
  --surface-2: #EEEAE1;
  --text: #1B1D21;
  --text-2: #33373D;
  --muted: #5D626A;
  --line: rgba(27, 29, 33, .11);
  --line-strong: rgba(27, 29, 33, .26);
  --accent: #2B5797;
  --accent-soft: rgba(43, 87, 151, .09);
  --on-solid: #F4F1EA;
  --solid: #1B1D21;
  --shadow: 0 1px 2px rgba(27, 29, 33, .05), 0 18px 40px -28px rgba(27, 29, 33, .28);
  --ok: #15803D;
  --m-bg: #FBFAF6;
  --m-1: #EFEBE2;
  --m-2: #E2DDD2;
  --m-ink: #7A7E86;
  --m-warm-a: #C9A27E;
  --m-warm-b: #9DB4A3;
  --m-warm-c: #ADA0BD;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.65 var(--sans);
  letter-spacing: -.006em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease) !important;
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

.shell {
  margin-inline: auto;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: var(--s-4);
  top: -60px;
  z-index: 200;
  background: var(--solid);
  color: var(--on-solid);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--s-3);
}

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

/* ---------- 3. Small components ---------- */
.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  font: 500 15px/1 var(--sans);
  gap: var(--s-2);
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  transition: background-color .2s, color .2s, border-color .2s;
  white-space: nowrap;
}

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

.button-solid:hover {
  background: var(--accent);
  color: #fff;
}

[data-theme="dark"] .button-solid:hover {
  color: #0E1116;
}

.button-outline {
  border-color: var(--line-strong);
  color: var(--text);
}

.button-outline:hover {
  border-color: var(--text);
}

.link-arrow {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-weight: 500;
  gap: 6px;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color .2s, color .2s;
}

.link-arrow span {
  transition: transform .25s var(--ease);
}

.link-arrow:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.link-arrow:hover span {
  transform: translate(2px, -1px);
}

.mini-head {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font: 500 var(--fs-xs)/1.4 var(--mono);
  gap: var(--s-3);
  letter-spacing: .08em;
  margin-bottom: var(--s-4);
  text-transform: uppercase;
}

.tag-current,
.tag-plain {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text-2);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .08em;
  padding: 4px 6px;
  text-transform: uppercase;
  vertical-align: 2px;
  margin-left: var(--s-2);
}

.tag-current {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
}

.stack {
  color: var(--muted);
  font: 400 var(--fs-sm)/1.7 var(--mono);
  letter-spacing: -.01em;
}

.dash-list {
  display: grid;
  gap: var(--s-2);
}

.dash-list li {
  padding-left: 22px;
  position: relative;
}

.dash-list li::before {
  content: "—";
  color: var(--muted);
  left: 0;
  position: absolute;
}

.plain-list {
  display: flex;
  flex-wrap: wrap;
  row-gap: 4px;
  color: var(--text-2);
}

.plain-list li:not(:last-child)::after {
  content: "/";
  color: var(--line-strong);
  margin: 0 10px;
}

.plain-list.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 0;
}

.plain-list.cols-2 li {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.plain-list.cols-2 li::after {
  content: none !important;
}

.facts {
  display: grid;
  gap: 0 var(--s-5);
}

.facts div {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--s-4);
  padding: 10px 0;
}

.facts dt {
  color: var(--muted);
  font: 500 var(--fs-xs)/1.9 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.facts dd {
  color: var(--text);
}

/* ---------- 4. Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

/* ---------- 5. Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s;
}

.site-header.scrolled,
.site-header.menu-open {
  background: color-mix(in srgb, var(--bg) 98%, transparent);
  border-bottom-color: var(--line);
}

.nav-shell {
  align-items: center;
  display: flex;
  gap: var(--s-6);
  height: var(--header-h);
  margin-inline: auto;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  padding-inline: var(--gutter);
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: none;
  min-height: 44px;
  gap: var(--s-3);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
}

.brand-mark {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  display: inline-block;
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  padding: 6px 7px;
}

.primary-nav {
  margin-left: auto;
}

.primary-nav ul {
  display: flex;
  gap: clamp(14px, 1.6vw, 24px);
}

.primary-nav ul a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  position: relative;
  transition: color .2s;
}

.primary-nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}

.primary-nav ul a:hover,
.primary-nav ul a[aria-current="true"] {
  color: var(--text);
}

.primary-nav ul a[aria-current="true"]::after {
  transform: scaleX(1);
}

.nav-actions {
  align-items: center;
  display: flex;
  flex: none;
  gap: var(--s-3);
}

.nav-actions .button {
  min-height: 40px;
  font-size: 14px;
  padding: 0 14px;
}

.theme-toggle,
.menu-toggle {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  min-width: 40px;
  transition: border-color .2s, color .2s;
}

.theme-toggle:hover,
.menu-toggle:hover {
  border-color: var(--text);
  color: var(--text);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

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

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

.menu-toggle {
  display: none;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
}

.nav-cv-mobile {
  display: none;
}

/* ---------- 6. Hero ---------- */
.hero {
  padding: calc(var(--header-h) + var(--s-6)) 0 var(--s-9);
  min-height: min(100svh, 980px);
  display: flex;
  align-items: stretch;
}

.hero>.shell {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.hero-meta {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font: 500 var(--fs-xs)/1 var(--mono);
  gap: var(--s-3) var(--s-6);
  letter-spacing: .06em;
  padding-bottom: var(--s-4);
  text-transform: uppercase;
}

.hero-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.hero-clock time {
  color: var(--text);
}

.avail-dot {
  background: var(--ok);
  border-radius: 50%;
  display: inline-block;
  height: 6px;
  margin-right: 8px;
  vertical-align: 1px;
  width: 6px;
}

.hero-grid {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: end;
  margin-top: auto;
  padding-top: var(--s-8);
}

.hero-role {
  color: var(--text-2);
  font: 500 var(--fs-sm)/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero-role .amp {
  color: var(--accent);
}

.hero-name {
  font: 400 clamp(56px, 10.6vw, 152px)/.88 var(--serif);
  letter-spacing: -.025em;
  margin: var(--s-5) 0 0 -.04em;
}

.name-line {
  display: block;
}

.name-line+.name-line {
  padding-left: clamp(0px, 7vw, 120px);
}

.name-dot {
  color: var(--accent);
}

.hero-headline {
  color: var(--text-2);
  font: 400 var(--fs-xl)/1.3 var(--sans);
  letter-spacing: -.02em;
  margin-top: var(--s-6);
  max-width: 28ch;
}

.hero-headline em {
  color: var(--text);
  font: italic 400 1.18em/1 var(--serif);
  letter-spacing: -.01em;
}

.hero-side {
  padding-bottom: 10px;
}

.hero-photo {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: var(--s-5);
  overflow: hidden;
  background: var(--surface);
}

.hero-photo[hidden] {
  display: none;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(.15);
}

.now-list div {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.now-list div:last-child {
  border-bottom: 1px solid var(--line);
}

.now-list dt {
  color: var(--muted);
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.now-list dd {
  color: var(--text);
  font-size: 15px;
  margin-top: 3px;
}

.hero-foot {
  display: grid;
  gap: var(--s-5) var(--s-7);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  border-top: 1px solid var(--line);
  margin-top: var(--s-7);
  padding-top: var(--s-5);
}

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

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-4);
  justify-content: flex-end;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-5);
}

.social-row a {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
  gap: 4px;
  min-height: 44px;
  transition: color .2s;
}

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

.hero-foot .social-row {
  grid-column: 1 / -1;
  margin-top: calc(var(--s-3) * -1);
}

/* one-time, quiet entrance */
html.js .hero-meta,
html.js .hero-role,
html.js .name-line,
html.js .hero-headline,
html.js .hero-side,
html.js .hero-foot {
  animation: enter .9s var(--ease) both;
}

html.js .hero-role {
  animation-delay: .08s;
}

html.js .name-line:nth-child(1) {
  animation-delay: .14s;
}

html.js .name-line:nth-child(2) {
  animation-delay: .22s;
}

html.js .hero-headline {
  animation-delay: .32s;
}

html.js .hero-side {
  animation-delay: .4s;
}

html.js .hero-foot {
  animation-delay: .48s;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- 7. Sections ---------- */
.section {
  border-top: 1px solid var(--line);
  padding: clamp(72px, 9vw, 128px) 0;
}

.section-grid {
  display: grid;
  gap: var(--s-5) var(--s-7);
  grid-template-columns: minmax(150px, 3fr) minmax(0, 9fr);
}

.section-label {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + var(--s-5));
}

.section-label h2 {
  font: 400 clamp(34px, 3.4vw, 46px)/1 var(--serif);
  letter-spacing: -.015em;
}

.lead {
  font: 400 var(--fs-xl)/1.3 var(--sans);
  letter-spacing: -.022em;
  max-width: 30ch;
  color: var(--text);
}

.note {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: var(--s-4);
  max-width: 60ch;
}

.section-body>*+* {
  margin-top: var(--s-7);
}

.section-body>.note {
  margin-top: var(--s-4);
}

/* about */
.two-col {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--text-2);
}

.two-col p+p {
  color: var(--muted);
}

.about-meta {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-meta .facts {
  align-self: start;
  margin-top: calc(var(--fs-xs) * 1.4 + var(--s-4));
}

/* experience */
.xp-list {
  display: grid;
}

.xp,
.edu {
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--s-3) var(--s-6);
  grid-template-columns: 190px minmax(0, 1fr);
  padding: var(--s-6) 0;
}

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

.xp-date {
  color: var(--muted);
  font: 500 var(--fs-sm)/1.6 var(--mono);
  font-variant-numeric: tabular-nums;
}

.xp-date .tag-current {
  display: inline-block;
  margin: 8px 0 0;
}

.xp h3,
.edu h3 {
  font: 600 var(--fs-lg)/1.3 var(--sans);
  letter-spacing: -.02em;
}

.xp h3 .at::before {
  content: "— ";
  color: var(--muted);
}

.xp h3 .at {
  color: var(--text-2);
  font-weight: 400;
}

.xp-sub {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 2px;
}

.xp-project {
  border-left: 1px solid var(--line-strong);
  margin: var(--s-5) 0;
  padding-left: var(--s-5);
}

.xp-project-title {
  font-weight: 600;
}

.xp-project-title .muted {
  font-weight: 400;
  font-size: var(--fs-sm);
}

.xp .dash-list {
  color: var(--text-2);
  margin-top: var(--s-4);
}

.xp-body>.dash-list {
  margin-bottom: var(--s-5);
}

/* skills */
.skills-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: var(--s-6);
  transition: background-color .25s;
}

.skill:hover {
  background: var(--surface);
}

.skill h3 {
  align-items: baseline;
  display: flex;
  font: 600 var(--fs-md)/1.3 var(--sans);
  gap: var(--s-3);
  letter-spacing: -.015em;
}

.skill>p {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin: var(--s-2) 0 var(--s-5);
}

.skill .plain-list {
  display: grid;
  font-size: 15px;
  gap: 2px var(--s-5);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill .plain-list li::after {
  content: none;
}

.skill .plain-list li {
  padding: 3px 0;
}

/* ---------- 8. Projects ---------- */
.filter-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
}

.project-filter {
  display: flex;
  gap: var(--s-5);
}

.filter-tab {
  min-width: 44px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  min-height: 44px;
  transition: color .2s, border-color .2s;
}

.filter-tab sup {
  font: 500 10px/1 var(--mono);
  margin-left: 2px;
}

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

.filter-tab[aria-pressed="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

[data-category].is-hidden {
  display: none !important;
}

.cases {
  margin-top: var(--s-8);
}

/* case studies */
.case {
  border-top: 1px solid var(--line-strong);
  display: grid;
  gap: var(--s-6) var(--s-7);
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  padding: var(--s-6) 0 var(--s-9);
}

.case-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  grid-column: 1 / -1;
  justify-content: space-between;
}

.case-type {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.case h3 {
  font: 400 clamp(36px, 4.4vw, 60px)/1 var(--serif);
  letter-spacing: -.02em;
}

.case-media {
  align-self: start;
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h) + var(--s-5));
}

.shot {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  height: auto;
  width: 100%;
}

.case-body {
  display: flex;
  flex-direction: column;
}

.case-body p {
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.65;
}

.case-why {
  color: var(--text) !important;
  font-size: var(--fs-md) !important;
  line-height: 1.5 !important;
  letter-spacing: -.012em;
}

.case-body h4 {
  color: var(--muted);
  font: 500 var(--fs-xs)/1 var(--mono);
  letter-spacing: .08em;
  margin: var(--s-6) 0 var(--s-2);
  text-transform: uppercase;
}

.case-body .stack {
  margin-top: var(--s-6);
}

.case-body .link-arrow {
  align-self: flex-start;
  margin-top: var(--s-3);
}

/* more projects */
.list-title {
  color: var(--muted);
  font: 500 var(--fs-xs)/1 var(--mono);
  letter-spacing: .08em;
  margin: var(--s-4) 0 var(--s-4);
  text-transform: uppercase;
}

.index-list {
  border-bottom: 1px solid var(--line);
}

.index-row a {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px var(--s-6);
  grid-template-columns: minmax(180px, 3fr) minmax(0, 8fr) 24px;
  margin: 0 calc(var(--s-3) * -1);
  padding: var(--s-5) var(--s-3);
  transition: background-color .2s;
}

.index-row a:hover {
  background: var(--surface);
}

.ir-title {
  font: 400 clamp(23px, 2.2vw, 28px)/1.15 var(--serif);
  letter-spacing: -.01em;
  transition: color .2s;
}

.ir-desc {
  color: var(--text-2);
  font-size: 15px;
}

.ir-arrow {
  color: var(--muted);
  transition: transform .25s var(--ease), color .2s;
}

.index-row a:hover .ir-title,
.index-row a:hover .ir-arrow {
  color: var(--accent);
}

.index-row a:hover .ir-arrow {
  transform: translate(2px, -2px);
}

/* TODO placeholders: impossible to miss, clearly not content */
.todo {
  border: 1px dashed color-mix(in srgb, #D97706 70%, transparent);
  border-radius: var(--radius);
  color: var(--text-2) !important;
  font-size: 14.5px !important;
  margin-top: var(--s-2);
  padding: 10px 12px;
}

.todo span {
  color: #D97706;
  font: 600 11px/1 var(--mono);
  letter-spacing: .08em;
  margin-right: 8px;
}

[data-theme="light"] .todo span {
  color: #A44F00;
}

/* ---------- 9. Research & education ---------- */
.interest-list {
  display: grid;
  gap: 0 var(--s-6);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.interest-list li {
  border-top: 1px solid var(--line);
  padding: var(--s-4) 0;
}

.interest-list h4 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.interest-list p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.section-body>.mini-head {
  margin-bottom: calc(var(--s-7) * -1 + var(--s-4));
}

.research-split {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-list li {
  border-top: 1px solid var(--line);
  padding: var(--s-4) 0;
}

.entry-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.entry-title {
  font-weight: 600;
  letter-spacing: -.01em;
}

.entry-meta {
  color: var(--accent);
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .06em;
  margin: 4px 0;
  text-transform: uppercase;
}

.entry-list li p:not(.entry-title):not(.entry-meta) {
  color: var(--text-2);
  font-size: 14.5px;
}

.edu {
  border-bottom: 1px solid var(--line);
}

.facts-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--s-5);
}

.facts-row div {
  grid-template-columns: 1fr;
  gap: 2px;
}

.facts-row dd {
  font: 400 26px/1.2 var(--serif);
}

.edu-note {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: var(--s-4);
}

/* ---------- 10. Contact & footer ---------- */
.contact-kicker {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font: 500 var(--fs-xs)/1 var(--mono);
  gap: var(--s-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.contact-title {
  font: 400 clamp(46px, 7.4vw, 108px)/.98 var(--serif);
  letter-spacing: -.025em;
  margin-top: var(--s-5);
  max-width: 15ch;
}

.contact-title em {
  color: var(--accent);
  font-style: italic;
}

.contact-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--s-6) var(--s-7);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  margin-top: var(--s-8);
  padding-top: var(--s-6);
}

.contact-lede {
  color: var(--text-2);
  font-size: var(--fs-md);
  max-width: 40ch;
}

.contact-email-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-4);
}

.contact-email {
  font: 400 clamp(22px, 2.6vw, 34px)/1.2 var(--sans);
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
  transition: color .2s, text-decoration-color .2s;
}

.contact-email:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.copy-button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  font: 500 var(--fs-xs)/1 var(--mono);
  letter-spacing: .06em;
  min-height: 36px;
  padding: 0 12px;
  text-transform: uppercase;
  transition: border-color .2s, color .2s;
}

.copy-button:hover {
  border-color: var(--text);
  color: var(--text);
}

.copy-status {
  color: var(--ok);
  font: 500 var(--fs-xs)/1 var(--mono);
}

.contact-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  margin-top: var(--s-6);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s-6) 0 var(--s-7);
}

.footer-grid {
  align-items: center;
  display: grid;
  gap: var(--s-3) var(--s-6);
  grid-template-columns: auto 1fr auto;
}

.footer-name {
  align-items: center;
  display: flex;
  font-weight: 600;
  gap: var(--s-3);
}

.footer-tag {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-5);
}

.footer-links a {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  min-height: 44px;
  transition: color .2s;
}

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

.copyright {
  color: var(--muted);
  font: 400 var(--fs-xs)/1 var(--mono);
  grid-column: 1 / -1;
}

/* ---------- 11. Reveal (hidden only once JS takes over) ---------- */
html.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

html.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 12. Responsive ---------- */
@media (max-width: 1080px) {
  .primary-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    left: 0;
    max-height: calc(100svh - var(--header-h));
    opacity: 0;
    overflow-y: auto;
    padding: var(--s-2) var(--gutter) var(--s-6);
    position: absolute;
    right: 0;
    top: var(--header-h);
    transform: translateY(-6px);
    transition: opacity .2s var(--ease), transform .25s var(--ease), visibility 0s .25s;
    visibility: hidden;
  }

  .primary-nav.open {
    opacity: 1;
    transform: none;
    transition: opacity .2s var(--ease), transform .25s var(--ease), visibility 0s;
    visibility: visible;
  }

  .primary-nav ul {
    display: grid;
    gap: 0;
  }

  .primary-nav ul a {
    border-bottom: 1px solid var(--line);
    display: flex;
    font: 400 30px/1 var(--serif);
    min-height: 60px;
    color: var(--text);
  }

  .primary-nav ul a::after {
    display: none;
  }

  .primary-nav ul a[aria-current="true"] {
    color: var(--accent);
  }

  .nav-cv-mobile {
    display: flex;
    margin-top: var(--s-5);
    width: 100%;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-actions {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }

  .hero-side {
    max-width: 420px;
  }

  .hero-foot {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-clock {
    margin-left: 0;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .section-label {
    position: static;
    display: flex;
    align-items: baseline;
    gap: var(--s-4);
  }

  .section-label h2 {
    margin-top: 0;
  }

  .case {
    grid-template-columns: 1fr;
  }

  .case-media {
    position: static;
  }

  .index-row a {
    grid-template-columns: minmax(0, 1fr) 20px;
  }

  .ir-desc {
    grid-column: 1;
  }

  .ir-arrow {
    grid-column: 2;
    grid-row: 1;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
  }

  .nav-cv,
  .brand-name {
    display: none;
  }

  .hero {
    padding-bottom: var(--s-8);
  }

  .hero-meta {
    gap: var(--s-2) var(--s-4);
  }

  .hero-meta>span:first-child {
    display: none;
  }

  .name-line+.name-line {
    padding-left: 0;
  }

  .hero-actions .button {
    flex: 1 1 calc(50% - 8px);
  }

  .two-col,
  .about-meta,
  .skills-grid,
  .interest-list,
  .research-split {
    grid-template-columns: 1fr;
  }

  .about-meta .facts {
    margin-top: 0;
  }

  .plain-list.cols-2 {
    grid-template-columns: 1fr 1fr;
  }

  .xp,
  .edu {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }

  .skill {
    padding: var(--s-5);
  }

  .facts div {
    grid-template-columns: 96px 1fr;
  }

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

  .facts-row div {
    grid-template-columns: 1fr;
  }

  .case {
    padding-bottom: var(--s-8);
  }

  .contact-actions .button {
    width: 100%;
  }
}

/* ---------- 13. Motion & input preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .001ms !important;
  }

  html.reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }
}



.case-body p + p {
  margin-top: var(--s-3);
}

.source-note {
  color: var(--muted) !important;
  font-size: var(--fs-sm) !important;
  margin-top: var(--s-3);
}

/* About */
.about-text {
  max-width: 62ch;
}

.about-text p {
  color: var(--text-2);
  max-width: 62ch;
}

.about-text p + p {
  margin-top: var(--s-4);
}

