/* ==========================================================================
   Faizul Islam — portfolio
   Hand-written. No frameworks, no resets from third parties.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --bg: #0B0D10;
  --surface: #14171C;
  --surface-2: #1A1E25;
  --border: #242932;
  --text: #E8EAED;
  --text-muted: #9AA3AE;
  --muted: var(--text-muted); /* alias: both names resolve to the same value */
  --accent: #2196F3;
  --accent-text: #64B5F6;
  --accent-hover: #42A5F5;
  --accent-soft: rgba(33, 150, 243, 0.12);
  --accent-glow: rgba(33, 150, 243, 0.25);
  --on-accent: #0B0D10;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1100px;
  --gutter: clamp(1rem, 5vw, 3rem);
  --section-pad: clamp(3.5rem, 8vh, 6rem);
  --nav-h: 64px;
  --radius: 12px;
  --ease: 200ms ease;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }

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

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color var(--ease), border-color var(--ease);
}
a:hover { color: var(--accent); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 8px;
  transition: top 150ms ease;
}
.skip-link:focus { top: 0.75rem; color: var(--on-accent); }

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

/* --- Layout ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
  scroll-margin-top: calc(var(--nav-h) + 16px);
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 0.5rem;
}
.section-label span { color: var(--accent); }

.section h2 {
  font-size: clamp(2.25rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.lede { max-width: 68ch; color: var(--muted); }
.lede strong { color: var(--text); font-weight: 500; }

/* --- Nav ---------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 16, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease);
}
.nav.scrolled {
  background: rgba(11, 13, 16, 0.92);
  border-bottom-color: var(--border);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 1rem;
  padding-block: 0.25rem;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* The Résumé button inside the nav must keep button styling, not link styling. */
.nav-links a.btn::after { content: none; }
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover { color: var(--on-accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--ease);
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8125rem; }

/* --- Chips -------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(33, 150, 243, 0.25);
  white-space: nowrap;
}

.tag-muted {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  display: inline-block;
}

/* --- Cards -------------------------------------------------------------- */
.card {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.card h4 {
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card .role {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent-text);
  margin: 0;
}
.card p.desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}
.part-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.card .chips { margin-top: auto; }
.card-foot {
  padding-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}
.card-link svg { width: 14px; height: 14px; flex: none; }

/* --- Hero --------------------------------------------------------------- */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding-block: clamp(3rem, 8vh, 5rem);
  background-image: radial-gradient(48rem 32rem at 72% 18%, var(--accent-glow), transparent 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
  width: 100%;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  max-width: 56ch;
  color: var(--muted);
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-photo {
  position: relative;
  justify-self: end;
  max-width: 360px;
  width: 100%;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 75%);
  filter: blur(8px);
  z-index: -1;
}
.hero-photo img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* --- About -------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.5rem;
}
.fact dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-text);
  margin-bottom: 0.35rem;
}
.fact dd {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

/* --- Timeline ----------------------------------------------------------- */
.timeline {
  border-left: 1px solid var(--border);
  padding-left: clamp(1.25rem, 4vw, 2rem);
  display: grid;
  gap: 3rem;
}
.tl-org {
  position: relative;
}
.tl-org::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.25rem, 4vw, 2rem) - 5px);
  top: 0.6rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}
.tl-head img {
  width: auto;
  height: 28px;
  max-width: 96px;
  border-radius: 6px;
  object-fit: contain;
  flex: none;
}
.tl-head h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
.tl-place {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
/* Education entries are two short lines, so they sit tighter than job entries. */
.edu-timeline { gap: 2rem; }
.edu-timeline .tl-place { margin-bottom: 0.4rem; }
.tl-metric {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent-text);
  margin: 0;
}

.tl-role { margin-bottom: 1.75rem; }
.tl-role:last-child { margin-bottom: 0; }
.tl-role h4 {
  font-size: 1.3125rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.tl-date {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.85rem;
}
.tl-role ul {
  display: grid;
  gap: 0.75rem;
  max-width: 68ch;
}
@media (min-width: 1024px) {
  .tl-role ul { max-width: 82ch; }
}
.tl-role li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}
.tl-role li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 5px; height: 1px;
  background: var(--accent);
}

