/* =========================================================
   TOKENS
   "Paper" is the default: warm off-white, ink text, one deep-blue accent.
   Dark is an explicit opt-in via the toggle (theme.js sets data-theme).
   Every text/background pair here clears WCAG AA (4.5:1) — muted text
   included, since recruiters skim on all kinds of screens.
========================================================= */
:root {
  color-scheme: light;

  --bg: #faf9f6;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1efe9;
  --border: #e5e2d9;
  --border-strong: #d3cfc3;

  --text-primary: #16181d;
  --text-secondary: #464b57;
  --text-muted: #646a78;

  --accent: #2b59c3;
  --accent-strong: #1f469f;
  --accent-bg: #ebf0fb;
  --accent-ring: rgb(43 89 195 / 0.28);
  --on-accent: #ffffff;

  --success: #1f8a5b;
  --shadow-sm: 0 1px 2px rgb(22 24 29 / 0.05);
  --shadow-md: 0 1px 2px rgb(22 24 29 / 0.04), 0 8px 24px -12px rgb(22 24 29 / 0.14);
  --shadow-lg: 0 2px 4px rgb(22 24 29 / 0.04), 0 18px 40px -18px rgb(22 24 29 / 0.22);

  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --sidebar-w: 248px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --max-w: 780px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme="dark"] {
  /* pure black and white: black is the page, white is the accent, and depth
     comes from hairline grey borders rather than shadows (a shadow can't
     darken pure black) */
  color-scheme: dark;

  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --bg-subtle: #161616;
  --border: #262626;
  --border-strong: #3d3d3d;

  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #8c8c8c;

  --accent: #ffffff;
  --accent-strong: #d9d9d9;
  --accent-bg: #1f1f1f;
  --accent-ring: rgb(255 255 255 / 0.35);
  --on-accent: #000000;

  --success: #4cc38a;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 0 0 1px #3d3d3d;
}

/* =========================================================
   BASE
========================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
img { max-width: 100%; display: block; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

.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;
}

@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; }
}

/* =========================================================
   SHARED COMPONENTS
========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}
.btn:hover { border-color: var(--text-muted); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn i { font-size: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn-sm i { font-size: 15px; }
.btn-block { width: 100%; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}

.status-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--success);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .status-dot::after { animation: dot-pulse 2.6s ease-out infinite; }
}
@keyframes dot-pulse {
  0%   { transform: scale(0.8); opacity: 0.6; }
  70%  { transform: scale(2); opacity: 0; }
  100% { transform: scale(2); opacity: 0; }
}

.inline-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-ring);
  transition: text-decoration-color 0.2s ease;
}
.inline-link:hover { text-decoration-color: currentColor; }

/* =========================================================
   LAYOUT
========================================================= */
.layout {
  display: flex;
  align-items: flex-start;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  gap: 4rem;
}

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 520px;
  padding: 3.25rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-top { display: flex; flex-direction: column; gap: 2.75rem; }

.identity .name {
  display: inline-block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.identity .role { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }
.availability {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 7px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
  transition: color 0.2s ease;
}
/* number + rule; the rule grows on the active link so position reads at a glance */
.nav a span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  transition: color 0.2s ease;
}
.nav a span::after {
  content: '';
  width: 18px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.45;
  transition: width 0.3s var(--ease), opacity 0.3s ease;
}
.nav a:hover, .nav a.is-active { color: var(--text-primary); }
.nav a.is-active span { color: var(--accent); }
.nav a:hover span::after, .nav a.is-active span::after { width: 36px; opacity: 1; }

.sidebar-bottom { display: flex; flex-direction: column; gap: 14px; }
.sidebar-row { display: flex; align-items: center; justify-content: space-between; }
.socials { display: flex; gap: 6px; }
.socials a, .theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 19px;
  transition: color 0.2s ease, background 0.2s ease;
}
.socials a:hover, .theme-toggle:hover { color: var(--accent); background: var(--accent-bg); }
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 17px;
}

