/* =============================================================
   Md Shahriar Sajid — Academic Portfolio
   ============================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --card: #ffffff;
  --text: #14161a;
  --muted: #58606d;
  --faint: #8a919d;
  --line: #e5e7ec;
  --line-2: #d3d7de;
  --accent: #1a4ed8;
  --accent-soft: #eef2ff;

  --sidebar-w: 218px;
  --rail-w: 204px;
  --content: 900px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino,
    "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r: 11px;
  --r-s: 7px;

  /* Motion */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-inout: cubic-bezier(.4, 0, .2, 1);
  --t-fast: .16s;
  --t-base: .26s;
  --t-slow: .62s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-soft: #14171c;
    --card: #171b21;
    --text: #e9ebef;
    --muted: #a2a9b5;
    --faint: #767e8b;
    --line: #242831;
    --line-2: #333844;
    --accent: #7f9dff;
    --accent-soft: #1a2136;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p {
  margin: 0 0 .75rem;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.012em;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.3rem);
}

h2 {
  font-size: 1.22rem;
}

h3 {
  font-size: 1rem;
}

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

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

/* Shared icon treatment — every inline SVG inherits its colour */
.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-base) var(--ease-out);
}

/* =============================================================
   Scroll progress bar
   ============================================================= */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 120;
  pointer-events: none;
  will-change: transform;
}

/* =============================================================
   Shell
   ============================================================= */
.layout {
  display: flex;
  align-items: flex-start;
}

/* =============================================================
   Sidebar
   ============================================================= */
.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  padding: 30px 20px 24px 26px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  transition:
    width var(--t-base) var(--ease-inout),
    flex-basis var(--t-base) var(--ease-inout),
    padding var(--t-base) var(--ease-inout);
}

/* ---------- Sidebar head ---------- */
.sidebar__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.7rem;
  transition: margin var(--t-base) var(--ease-inout);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-right: auto;
  color: var(--text);
}

.sidebar__brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
  transition: transform var(--t-base) var(--ease-out);
}

.sidebar__brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.06);
}

.brand-name {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--t-base) var(--ease-out);
}

.collapse-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition:
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out);
}

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

.collapse-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-base) var(--ease-inout);
}

/* ---------- Navigation ---------- */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 12px;
  margin-left: -2px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 7px 7px 0;
  white-space: nowrap;
  transition:
    color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    padding var(--t-base) var(--ease-inout);
}

.side-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.side-nav a:hover .ico {
  transform: translateX(1.5px);
}

/* Active section — set by the scroll-spy script */
.side-nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 650;
}

.side-nav a.is-active .ico {
  transform: scale(1.08);
}

/* Labels fade and collapse rather than disappearing abruptly */
.side-nav .lbl,
.sidebar__foot .lbl,
.foot-note {
  display: block;
  max-width: 200px;
  opacity: 1;
  overflow: hidden;
  white-space: nowrap;
  transition:
    max-width var(--t-base) var(--ease-inout),
    opacity var(--t-fast) var(--ease-out);
}

/* ---------- Sidebar foot ---------- */
.sidebar__foot {
  margin-top: auto;
  padding-top: 22px;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__foot a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 12px;
  margin-left: -2px;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 7px 7px 0;
  white-space: nowrap;
  transition:
    color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out);
}

.sidebar__foot a:hover {
  color: var(--accent);
  background: var(--bg-soft);
  text-decoration: none;
}

.sidebar__foot a:hover .ico {
  transform: translateX(1.5px);
}

.foot-note {
  padding-left: 14px;
}

/* =============================================================
   Collapsed sidebar (desktop only)
   ============================================================= */