/* --- Work --------------------------------------------------------------- */
.sub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.sub-head h3 {
  font-size: 1.375rem;
  font-weight: 600;
}
.sub-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.work-group + .work-group { margin-top: 3.5rem; }
.more-line {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Research ----------------------------------------------------------- */
.research-list { display: grid; gap: 0; }
.research-item {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 0.4rem;
}
.research-item:first-child { padding-top: 0; }
.research-item:last-child { border-bottom: 0; }
.research-item h3 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 72ch;
}
.research-item h3 a { color: var(--text); }
.research-item:hover h3 a,
.research-item h3 a:hover,
.research-item h3 a:focus-visible { color: var(--accent-text); }
.research-item h3 .ext {
  width: 13px;
  height: 13px;
  margin-left: 0.35rem;
  vertical-align: -0.08em;
  opacity: 0.65;
}
.research-item:hover h3 .ext { opacity: 1; }
.research-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.badge {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  border: 1px solid rgba(33, 150, 243, 0.25);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}

/* --- Skills ------------------------------------------------------------- */
.skill-groups { display: grid; gap: 2rem; }
.skill-group {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.skill-group > h3 {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--accent-text);
  padding-top: 0.2rem;
}

/* --- Achievements ------------------------------------------------------- */
.award-list { display: grid; gap: 1rem; }
@media (min-width: 768px) {
  .award-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
  }
}
@media (min-width: 1024px) {
  .award-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.award-list li {
  display: grid;
  gap: 0.1rem;
  padding-left: 1.1rem;
  position: relative;
}
.award-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 5px; height: 1px;
  background: var(--accent);
}
.award-list .name { font-weight: 500; }
.award-list .ctx { font-size: 0.875rem; color: var(--muted); }

/* --- Contact ------------------------------------------------------------ */
.contact {
  text-align: center;
  padding-block: clamp(5rem, 13vh, 9rem);
}
.contact h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.contact .lede {
  margin-inline: auto;
  margin-bottom: 2rem;
  max-width: 52ch;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  justify-content: center;
  font-size: 0.9375rem;
}
.contact-links a { color: var(--muted); }
.contact-links a:hover { color: var(--accent); }

/* --- Footer ------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Scroll lock while the mobile overlay menu is open. */
html.nav-open,
html.nav-open body { overflow: hidden; }

/* --- Reveal ------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-group { grid-template-columns: 170px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .hero { min-height: 0; }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .hero-photo {
    order: -1;
    justify-self: start;
    max-width: 200px;
  }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .skill-group { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
}

@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  /* backdrop-filter would make .nav the containing block for its position:fixed
     child, clipping the overlay to the nav bar. Drop it at mobile widths and
     lean on a more opaque background instead. */
  .nav,
  .nav.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(11, 13, 16, 0.94);
  }
  /* Brand and close button stay clickable above the overlay. */
  .brand,
  .nav-toggle { position: relative; z-index: 2; }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
    background: rgba(11, 13, 16, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: var(--nav-h) var(--gutter) 2rem;
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0.5rem;
    font-size: 1.375rem;
    font-weight: 500;
  }
  .nav-links a::after { display: none; }
  .nav-links .btn {
    margin-top: 1.25rem;
    min-height: 44px;
    justify-content: center;
    align-self: stretch;
    font-size: 1rem;
  }
}

@media (max-width: 767px) {
  .grid-2,
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .hero-grid { gap: 1.25rem; }
  .hero-photo { max-width: 168px; }
  .hero-photo img { border-radius: 16px; }
}

@media (max-width: 420px) {
}

/* --- Motion preferences ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover { transform: none; }
  .hero { background-attachment: scroll; }
}

/* ==========================================================================
   Personality layer — icons, motion, small details
   Everything here animates transform/opacity only, so nothing shifts layout.
   ========================================================================== */

/* --- Icon system -------------------------------------------------------- */
.ico {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
}
.ico-lg { width: 22px; height: 22px; }
.ico-sm { width: 18px; height: 18px; }
.ico-xs { width: 14px; height: 14px; }
.ico-btn { width: 17px; height: 17px; }

/* --- Section headers ---------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-head .section-label { margin-bottom: 0.35rem; }
.section-head h2 { margin-bottom: 0; }
.section-head-center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sec-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid rgba(33, 150, 243, 0.25);
  color: var(--accent);
  margin-top: 0.15rem;
}
.js .reveal .sec-icon { transform: scale(0.8); }
.js .reveal.is-visible .sec-icon {
  transform: scale(1);
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Inline icons ------------------------------------------------------- */
.fact dt,
.skill-group > h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.fact dt .ico,
.skill-group > h3 .ico { color: var(--accent); }

.award-list li {
  padding-left: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 0.6rem;
  align-items: start;
}
.award-list li::before { content: none; }
.award-list li > .ico {
  /* explicit placement: `1 / -1` collapses to a single row in an implicit grid,
     which pushed the context line into the 18px icon column */
  grid-column: 1;
  grid-row: 1;
  margin-top: 0.28rem;
  color: var(--muted);
  transition: color var(--ease), transform var(--ease);
}
.award-list li > .name { grid-column: 2; grid-row: 1; }
.award-list li > .ctx  { grid-column: 2; grid-row: 2; }
.award-list li:hover > .ico { color: var(--accent); transform: translateY(-1px); }