/* ---------- main ---------- */
main {
  flex: 1;
  min-width: 0;
  max-width: var(--max-w);
  padding: 3.25rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 6.5rem;
}

.section { scroll-margin-top: 2.5rem; }
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}
.section-title span { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--accent); }

/* =========================================================
   HERO
========================================================= */
.hero { padding-top: 1.5rem; }
.eyebrow { font-size: 15px; font-weight: 500; color: var(--accent); margin-bottom: 14px; }
.hero-title {
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 20ch;
  text-wrap: balance;
}
.hero-text {
  margin-top: 22px;
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 62ch;
}
.hero-text strong { color: var(--text-primary); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 12px 40px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.hero-facts dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.hero-facts dd { margin-top: 3px; font-size: 14.5px; font-weight: 500; color: var(--text-primary); }

/* =========================================================
   EXPERIENCE
========================================================= */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: 0; padding-top: 0; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  padding-top: 4px;
}
.timeline-role { font-size: 18px; font-weight: 600; line-height: 1.4; }
.timeline-meta { font-size: 14.5px; color: var(--text-muted); margin-top: 2px; }
.timeline-points { margin: 14px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.timeline-points li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  color: var(--text-secondary);
}
.timeline-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* =========================================================
   PROJECTS
========================================================= */
.project {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--ease);
}
.project[data-href] { cursor: pointer; }
.project:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.project-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.5s var(--ease);
}
.project:hover .project-media img { transform: scale(1.025); }

.project-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.project-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.project-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.project-title a:hover { color: var(--accent); }
.project-desc { font-size: 15px; color: var(--text-secondary); flex: 1; }
.project-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.project-note { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }

/* featured: image beside text on wide screens */
.project-featured { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 1.25rem; }
.project-featured .project-media { aspect-ratio: auto; height: 100%; min-height: 300px; border-bottom: 0; border-right: 1px solid var(--border); }
.project-featured .project-body { padding: 26px 26px 26px; justify-content: center; }
.project-featured .project-title { font-size: 26px; }
.project-featured .project-kicker { color: var(--accent); }

.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* Grably has no public screenshot, so its tile illustrates what it does */
.project-media-tile {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, var(--accent-bg), transparent 60%),
    var(--bg-subtle);
}
.tile-art { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; }
.tile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.tile-chip-solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.tile-arrow { color: var(--accent); font-size: 18px; }

/* =========================================================
   SKILLS
========================================================= */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skill-group {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.skill-group dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}
.skill-group dt i { color: var(--accent); font-size: 18px; }

/* =========================================================
   CONTACT
========================================================= */
.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 32px;
  align-items: center;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}