@media (min-width: 901px) {

  .sidebar.is-collapsed {
    --sidebar-w: 68px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .sidebar.is-collapsed .sidebar__head {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.4rem;
  }

  .sidebar.is-collapsed .sidebar__brand {
    margin-right: 0;
  }

  .sidebar.is-collapsed .side-nav a,
  .sidebar.is-collapsed .sidebar__foot a {
    justify-content: center;
    gap: 0;
    padding: 9px 0;
  }

  /* Collapse the label rather than hiding it, so it can animate */
  .sidebar.is-collapsed .brand-name,
  .sidebar.is-collapsed .side-nav .lbl,
  .sidebar.is-collapsed .sidebar__foot .lbl,
  .sidebar.is-collapsed .foot-note {
    max-width: 0;
    opacity: 0;
  }

  .sidebar.is-collapsed .collapse-btn svg {
    transform: rotate(180deg);
  }
}

/* =============================================================
   Right rail — local clock and calendar
   ============================================================= */
.rail {
  position: sticky;
  top: 0;
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  height: 100vh;
  padding: 30px 22px 24px 20px;
  border-left: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 30;
}

.rail__block+.rail__block {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.rail__label {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  margin: 0 0 7px;
}

/* ---------- Clock ---------- */
.clock {
  font-family: var(--mono);
  font-size: 1.52rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 0 0 6px;
}

.clock__date {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 4px;
}

.clock__zone {
  font-size: .68rem;
  color: var(--faint);
  margin: 0;
  word-break: break-word;
}

/* ---------- Calendar ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 9px;
}

.cal__dow {
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--faint);
  text-align: center;
  padding-bottom: 2px;
}

.cal__day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  border-radius: 5px;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}

.cal__day.is-weekend {
  color: var(--faint);
}

.cal__day.is-today {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.cal__day.is-empty {
  visibility: hidden;
}

/* =============================================================
   Content column
   ============================================================= */
.main {
  flex: 1 1 auto;
  min-width: 0;
}

.main__wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 44px;
}

/* =============================================================
   Hero
   ============================================================= */
.hero {
  padding: 52px 0 44px;
  background: radial-gradient(680px 240px at 4% -40%, var(--accent-soft), transparent 70%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.hero h1 {
  margin-bottom: .3rem;
}

.hero__role {
  font-size: .97rem;
  font-weight: 550;
  margin-bottom: .1rem;
}

.hero__org {
  font-size: .85rem;
  color: var(--faint);
  margin-bottom: 1rem;
}

.hero__lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: none;
  margin: .55rem 0 1.3rem;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

/* ---------- Availability status ---------- */
/* ---------- Availability status ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 24px 0 0;
  font-size: .84rem;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #16b364;
  animation: dotBreathe 2s ease-in-out infinite;
}

/* Halo — transform and opacity only, so it always animates smoothly */
.status__dot::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(46, 232, 138, .7);
  filter: blur(4px);
  animation: haloBreathe 2s ease-in-out infinite;
}

@keyframes dotBreathe {
  0%,
  100% {
    background: #16b364;
    box-shadow: 0 0 2px rgba(22, 179, 100, .4);
  }

  50% {
    background: #3ef09a;
    box-shadow: 0 0 10px 2px rgba(22, 179, 100, .9);
  }
}

@keyframes haloBreathe {
  0%,
  100% {
    transform: scale(.9);
    opacity: 0;
  }

  50% {
    transform: scale(2.2);
    opacity: .85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status__dot,
  .status__dot::before {
    animation: none;
  }

  .status__dot {
    background: #3ef09a;
    box-shadow: 0 0 10px 2px rgba(22, 179, 100, .9);
  }
}

/* Gentle entrance on page load, staggered top to bottom */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.hero h1,
.hero__role,
.hero__org,
.hero__lede,
.hero .cta,
.hero .facts {
  animation: riseIn .68s var(--ease-out) both;
}

.hero h1 {
  animation-delay: .04s;
}

.hero__role {
  animation-delay: .10s;
}

.hero__org {
  animation-delay: .16s;
}

.hero__lede {
  animation-delay: .22s;
}

.hero .cta {
  animation-delay: .28s;
}

.hero .facts {
  animation-delay: .20s;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* =============================================================
   Buttons
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  font-size: .84rem;
  font-weight: 600;
  transition:
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

.btn-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: currentColor;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 78, 216, .10);
}

.btn:active {
  transform: translateY(0);
}

.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--solid:hover {
  background: var(--accent);
  color: #fff;
  filter: brightness(1.08);
  box-shadow: 0 5px 16px rgba(26, 78, 216, .26);
}

/* =============================================================
   Hero action links — Scholar button + GitHub / LinkedIn icons
   Each glows in its own brand colour on hover.
   ============================================================= */

/* ---------- Google Scholar ---------- */
.btn--scholar {
  border-color: #4285f4;
  color: #1a73e8;
  background: #ffffff;
}

.btn--scholar:hover {
  background: #e8f0fe;
  border-color: #4285f4;
  color: #1a73e8;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 3px rgba(66, 133, 244, .14),
    0 0 18px rgba(66, 133, 244, .45);
}

/* ---------- Icon-only links ---------- */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--muted);
  transition:
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

.icon-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.icon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* GitHub — neutral glow that reads in either theme */
.icon-link[aria-label="GitHub"]:hover {
  color: var(--text);
  border-color: var(--text);
  box-shadow:
    0 0 0 3px rgba(140, 148, 160, .16),
    0 0 18px rgba(140, 148, 160, .42);
}

/* LinkedIn — brand blue */
.icon-link[aria-label="LinkedIn"]:hover {
  color: #0a66c2;
  border-color: #0a66c2;
  box-shadow:
    0 0 0 3px rgba(10, 102, 194, .14),
    0 0 18px rgba(10, 102, 194, .45);
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  .btn--scholar {
    background: transparent;
    border-color: #4285f4;
    color: #8ab4f8;
  }

  .btn--scholar:hover {
    background: rgba(138, 180, 248, .10);
    border-color: #8ab4f8;
    color: #8ab4f8;
    box-shadow:
      0 0 0 3px rgba(138, 180, 248, .14),
      0 0 20px rgba(138, 180, 248, .48);
  }

  .icon-link[aria-label="GitHub"]:hover {
    box-shadow:
      0 0 0 3px rgba(200, 208, 220, .12),
      0 0 20px rgba(200, 208, 220, .38);
  }

  .icon-link[aria-label="LinkedIn"]:hover {
    color: #70b5f9;
    border-color: #70b5f9;
    box-shadow:
      0 0 0 3px rgba(112, 181, 249, .14),
      0 0 20px rgba(112, 181, 249, .48);
  }
}

/* =============================================================
   Quick-facts panel
   ============================================================= */
.facts {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 17px 19px;
  display: grid;
  gap: 11px;
}

.facts__row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 11px;
  align-items: baseline;
}