.badge .ico { color: currentColor; margin-right: 0.3rem; vertical-align: -0.15em; }
.footer-inner .ico { color: var(--accent); margin-right: 0.4rem; }

/* --- Buttons with icons ------------------------------------------------- */
.btn .ico-btn { transition: transform var(--ease); }
.btn:hover .ico-btn { transform: translateX(3px); }
.btn:hover .ico-nudge { transform: translate(2px, -2px); }
/* only the trailing arrow is hover-revealed; the file-text icon must stay visible */
.nav-links a.btn .cv-arrow {
  width: 0;
  opacity: 0;
  transition: width var(--ease), opacity var(--ease), transform var(--ease);
}
.nav-links a.btn:hover .cv-arrow { width: 17px; opacity: 1; }

.more-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0;
}
.more-actions .btn {
  min-height: 44px;
  font-size: 1rem;
  gap: 0.6rem;
}

.copy-btn .i-check { display: none; }
.copy-btn.copied .i-check { display: inline-block; animation: pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.copy-btn.copied .i-copy { display: none; }
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }

/* --- Hero: availability pill ------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin-bottom: 1.25rem;
}
.pill-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.pill-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(1);   opacity: 0.6; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* --- Hero: canvas data field ------------------------------------------- */
.hero { position: relative; }
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; }

/* --- Hero: entrance ----------------------------------------------------- */
.words .w {
  display: inline-block;
  white-space: pre;
}
.js .hero .pill,
.js .hero .eyebrow,
.js .hero .hero-sub,
.js .hero .hero-actions,
.js .hero .social-row,
.js .words .w {
  opacity: 0;
  transform: translateY(14px);
}
.js .hero-photo img {
  opacity: 0;
  transform: scale(0.96);
}
.js .hero.entered .pill,
.js .hero.entered .eyebrow,
.js .hero.entered .hero-sub,
.js .hero.entered .hero-actions,
.js .hero.entered .social-row,
.js .words.entered .w {
  opacity: 1;
  transform: none;
  transition: opacity 500ms ease-out, transform 500ms ease-out;
  transition-delay: var(--d, 0ms);
}
.js .hero.entered .hero-photo img {
  opacity: 1;
  transform: none;
  transition: opacity 700ms ease-out, transform 700ms ease-out;
}
.hero-photo::before { animation: breathe 8s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

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

/* --- Staggered reveal --------------------------------------------------- */
.js .reveal.is-visible { transition-delay: calc(var(--i, 0) * 70ms); }

/* --- Timeline rail + dots ----------------------------------------------- */
.timeline { position: relative; border-left-color: transparent; }
.timeline::before {
  content: "";
  position: absolute;
  left: -1px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
  transform-origin: top;
}
.js .timeline::before { transform: scaleY(0); }
.js .timeline.drawn::before {
  transform: scaleY(1);
  transition: transform 900ms ease-out;
}
.js .tl-org::before { transform: scale(0); }
.js .tl-org.is-visible::before {
  transform: scale(1);
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms;
}

/* --- Card spotlight + top highlight ------------------------------------- */
.card { position: relative; overflow: hidden; }
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(33, 150, 243, 0.10), transparent 70%);
  opacity: 0;
  transition: opacity var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.card > * { position: relative; z-index: 1; }
.card .chip { transition: transform var(--ease), background var(--ease); }
.card:hover .chip { transform: translateY(-1px); }

/* --- Nav moving underline ----------------------------------------------- */
.nav-underline {
  display: none;
  position: absolute;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  width: 0;
  opacity: 0;
  transform: translateX(0);
  transition: transform 250ms ease-out, width 250ms ease-out, opacity 200ms ease-out;
  pointer-events: none;
}
@media (min-width: 768px) {
  .nav-links { position: relative; }
  .nav-links a::after { content: none; }
  .nav-underline { display: block; }
}

/* The full link row has to fit from 768px up, so it tightens below 1024. */
.nav-links a { white-space: nowrap; }
.nav-cv .cv-icon { display: none; }

@media (min-width: 768px) and (max-width: 1023px) {
  .nav-inner { gap: 0.75rem; }
  .brand { font-size: 1rem; }
  .nav-links a { font-size: 0.9375rem; }
  .nav-links a.btn { padding: 0.5rem 0.9rem; }
  .nav-links { gap: 1.1rem; }
}
/* 768-899 is the tightest band: eight links plus a button do not fit with the
   Résumé label, so it becomes an icon-only button and the gap compresses. */