.contact-heading { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.contact-text { margin-top: 10px; color: var(--text-secondary); font-size: 15.5px; }
.contact-channels { display: flex; flex-direction: column; gap: 8px; }

.contact-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.contact-card:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.contact-card-link { display: flex; align-items: center; gap: 12px; padding: 10px 52px 10px 12px; border-radius: inherit; }
.contact-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}
.contact-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.contact-label { font-size: 13px; color: var(--text-muted); }
.contact-value { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contact-copy {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.contact-copy:hover { color: var(--accent); background: var(--accent-bg); }
.contact-copy.is-copied { color: var(--success); }

/* =========================================================
   FOOTER
========================================================= */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
}

/* =========================================================
   MOTION — scroll reveal
   .reveal is added by initReveal() in script.js, never in the markup, so a
   reduced-motion preference or a failed script never leaves content hidden.
========================================================= */
.reveal {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 450ms var(--ease), transform 450ms var(--ease);
  transition-delay: calc(var(--reveal-i, 0) * 60ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   MOTION — ambient background
   Two fixed, static layers behind the content: a soft accent wash and a
   faint grid fading out from the top. They never scroll, so the browser
   paints them once; the only movement is a transform-only drift on the wash.
========================================================= */
:root { --glow: rgb(43 89 195 / 0.10); --grid-opacity: 0.55; }
:root[data-theme="dark"] { --glow: rgb(255 255 255 / 0.07); --grid-opacity: 0.4; }

body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(50rem 32rem at 18% 0%, var(--glow), transparent 65%),
    radial-gradient(40rem 30rem at 95% 20%, var(--glow), transparent 65%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: var(--grid-opacity);
  -webkit-mask-image: radial-gradient(80rem 50rem at 50% 0%, #000 10%, transparent 70%);
          mask-image: radial-gradient(80rem 50rem at 50% 0%, #000 10%, transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  body::before { animation: ambient-drift 26s ease-in-out infinite alternate; will-change: transform; }
}
@keyframes ambient-drift { to { transform: translate3d(3%, 2%, 0) scale(1.05); } }

/* scroll progress: a hairline at the very top, driven by the scroll position
   itself (scroll-driven animation), so no JS runs while scrolling. Browsers
   without support simply don't show it. */
.scroll-progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-progress {
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 50;
      height: 2px;
      background: var(--accent);
      transform-origin: left;
      transform: scaleX(0);
      animation: scroll-progress linear both;
      animation-timeline: scroll(root);
    }
  }
}
@keyframes scroll-progress { to { transform: scaleX(1); } }

/* =========================================================
   MOTION — pointer light
   A page-wide glow that follows the cursor (lighting the background between
   cards) and a spotlight clipped inside whichever card is under it. Both are
   pre-painted layers moved with translate3d only. Injected by initPointerLight()
   in script.js, so they don't exist on touch screens or under reduced motion.
========================================================= */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  opacity: 0;
  transition: opacity 400ms ease;
}
.cursor-glow.is-on { opacity: 1; }

.skill-group { position: relative; }
/* wrapper clips, inner orb moves — clipping here rather than on the card keeps
   focus rings on the card's own links from being cut off */
.card-glow {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}
.card-glow > i {
  position: absolute;
  top: 0;
  left: 0;
  width: 340px;
  height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%);
}
:root[data-theme="dark"] .card-glow > i { background: radial-gradient(circle, rgb(255 255 255 / 0.09), transparent 70%); }
.is-spotlit .card-glow { opacity: 1; }

/* =========================================================
   MOTION — hover
   Lifts use transform; the accent rings are pre-painted and only their
   opacity animates, so nothing repaints a shadow per frame.
========================================================= */
.project::after,
.skill-group::after,
.contact-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--accent-ring), 0 14px 34px -18px var(--accent-ring);
  opacity: 0;
  transition: opacity 260ms ease;
}
.project:hover::after, .project:focus-within::after,
.skill-group:hover::after,
.contact-card:hover::after, .contact-card:focus-within::after { opacity: 1; }

.project:focus-within { transform: translateY(-3px); }
.skill-group { transition: transform 260ms var(--ease), border-color 0.2s ease; }
.skill-group:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.skill-group dt i { transition: transform 260ms var(--ease); }
.skill-group:hover dt i { transform: translateY(-1px) scale(1.15); }

/* tag ripple: each chip lifts a beat after the one before it */
.tags li { transition: transform 220ms var(--ease), border-color 0.2s ease, color 0.2s ease; }
.project:hover .tags li,
.skill-group:hover .tags li,
.timeline-item:hover .tags li { transform: translateY(-2px); border-color: var(--border-strong); color: var(--text-primary); }
.tags li:nth-child(2) { transition-delay: 30ms; }
.tags li:nth-child(3) { transition-delay: 60ms; }
.tags li:nth-child(4) { transition-delay: 90ms; }
.tags li:nth-child(5) { transition-delay: 120ms; }
.tags li:nth-child(6) { transition-delay: 150ms; }
.tags li:nth-child(n+7) { transition-delay: 180ms; }

/* timeline: a surface fades in behind the entry — an overlay with negative
   insets, so it looks like padding appeared without anything moving */
