/* ==========================================================================
   Ramiz Abbas Bangash — rabangash.me
   Midnight Hero -> Smoothly Compacts on Scroll into Sticky Left Sidebar
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --ink: #131720;
  --ink-2: #4b5464;
  --ink-3: #788294;
  --line: rgba(19, 23, 32, 0.09);
  --line-2: rgba(19, 23, 32, 0.17);
  --accent: #245192;

  --obs: #0c121d;
  --obs-ink: #f2f5fb;
  --obs-muted: #98a8bf;
  --obs-ice: #c8dcfa;
  --obs-blue: #8db5eb;
  --obs-line: rgba(255, 255, 255, 0.09);

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --wrap: 1080px;
  --pad: clamp(20px, 4.5vw, 44px);

  /* Scroll-scrubbed transition progress (0 = top hero, 1 = compacted sidebar) */
  --p: 0;
  --p-head: 0;
  --p-col: 0;
  --p-rail: 0;
  --col-shift: -183px;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #121721;
  --surface-2: #161d2a;
  --ink: #eef2f8;
  --ink-2: #a9b5c7;
  --ink-3: #718096;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --accent: #8fb8f0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--obs-blue));
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.9;
}

/* Reveal-on-scroll (only hidden when JS is active, so no-JS users still see content) */
html.js .card,
html.js .panel,
html.js .edu-row {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
html.js .card.is-revealed,
html.js .panel.is-revealed,
html.js .edu-row.is-revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js .card,
  html.js .panel,
  html.js .edu-row { opacity: 1; transform: none; transition: none; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.22s ease, color 0.22s ease;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, dl, dt, dd { margin: 0; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--obs-blue);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 200;
  background: var(--obs-ice);
  color: var(--obs);
  padding: 8px 14px;
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

.wrap {
  width: min(var(--wrap), calc(100% - var(--pad) * 2));
  margin-inline: auto;
}

/* Theme Visibility Helpers */
[data-theme="light"] .label-dark { display: none; }
[data-theme="dark"] .label-light { display: none; }
[data-theme="light"] .sig-dark { display: none; }
[data-theme="dark"] .sig-light { display: none; }

/* ==========================================================================
   Top Masthead (hides gracefully once sidebar takes over on desktop)
   ========================================================================== */
.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 18, 29, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--obs-ink);
  will-change: transform, opacity;
}

.masthead-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-sig-link {
  display: inline-flex;
  align-items: center;
  opacity: 0.92;
  transition: opacity 0.15s ease;
}
.nav-sig-link:hover { opacity: 1; }
.nav-sig { height: 28px; width: auto; }

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 14px;
  color: rgba(242, 245, 251, 0.7);
}
.site-nav a:hover, .site-nav a.is-active { color: #fff; }

.masthead-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
}