@media (min-width: 768px) and (max-width: 899px) {
  .nav-links { gap: 0.6rem; }
  .nav-cv .cv-icon { display: inline-block; }
  .nav-cv .cv-text,
  .nav-cv .cv-arrow { display: none; }
  .nav-links a.btn { padding: 0.5rem 0.7rem; }
}
@media (min-width: 1024px) {
  .nav-links { gap: 1.4rem; }
  .nav-links a { font-size: 1rem; }
}

/* --- Back to top -------------------------------------------------------- */
.to-top {
  position: fixed;
  right: clamp(1rem, 4vw, 2rem);
  bottom: clamp(1rem, 4vw, 2rem);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 250ms ease-out, transform 250ms ease-out, visibility 250ms, border-color var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* --- Motion preferences ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-field { display: none; }
  .pill-dot::after,
  .hero-photo::before { animation: none; }
  .js .hero .pill,
  .js .hero .eyebrow,
  .js .hero .hero-sub,
  .js .hero .hero-actions,
  .js .hero .social-row,
  .js .words .w,
  .js .hero-photo img { opacity: 1; transform: none; }
  .js .timeline::before,
  .js .tl-org::before,
  .js .reveal .sec-icon { transform: none; }
  .js .reveal.is-visible { transition-delay: 0ms; }
  .card::before { display: none; }
  .btn:hover .ico-btn,
  .btn:hover .ico-nudge { transform: none; }
  .nav-underline { transition: none; }
}

/* --- Cursor flow trail -------------------------------------------------- */
#cursor-flow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;           /* above content, below the nav (100) */
  mix-blend-mode: screen;
}
@media (prefers-reduced-motion: reduce) {
  #cursor-flow { display: none; }
}

/* --- Social link pills --------------------------------------------------- */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.social-row-center { justify-content: center; margin-top: 2rem; }

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease), transform var(--ease), background var(--ease);
}
.social-pill .ico { width: 18px; height: 18px; color: var(--muted); transition: color var(--ease); }
.social-pill:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.social-pill:hover .ico { color: var(--accent); }

/* --- Nav icon buttons (desktop only; the hero pills cover smaller widths) - */
.nav-ico {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color var(--ease), color var(--ease);
}
.nav-ico .ico { width: 18px; height: 18px; }
.nav-ico:hover { border-color: var(--accent); color: var(--accent); }
/* 1024 cannot spare the ~117px these two need on top of eight links, so they
   join once there is real room. The hero pills cover every width below. */
@media (min-width: 1200px) {
  .nav-ico { display: inline-flex; }
}

/* --- Hero tagline -------------------------------------------------------- */
.tagline {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0.75rem 0 1rem;
}
@media (max-width: 767px) {
  .tagline { font-size: 1.125rem; }
}
.js .hero .tagline { opacity: 0; transform: translateY(14px); }
.js .hero.entered .tagline {
  opacity: 1;
  transform: none;
  transition: opacity 500ms ease-out, transform 500ms ease-out;
  transition-delay: var(--d, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .js .hero .tagline { opacity: 1; transform: none; }
  .social-pill:hover { transform: none; }
}

/* --- Linked organisation names ------------------------------------------ */
.org-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;          /* matches the old .tl-head gap between logo and name */
  color: var(--text);
  text-decoration: none;
}
.org-link h3 { transition: color var(--ease); }
.org-link:hover h3,
.org-link:focus-visible h3 { color: var(--accent-text); }

/* Inline variant: the institution name sits inside the mono place line. */
.org-link-inline {
  display: inline;
  gap: 0;
  color: inherit;
  transition: color var(--ease);
}
.org-link-inline:hover,
.org-link-inline:focus-visible { color: var(--accent-text); }

.org-ext {
  margin-left: 0.4rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--ease);
  vertical-align: -0.08em;
}
.org-link:hover .org-ext,
.org-link:focus-visible .org-ext { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .org-ext { transition: none; }
}

/* --- "Also built at Onwards" strip --------------------------------------- */
/* Deliberately quieter than the featured cards: no fill, no lift, no spotlight. */
.also-strip { margin-top: 2.5rem; }
.also-label,
.more-label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.more-label { margin-top: 2rem; }
.grid-also {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}
@media (min-width: 768px) {
  .grid-also { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.also-tile {
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--ease);
}
.also-tile:hover { border-color: var(--accent); }
.also-tile h4 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.also-tile p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.also-tile .chips { margin-top: auto; padding-top: 0.15rem; }
.also-tile .chip { font-size: 0.75rem; }