.timeline-body { position: relative; }
.timeline-body::before {
  content: '';
  position: absolute;
  inset: -14px -18px;
  z-index: -1;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity 260ms ease;
}
.timeline-item:hover .timeline-body::before { opacity: 1; }
.timeline-role { transition: color 0.2s ease; }
.timeline-item:hover .timeline-role { color: var(--accent); }
.timeline-points li::before { transition: transform 260ms var(--ease), opacity 0.2s ease; }
.timeline-item:hover .timeline-points li::before { transform: scale(1.35); opacity: 1; }
.timeline-date { transition: color 0.2s ease; }
.timeline-item:hover .timeline-date { color: var(--text-secondary); }

.contact-card { transition: border-color 0.2s ease, background 0.2s ease, transform 260ms var(--ease); }
.contact-card:hover, .contact-card:focus-within { transform: translateY(-2px); }
.contact-icon { transition: transform 260ms var(--ease); }
.contact-card:hover .contact-icon { transform: scale(1.08) rotate(-4deg); }

.socials a { transition: color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease); }
.socials a:hover, .socials a:focus-visible { transform: translateY(-2px); }
.theme-toggle i { transition: transform 400ms var(--ease); }
.theme-toggle:hover i { transform: rotate(-25deg) scale(1.08); }

/* arrows and icons inside buttons nudge in the direction they point */
.btn i { transition: transform 220ms var(--ease); }
.btn:hover .ti-arrow-right { transform: translateX(3px); }
.btn:hover .ti-external-link, .btn:hover .ti-send { transform: translate(2px, -2px); }
.btn:hover .ti-file-text, .btn:hover .ti-layout-grid { transform: translateY(-1px) scale(1.08); }

/* copy button: a small pop when it succeeds. It's centred with
   translateY(-50%), so the pop carries that through every step */
@media (prefers-reduced-motion: no-preference) {
  .contact-copy.is-copied { animation: copy-pop 320ms var(--ease); }
}
@keyframes copy-pop {
  0%   { transform: translateY(-50%) scale(1); }
  45%  { transform: translateY(-50%) scale(1.2); }
  100% { transform: translateY(-50%) scale(1); }
}

/* hero: the key phrase gets a marker underline that draws itself in */
.hl { position: relative; white-space: nowrap; }
.hl::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.04em;
  z-index: -1;
  height: 0.3em;
  border-radius: 3px;
  background: var(--accent-bg);
  transform-origin: left;
}
:root[data-theme="dark"] .hl::after { background: #2a2a2a; }
@media (prefers-reduced-motion: no-preference) {
  .hl::after { transform: scaleX(0); animation: hl-draw 700ms var(--ease) 650ms forwards; }
}
@keyframes hl-draw { to { transform: scaleX(1); } }

/* availability badge picks up the status colour on hover */
.availability { transition: border-color 0.2s ease; }
.availability:hover { border-color: var(--success); }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 960px) {
  .layout { flex-direction: column; padding: 0 1.25rem; gap: 0; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 1.5rem 0 1.25rem;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-top { gap: 0; }
  .nav { display: none; }   /* single-column page: sections are a short scroll apart */
  .sidebar-bottom { flex-direction: row; align-items: center; margin-top: 18px; gap: 10px; }
  .sidebar-bottom .btn-block { width: auto; }
  .sidebar-row { gap: 6px; }
  main { max-width: 100%; padding-top: 2.5rem; gap: 4.5rem; }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured .project-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .hero { padding-top: 0; }
  .hero-text { font-size: 16.5px; }
  .hero-facts { grid-template-columns: 1fr; gap: 12px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; }
  .timeline-date { padding-top: 0; }
  .project-grid, .skills { grid-template-columns: 1fr; }
  .project-featured .project-body, .project-body { padding: 18px; }
  .contact-panel { grid-template-columns: 1fr; padding: 22px 18px; gap: 20px; }
  .sidebar-bottom { flex-wrap: wrap; }
  .sidebar-bottom .btn-block { flex: 1 1 100%; }
  .sidebar-row { flex: 1; }
}