.theme-btn { color: var(--obs-muted); transition: color 0.15s ease; }
.theme-btn:hover { color: #fff; }

.nav-resume {
  color: #fff;
  font-weight: 500;
  border-bottom: 1px solid rgba(200, 220, 250, 0.35);
  padding-bottom: 1px;
}
.nav-resume:hover { color: var(--obs-ice); border-color: var(--obs-ice); }

.mobile-btn {
  display: none;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 4px 10px;
}

.mobile-menu {
  position: fixed;
  inset: 56px 0 0 0;
  z-index: 95;
  background: var(--obs);
  color: var(--obs-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 0 40px;
}
.mobile-nav { display: flex; flex-direction: column; }
.mobile-nav a {
  padding: 16px 0;
  border-bottom: 1px solid var(--obs-line);
  font-family: var(--serif);
  font-size: 26px;
}
.mobile-foot { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--obs-muted); }

/* ==========================================================================
   Expanded Hero (Image 1)
   ========================================================================== */
.hero {
  position: relative;
  background: var(--obs);
  color: var(--obs-ink);
  padding-top: 84px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(180deg, rgba(12, 18, 29, 0) 0%, rgba(12, 18, 29, 0.35) 100%);
  pointer-events: none;
  z-index: 3;
}

[data-theme="dark"] .hero {
  background: linear-gradient(180deg, #0c121d 0%, #0b0e14 100%);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 65% at 76% 45%, rgba(86, 134, 210, 0.16) 0%, rgba(12, 18, 29, 0) 70%);
  pointer-events: none;
  opacity: calc(1 - var(--p) * 0.7);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: end;
  transform-origin: center top;
  will-change: transform, opacity;
}

.hero-copy { padding: 18px 0 clamp(44px, 6vw, 66px); }

.hero-meta {
  font-size: 13px;
  color: var(--obs-blue);
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(44px, 5.6vw, 68px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 16px;
}

.hero-lead {
  font-size: clamp(19px, 2vw, 22px);
  color: #dde7f7;
  line-height: 1.38;
  margin-bottom: 14px;
}
.hero-lead em { font-family: var(--serif); font-style: italic; color: #a9c7f8; }

.hero-bio {
  font-size: 15px;
  line-height: 1.65;
  color: var(--obs-muted);
  max-width: 50ch;
  margin-bottom: 26px;
}
.hero-bio a, .hero-bio strong { color: #eef3fb; font-weight: 500; }
.hero-bio a { border-bottom: 1px solid rgba(200, 220, 250, 0.28); }
.hero-bio a:hover { border-color: var(--obs-ice); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 34px;
}

.btn-primary {
  padding: 10px 18px;
  border-radius: 999px;
  background: #e2ecfd;
  color: #0c121d;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}
.btn-primary:hover { background: #ffffff; }

.btn-ghost {
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #eef2f8;
  font-size: 14px;
  font-weight: 500;
}
.btn-ghost:hover { border-color: rgba(200, 220, 250, 0.45); background: rgba(255, 255, 255, 0.06); }

.btn-link { font-size: 14px; color: var(--obs-muted); }
.btn-link:hover { color: #ffffff; }

.hero-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  padding-top: 22px;
  border-top: 1px solid var(--obs-line);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(242, 245, 251, 0.78);
}
.now-item { display: inline-flex; align-items: center; gap: 7px; opacity: 0.85; transition: opacity 0.15s ease; }
.now-item:hover { opacity: 1; }
.now-sep { color: rgba(255, 255, 255, 0.2); }
.inv-logo { filter: brightness(0) invert(1); width: auto; }
.now-bindly { height: 17px; }
.now-schulich { height: 20px; }
.now-icon { width: 18px; height: 18px; object-fit: contain; }

.hero-portrait-col { display: flex; justify-content: flex-end; align-items: flex-end; }
.portrait-stage { position: relative; width: 100%; max-width: 440px; }
.portrait-img {
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 18%);
  mask-image: linear-gradient(to top, transparent 0%, #000 18%);
}
.portrait-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70px;
  background: linear-gradient(180deg, rgba(12, 18, 29, 0) 0%, var(--obs) 100%);
  pointer-events: none;
}
.hero-signature {
  position: absolute;
  right: 12px;
  bottom: 16px;
  width: 136px;
  opacity: 0.82;
  pointer-events: none;
}

/* ==========================================================================
   Dossier Shell & Compacting Scroll Transition (Image 1 -> Image 2)
   ========================================================================== */
.dossier-bg {
  background: var(--bg);
}

.dossier-shell {
  width: min(1140px, calc(100% - 48px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* Sticky Left Sidebar (Image 2) */
.sticky-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 0 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Content Column: centered when hero is visible, glides continuously right with scroll */
.content-col {
  padding: 56px 0 88px;
  min-width: 0;
  will-change: transform;
}

/* CONTINUOUS SCROLL-SCRUBBED MORPH (Desktop >= 1025px) */
@media (min-width: 1025px) {
  .masthead {
    transform: translate3d(0, calc(var(--p-head) * -105%), 0);
    opacity: calc(1 - var(--p-head));
  }

  body.rail-active .masthead {
    pointer-events: none;
  }

  .hero-grid {
    opacity: calc(1 - var(--p) * 0.82);
    transform: translate3d(0, calc(var(--p) * -28px), 0) scale(calc(1 - var(--p) * 0.035));
  }

  .sticky-rail {
    opacity: var(--p-rail);
    transform: translate3d(
      calc((1 - var(--p-rail)) * -22px),
      calc((1 - var(--p-rail)) * 20px),
      0
    ) scale(calc(0.965 + var(--p-rail) * 0.035));
  }

  body.rail-active .sticky-rail {
    pointer-events: auto;
  }

  .rail-nav {
    transform: translate3d(0, calc((1 - var(--p-rail)) * 12px), 0);
  }

  .rail-foot {
    transform: translate3d(0, calc((1 - var(--p-rail)) * 18px), 0);
  }

  .content-col {
    transform: translate3d(calc((1 - var(--p-col)) * var(--col-shift)), 0, 0);
  }
}

/* Sticky Rail Internals */
.rail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.rail-sig { height: 26px; width: auto; opacity: 0.9; }
.rail-sig-link:hover .rail-sig { opacity: 1; }

.rail-theme-btn {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.rail-theme-btn:hover { color: var(--ink); border-color: var(--line-2); }

.rail-avatar {
  display: block;
  width: 90px;
  height: 90px;
  border-radius: 18px;
  overflow: hidden;
  background: #141d2e;
  border: 1px solid var(--line-2);
  margin-bottom: 16px;
}
.rail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 14%;
  transform: scale(1.14);
}

.rail-name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.rail-meta {
  font-size: 13px;
  color: var(--accent);
  margin: 5px 0 12px;
}

.rail-bio {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.58;
  margin-bottom: 24px;
}
.rail-bio em { font-family: var(--serif); font-style: italic; color: var(--ink); font-size: 1.05em; }
.rail-bio strong, .rail-bio a { color: var(--ink); font-weight: 500; }
.rail-bio a { border-bottom: 1px solid var(--line-2); }
.rail-bio a:hover { border-color: var(--accent); color: var(--accent); }

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rail-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
  transition: color 0.15s ease;
}
.rail-nav a span {
  width: 18px;
  height: 1px;
  background: var(--line-2);
  transition: width 0.2s ease, background-color 0.2s ease;
}
.rail-nav a:hover, .rail-nav a.is-active { color: var(--ink); }
.rail-nav a.is-active span { width: 32px; background: var(--accent); }

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.rail-resume {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
}
.rail-links { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); }
.rail-links a:hover { color: var(--ink); }

/* ==========================================================================
   Right Column Sections & Cards (Image 2 Aesthetic)
   ========================================================================== */
.sec { padding-bottom: 56px; scroll-margin-top: 34px; }
.sec-last { padding-bottom: 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.sec-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }

.quiet-btn { font-size: 13px; color: var(--ink-3); transition: color 0.15s ease; }
.quiet-btn:hover { color: var(--ink); }

.card-stack { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.24s var(--ease), transform 0.24s var(--ease);
}
.card:hover { border-color: var(--line-2); }
.card[open] { border-color: var(--line-2); }
[data-theme="light"] .card:hover { box-shadow: 0 3px 14px rgba(12, 18, 29, 0.035); }
[data-theme="light"] .card[open] { box-shadow: 0 8px 28px rgba(12, 18, 29, 0.055); }
[data-theme="dark"] .card[open] { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26); }

.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
}
.card > summary::-webkit-details-marker { display: none; }

.c-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.c-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}
.c-brand strong { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.c-role { font-size: 14px; color: var(--ink-2); }

.c-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.c-one { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }

/* Org Logos */
.brand-adaptive { width: auto; opacity: 0.9; }
[data-theme="dark"] .brand-adaptive { filter: brightness(0) invert(1); opacity: 0.92; }
.b-bindly, .b-tu20 { height: 18px; }
.eta-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.sk-icon, .lp-icon { height: 20px; width: auto; object-fit: contain; flex-shrink: 0; }
[data-theme="light"] .eta-icon { filter: brightness(0); opacity: 0.9; }

/* Plus Toggle */
.plus { position: relative; width: 11px; height: 11px; flex-shrink: 0; }
.plus::before, .plus::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1.4px;
  background: var(--ink-3);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.plus::after { transform: rotate(90deg); }
details[open] > summary .plus::after { transform: rotate(0deg); opacity: 0; }

/* Card Expanded Body */
.c-body {
  padding: 16px 20px 22px;
  border-top: 1px solid var(--line);
}
.c-lead { font-size: 14px; color: var(--ink-2); margin-bottom: 16px; }
.c-lead a { color: var(--accent); margin-left: 4px; font-weight: 500; white-space: nowrap; }
.c-lead a:hover { text-decoration: underline; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 13px 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metrics-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metrics-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics strong { display: block; font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.15; }
.metrics span { font-size: 11.5px; color: var(--ink-3); }

.workflow {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 16px;
}
.wf-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.wf-tab {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wf-tab:hover { color: var(--ink); border-color: var(--line-2); }
.wf-tab.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.workflow h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.workflow p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.wf-stack { font-size: 12px; color: var(--ink-3); }

.detail-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.detail-cols h4 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.detail-cols p { font-size: 13.5px; color: var(--ink-2); }

.clean-list {
  padding-left: 17px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.arc-list { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.arc-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
.arc-row span { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.arc-row strong { color: var(--ink); font-weight: 600; }

.exp-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.more-link { font-size: 13.5px; color: var(--accent); font-weight: 500; }
.more-link:hover { text-decoration: underline; }

/* Background & Contact Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}

.edu-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.edu-row + .edu-row { border-top: 1px solid var(--line); }
.emblem { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.emblem-h { width: 32px; height: 36px; }
.edu-row strong { display: block; font-size: 14.5px; }
.edu-row span { font-size: 13.5px; color: var(--ink-2); }

.caps {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.caps > div { display: grid; grid-template-columns: 142px minmax(0, 1fr); gap: 12px; font-size: 13.5px; }
.caps dt { font-weight: 600; }
.caps dd { color: var(--ink-2); }

.sub-drawer { margin-top: 14px; border-top: 1px solid var(--line); overflow: hidden; }
.sub-drawer summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.sub-drawer summary::-webkit-details-marker { display: none; }
.sub-drawer summary:hover { color: var(--ink); }
.sub-caps { border-top: none; margin-top: 10px; padding-top: 0; }

.contact-lead { font-size: 14.5px; color: var(--ink-2); margin-bottom: 16px; }
.c-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.c-row span { font-size: 12.5px; color: var(--ink-3); }
.c-row a { font-weight: 500; word-break: break-all; }
.c-row a:hover { color: var(--accent); }
.copy-btn { font-size: 12.5px; color: var(--ink-3); }
.copy-btn:hover { color: var(--ink); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--accent);
}
.contact-links a:hover { text-decoration: underline; }

.foot {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.foot a:hover { color: var(--ink); }

.toast {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 200;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Floating back-to-top button */
.to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 150;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 4px 14px rgba(12, 18, 29, 0.22);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), background-color 0.15s ease;
}
.to-top.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.to-top:hover { background: var(--accent); }

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */
@media (max-width: 1024px) {
  .dossier-shell { grid-template-columns: 1fr; gap: 0; width: min(760px, calc(100% - 40px)); }
  .sticky-rail { display: none; }
  .content-col { transform: none !important; padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 12px; }
  .hero-portrait-col { justify-content: center; }
  .portrait-stage { max-width: 340px; }
}

@media (max-width: 680px) {
  .site-nav, .nav-resume { display: none; }
  .mobile-btn { display: inline-block; }
  .metrics, .metrics-4, .metrics-3, .detail-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-cols { grid-template-columns: 1fr; }
  .caps > div, .arc-row { grid-template-columns: 1fr; gap: 2px; }
  .c-row { grid-template-columns: minmax(0, 1fr) auto; }
  .c-row span { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .masthead, .hero-grid, .sticky-rail, .content-col { transition: none !important; }
}