.facts__row dt {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}

.facts__row dd {
  margin: 0;
  font-size: .83rem;
  color: var(--muted);
  line-height: 1.5;
}

.facts__row dd b {
  color: var(--text);
  font-weight: 650;
}

.facts__row dd a {
  word-break: break-all;
}

/* =============================================================
   Sections
   ============================================================= */
.section {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.section--soft {
  background: var(--bg-soft);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 19px;
}

.section__num {
  font-family: var(--mono);
  font-size: .67rem;
  letter-spacing: .12em;
  color: var(--faint);
  margin: 0;
  flex-shrink: 0;
}

.section__note {
  font-size: .83rem;
  color: var(--faint);
  margin: 0 0 0 auto;
}

/* =============================================================
   Column utilities
   ============================================================= */
.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.cols-2--tight {
  gap: 15px;
}

/* =============================================================
   Prose
   ============================================================= */
.prose {
  font-size: .91rem;
  color: var(--muted);
}

.prose strong {
  color: var(--text);
  font-weight: 650;
}

/* =============================================================
   Research interests
   ============================================================= */
.interests {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 30px;
}

.interests li {
  font-size: .88rem;
  color: var(--muted);
  position: relative;
  padding-left: 16px;
  transition: color var(--t-fast) var(--ease-out);
}

.interests li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .8;
  transition: transform var(--t-base) var(--ease-out);
}

.interests li:hover {
  color: var(--text);
}

.interests li:hover::before {
  transform: scale(1.7);
}

/* =============================================================
   Entry cards
   ============================================================= */
.entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  transition:
    border-color var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

.entry+.entry {
  margin-top: 11px;
}

.entry:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 24, 40, .06);
}

.entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px 14px;
  margin-bottom: .2rem;
}

.entry__head h3 {
  font-size: .96rem;
}

.entry__date {
  font-family: var(--mono);
  font-size: .67rem;
  color: var(--faint);
  white-space: nowrap;
}

.entry__org {
  font-size: .84rem;
  color: var(--accent);
  margin-bottom: .4rem;
}

.entry__body {
  font-size: .84rem;
  color: var(--muted);
}

.entry__body p {
  margin: 0 0 .3rem;
}

.entry__body p:last-child {
  margin-bottom: 0;
}

/* IELTS score chips */
.scores {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: .4rem;
}

.scores li {
  font-size: .72rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--muted);
  transition:
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
}

.scores li:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.scores b {
  color: var(--text);
  font-weight: 650;
}

/* Inline GitHub mark, used in the awards list */
.gh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: -2px;
}

.gh svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}

/* =============================================================
   Publications
   ============================================================= */
.pubs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.pub {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

.pub:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 24, 40, .06);
}

.pub--wip {
  border-style: dashed;
}

.pub__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: .45rem;
}

.pub__year {
  font-family: var(--mono);
  font-size: .69rem;
  font-weight: 700;
  color: var(--accent);
}

.pub__kind {
  font-size: .65rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}

.pub__title {
  font-family: var(--serif);
  font-size: .96rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .35rem;
}

.pub__authors {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .25rem;
}

.pub__authors strong {
  color: var(--text);
  font-weight: 650;
}

.pub__venue {
  font-size: .78rem;
  color: var(--faint);
  font-style: italic;
  margin-bottom: .6rem;
}

.pub__link {
  margin-top: auto;
  font-size: .77rem;
  font-weight: 650;
  align-self: flex-start;
  transition: transform var(--t-fast) var(--ease-out);
}

.pub__link:hover {
  transform: translateX(2px);
}

/* =============================================================
   Project cards
   ============================================================= */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 16px;
  transition:
    border-color var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

.card:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(16, 24, 40, .08);
}

.card__tag {
  font-size: .63rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .3rem;
}

.card__title {
  font-family: var(--serif);
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.32;
  margin-bottom: .4rem;
}

.card__text {
  font-size: .81rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: .8rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: .8rem;
}

.metrics li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 5px 9px;
  transition: border-color var(--t-fast) var(--ease-out);
}

.card:hover .metrics li {
  border-color: var(--line-2);
}

.metrics span {
  display: block;
  font-size: .57rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  line-height: 1.4;
}

.metrics b {
  font-size: .8rem;
  font-weight: 650;
  color: var(--text);
}

.card__foot {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: .71rem;
  color: var(--faint);
  line-height: 1.45;
}

/* =============================================================
   Definition rows
   ============================================================= */
.rows {
  display: grid;
  gap: 11px;
}

.row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 3px 15px;
  align-items: baseline;
}

.row__label {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}

.row__value {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.55;
}

.row__value strong {
  color: var(--text);
  font-weight: 650;
}

.row__value em {
  color: var(--faint);
  font-style: normal;
}

.row__value>*+* {
  margin-top: .35rem;
}

/* =============================================================
   Contact
   ============================================================= */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.contact__lede {
  font-size: .89rem;
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 48ch;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.contact__aside {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 17px;
  display: grid;
  gap: 10px;
}

/* =============================================================
   Footer
   ============================================================= */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 20px 0;
  font-size: .75rem;
  color: var(--faint);
}

/* =============================================================
   Reveal on scroll

   Only armed when JS is present (html.js), so the content is
   never hidden if the script fails to run.
   ============================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--t-slow) var(--ease-out),
    transform var(--t-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* =============================================================
   Responsive
   ============================================================= */

/* The rail needs real room beside the sidebar and a 900px column,
   so it steps aside on anything narrower. */
@media (max-width: 1280px) {
  .rail {
    display: none;
  }
}

@media (max-width: 1080px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Below 900px the sidebar becomes a sticky bar across the top and
   the collapse toggle is hidden — labels must stay visible. */
@media (max-width: 900px) {
  .layout {
    display: block;
  }

  .sidebar,
  .sidebar.is-collapsed {
    position: sticky;
    top: 0;
    flex: none;
    width: 100%;
    height: auto;
    padding: 11px 20px 9px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    overflow: visible;
    display: block;
    transition: none;
  }

  .sidebar__head {
    margin-bottom: 0;
    gap: 9px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
    font-size: .78rem;
    border-radius: 7px;
  }

  .brand-name {
    font-size: .88rem;
  }

  .collapse-btn {
    display: none;
  }

  .side-nav,
  .sidebar.is-collapsed .side-nav {
    flex-direction: row;
    gap: 2px;
    margin-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a,
  .sidebar.is-collapsed .side-nav a {
    justify-content: flex-start;
    gap: 7px;
    white-space: nowrap;
    padding: 4px 11px;
    margin-left: 0;
    border-left: none;
    border-radius: 7px;
  }

  .side-nav a.is-active {
    border-left: none;
  }

  .side-nav a:hover .ico {
    transform: none;
  }

  .side-nav .lbl,
  .sidebar.is-collapsed .side-nav .lbl {
    max-width: none;
    opacity: 1;
  }

  .sidebar__foot {
    display: none;
  }

  .main__wrap {
    padding: 0 22px;
  }

  html {
    scroll-padding-top: 106px;
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 32px 0 28px;
  }

  .section {
    padding: 28px 0;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .facts {
    max-width: 440px;
  }

  .cols-2 {
    grid-template-columns: 1fr;
    gap: 18px;
  }

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

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section__note {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

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

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

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

  .facts__row {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .main__wrap {
    padding: 0 18px;
  }

  .side-nav {
    font-size: .78rem;
  }

  .side-nav a {
    padding: 4px 9px;
  }
}

/* =============================================================
   Reduced motion

   Everything still works — it simply arrives without travelling.
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

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

  .progress {
    display: none;
  }
}

/* =============================================================
   Print
   ============================================================= */
@media print {
  :root {
    --bg: #fff;
    --bg-soft: #fff;
    --card: #fff;
    --text: #000;
    --muted: #333;
    --faint: #666;
    --line: #ccc;
    --line-2: #bbb;
    --accent: #000;
  }

  .sidebar,
  .rail,
  .cta,
  .progress {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .main__wrap {
    max-width: none;
    padding: 0;
  }

  body {
    font-size: 10pt;
    line-height: 1.45;
  }

  .section {
    padding: 12px 0;
    break-inside: avoid;
  }

  .hero {
    padding: 0 0 10px;
    background: none;
  }

  .hero h1,
  .hero__role,
  .hero__org,
  .hero__lede,
  .hero .cta,
  .hero .facts {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .card,
  .pub,
  .entry {
    break-inside: avoid;
    box-shadow: none !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
  }
}
