/* =========================================
   Design Tokens
========================================= */
/* Light — Coffee & Cream */
:root[data-theme="cream"] {
  --c-accent: #8c5e3c;
  --c-accent-2:#a8754f;
  --c-accent-3:#5c3a22;
  --c-text:   #1f1a17;
  --c-muted:  #6e6258;

  --c-bg-1:#f5f2ee; /* page gradient start */
  --c-bg-2:#f0ece7; /* sections/cards */
  --c-bg-3:#f5f2ee;

  --b-accent-10: rgba(31,26,23,0.08);
  --b-accent-20: rgba(31,26,23,0.12);
  --b-accent-25: rgba(31,26,23,0.16);
  --b-accent-30: rgba(31,26,23,0.22);

  /* subtle elevation for light */
  --shadow-1: 0 6px 18px rgba(31,26,23,0.08);

  --btn-fg: var(--c-text);
  --btn-bg: rgba(31,26,23,0.05);
  --btn-bg-hover: rgba(31,26,23,0.12);
  --btn-bd: rgba(31,26,23,0.18);

  /* project cover art */
  --cover-bg: #ebe5dd;
  --cover-panel: #f7f4f0;
  --cover-accent: #8c5e3c;
  --cover-accent-2: #b08355;
  --cover-accent-soft: rgba(140,94,60,0.12);
  --cover-ink: #4a4038;
  --cover-grid: rgba(74,64,56,0.13);

  /* ambient pixel field */
  --pixel-rgb: 140, 94, 60;
  --pixel-alpha: 0.5;
}

/* Dark — Sandstone */
:root[data-theme="sandstone"] {
  --c-accent: #c9a875;
  --c-accent-2:#e1c792;
  --c-accent-3:#b38b5b;
  --c-text:   #ede7e1;
  --c-muted:  #b7ada3;

  --c-bg-1:#0f0d0a;
  --c-bg-2:#1a1713;
  --c-bg-3:#0f0d0a;

  --b-accent-10: rgba(201,168,117,0.15);
  --b-accent-20: rgba(201,168,117,0.22);
  --b-accent-25: rgba(201,168,117,0.28);
  --b-accent-30: rgba(201,168,117,0.34);

  /* subtle elevation for dark */
  --shadow-1: 0 10px 28px rgba(0,0,0,0.35);

  --btn-fg: var(--c-accent);
  --btn-bg: rgba(201,168,117,0.10);
  --btn-bg-hover: rgba(201,168,117,0.18);
  --btn-bd: rgba(201,168,117,0.30);

  /* project cover art */
  --cover-bg: #15120f;
  --cover-panel: #201b16;
  --cover-accent: #d9b884;
  --cover-accent-2: #9c8ec9;
  --cover-accent-soft: rgba(201,168,117,0.14);
  --cover-ink: #b7ada3;
  --cover-grid: rgba(183,173,163,0.13);

  /* ambient pixel field */
  --pixel-rgb: 201, 168, 117;
  --pixel-alpha: 0.75;
}

:root{
  /* layout */
  --container-max: 1200px;
  --container-pad: 2rem;

  /* radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* type */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* glass blur strength */
  --glass: blur(10px);

  /* safe-area */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

section {
    scroll-margin-top: 80px;
}

/* =========================================
   Base / Reset
========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--c-bg-1); /* in case gradient doesn't paint during load */
  overscroll-behavior: none; /* block iOS/Chrome rubber-band peeking white */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--c-bg-1), var(--c-bg-2), var(--c-bg-3));
  color: var(--c-text);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: max(0px, var(--safe-top));
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* =========================================
   Header / Hero
========================================= */
header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem 0;
}

.hero-title {
  min-height: 4rem; /* keeps height during typing */
  margin-bottom: 1rem;
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2), var(--c-accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.typing-cursor {
  color: var(--c-accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-subtitle {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--c-muted);
}

.hero-location {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--c-accent);
}

/* =========================================
   Social Links
========================================= */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 20px;
  color: var(--c-muted);
  text-decoration: none;
  background: rgba(0,0,0,0.03);
  border: 2px solid var(--b-accent-20);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  backdrop-filter: var(--glass);
}

.social-link:hover {
  color: var(--c-accent);
  background: rgba(0,0,0,0.06);
  border-color: var(--c-accent);
  transform: translateY(-2px);
}

.social-icon {
  font-size: 1.2rem;
}

/* =========================================
   Generic Section
   Plain sections rely on whitespace + a rule
   under the heading instead of a bordered card.
   Projects is full-width for its card grid; the
   cards themselves carry the framing.
========================================= */
section {
  margin: 6rem 0;
  padding: 0;
}

.section-plain { max-width: 900px; margin-inline: auto; }

/* scroll-reveal: elements fade/rise into place once in view */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--c-accent);
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--c-accent), transparent);
}

/* =========================================
   About
========================================= */
.about-text {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.1rem;
  color: var(--c-muted);
}

/* =========================================
   Experience (timeline)
========================================= */
.timeline-group-label {
  margin: 2rem 0 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.timeline-group-label:first-of-type { margin-top: 1rem; }

.timeline {
  position: relative;
  list-style: none;
  margin: 0 0 2.5rem;
  padding-left: 3rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--c-accent), transparent 95%);
  opacity: .35;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}
.timeline-item:last-child { margin-bottom: 0; }

.company-badge {
  position: absolute;
  left: -3rem;
  top: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-bg-1);
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-3));
  border: 1px solid var(--b-accent-20);
  box-shadow: var(--shadow-1);
}
.company-badge.brand { background: #0a0a0a; }
.company-badge img { width: 22px; height: 22px; object-fit: contain; }

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1rem;
  margin-bottom: .4rem;
}
.timeline-head h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-text);
}
.timeline-head .at { color: var(--c-accent); font-weight: 500; }
.timeline-head .contract {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-muted);
  border: 1px solid var(--b-accent-20);
  border-radius: 999px;
  padding: 1px 8px;
}
.timeline-dates {
  font-size: .85rem;
  color: var(--c-muted);
  white-space: nowrap;
}

.timeline-bullets { margin: 0 0 .75rem; padding-left: 1.1rem; }
.timeline-bullets li {
  margin-bottom: .35rem;
  color: var(--c-muted);
  line-height: 1.55;
}

/* =========================================
   Now
========================================= */
.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.now-card {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 2rem;
  border-left: 2px solid var(--b-accent-25);
}
.now-dot {
  position: absolute;
  left: -6px;
  top: 1.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 4px var(--b-accent-10);
}
.now-card p { color: var(--c-muted); line-height: 1.55; }
.now-updated {
  margin-top: 1.5rem;
  font-size: .8rem;
  color: var(--c-muted);
  opacity: .7;
}

/* =========================================
   Skills (icon wall)
========================================= */
.skills-lede {
  max-width: 640px;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--c-muted);
}

.skills-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.skill-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--c-bg-2);
  border: 1px solid var(--b-accent-20);
  font-size: 1.7rem;
  cursor: default;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.skill-icon:hover,
.skill-icon:focus-visible {
  transform: translateY(-4px);
  border-color: var(--c-accent);
  box-shadow: var(--shadow-1);
}
.skill-icon img { width: 28px; height: 28px; object-fit: contain; }

/* tooltip label on hover */
.skill-icon::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 3px 8px;
  font-size: .7rem;
  white-space: nowrap;
  color: var(--btn-fg, var(--c-text));
  background: var(--c-bg-2);
  border: 1px solid var(--b-accent-20);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.skill-icon:hover::after,
.skill-icon:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.skills-wall.in-view .skill-icon {
  animation: skill-pop .45s ease backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes skill-pop {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to   { opacity: 1; transform: none; }
}

/* =========================================
   Projects
========================================= */
.project-grid {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* Two per row once there is room, so the four supporting projects land as a
   tidy 2x2 under the featured pair instead of leaving an orphan in a 3-up row. */
@media (min-width: 1040px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg-2);
  border: 1px solid var(--b-accent-10);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: var(--b-accent-30);
  box-shadow: var(--shadow-1);
  transform: translateY(-2px);
}

.project-card:focus-within {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.project-art {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-bottom: 1px solid var(--b-accent-10);
  background-color: var(--cover-bg);
  background-image:
    linear-gradient(to right, var(--cover-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cover-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: background-color .2s ease;
}

.project-cover {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--cover-ink);
}

.project-cover .cover-accent,
.project-cover .cover-ink { transition: opacity 200ms ease; }

/* A cover reads as line art at rest and lights up when the card is hovered. */
.project-card:hover .project-cover .cover-accent { opacity: 1; }
.project-cover .cover-accent { opacity: .88; }

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.6rem;
  padding: 1.25rem;
}

.project-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--c-text);
}

.project-status {
  margin: 0 0 -0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-accent);
}

/* Featured: two flagship projects get more visual weight than the rest of the grid */
.featured-tag {
  display: inline-block;
  width: fit-content;
  padding: 2px 10px;
  color: var(--c-bg-1);
  background: var(--c-accent);
  border-radius: 999px;
}

/* Cards go horizontal — art beside the text rather than a photo band above it.
   The art is a supporting mark, so it should not out-weigh the writing. */
@media (min-width: 700px) {
  .project-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: stretch;
  }
  .project-card.featured .project-art {
    aspect-ratio: auto;
    height: 100%;
    min-height: 272px;
    border-bottom: 0;
    border-right: 1px solid var(--b-accent-10);
  }
  .project-card.featured .project-body {
    justify-content: center;
    padding: 1.9rem;
    gap: 0.7rem;
  }
  /* Centred body, so the link sits with the copy instead of at the far edge. */
  .project-card.featured .project-links { margin: 0.25rem 0 0; padding-top: 0; }
  .project-card.featured .project-name { font-size: 1.4rem; }
  .project-card.featured .project-desc { font-size: 0.96rem; }
}

.project-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--c-muted);
}

.project-tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0;
  padding: 0;
}

.project-tech li {
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--c-muted);
  border: 1px solid var(--b-accent-10);
  border-radius: var(--radius-sm);
}

/* Pinned to the bottom so links line up across cards of differing height */
.project-links {
  margin: auto 0 0;
  padding-top: 0.5rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent);
  text-decoration: none;
}

.project-link:hover { text-decoration: underline; }
.project-link .gh { flex: none; }

@media (prefers-reduced-motion: reduce) {
  .project-card { transition: none; }
  .project-card:hover { transform: none; }
}

/* =========================================
   Footer
========================================= */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--c-muted);
  border-top: 1px solid var(--b-accent-10);
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1.2rem; }
  .container { padding: 0 1rem; }
  section {
    margin: 2rem 0;
    padding: 1.5rem;
  }
}

/* Users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Fullscreen hero; only hero on first load */
.hero {
  position: relative;
  min-height: 100svh; /* better on mobile than 100vh */
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 56px) 0;
  background: linear-gradient(135deg, var(--c-bg-1), var(--c-bg-2), var(--c-bg-3));
}

/* 2-col layout that collapses nicely */
.hero-grid {
  width: 100%;
  max-width: var(--container-max);
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 6vw, 56px);
  align-items: center;
}

.hero-content {
  align-self: center;
}

.hero-avatar {
  display: grid;
  place-items: center;
}

/* round the actual image, keep full image visible */
.hero-avatar img {
  /* width: min(420px, 40vw); */
  width: auto;
  max-height: clamp(260px, 50vh, 560px);
  height: auto;              /* preserve natural ratio */
  object-fit: contain;       /* show entire image */
  border-radius: 50px;       /* ← rounded corners on the image itself */
  padding: 1px;              /* optional frame padding */
  background: linear-gradient(145deg, rgba(255,255,255,.06), transparent 30%);
  border: 1px solid var(--b-accent-10);
  box-shadow: var(--shadow-1);
  display: block;            /* avoid inline-gap artifacts */
}

/* Keep your existing hero-title/subtitle/location styles;
   you can bump sizes a bit for the hero-only context if you like: */
.hero-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hero-subtitle { font-size: clamp(1.1rem, 2.2vw, 1.4rem); }

/* Divider (top or bottom). The path color matches the next section. */
.section-divider {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--container-max) - 2 * var(--container-pad));
  max-width: 100%;
  height: 90px;
  pointer-events: none;
  filter: drop-shadow(0 -6px 12px rgba(0,0,0,0.12));
}

.section-divider path   { fill: var(--c-bg-2); }

@media (max-width: 780px) {
  .section-divider {
    width: calc(100% - 2 * var(--container-pad));
    height: 70px;
  }
}

/* Responsive collapse */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-avatar img { width: min(68vw, 380px); }
  .hero { padding-top: clamp(28px, 8vh, 64px); }
}

/* smooth scroll (respects prefers-reduced-motion) */
html { scroll-behavior: smooth; }

/* top nav */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: var(--glass);
  background: rgba(0,0,0,0.03);
  background: color-mix(in oklab, var(--c-bg-1) 75%, transparent);
  border-bottom: 1px solid var(--b-accent-10);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.site-nav.scrolled {
  background: rgba(0,0,0,0.06);
  background: color-mix(in oklab, var(--c-bg-2) 92%, transparent);
  border-bottom-color: var(--b-accent-20);
  box-shadow: var(--shadow-1, none);
}
.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: .65rem var(--container-pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  color: var(--c-text);
  text-decoration: none;
  border: 1px solid var(--b-accent-20);
  background: rgba(0,0,0,0.03);
  font-weight: 700;
  letter-spacing: .5px;
}

.nav-links {
  list-style: none; display: flex; gap: 1rem; justify-content: center;
}
.nav-links a {
  display: inline-block;
  padding: .4rem .7rem;
  color: var(--c-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--c-text); background: rgba(0,0,0,0.04); }
.nav-links a.active { color: var(--c-accent); background: rgba(0,0,0,0.06); }

.nav-actions { display: flex; align-items: center; gap: .5rem; }

/* icon button (theme toggle) */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  color: var(--btn-fg, var(--c-text));
  background: var(--btn-bg, rgba(0,0,0,0.05));
  border: 1px solid var(--btn-bd, var(--b-accent-20));
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { background: var(--btn-bg-hover, rgba(0,0,0,0.1)); }
.icon-btn:active { transform: scale(0.97); }

/* show the right icon per theme */
.sun, .moon { display: none; }
:root[data-theme="cream"] .sun { display: inline; }       /* light theme shows sun */
:root[data-theme="cream"] .moon { display: none; }
:root[data-theme="sandstone"] .sun { display: none; }      /* dark theme shows moon */
:root[data-theme="sandstone"] .moon { display: inline; }

/* skip link */
.skip-link {
  position: absolute; left: -9999px; top: auto; overflow: hidden;
}
.skip-link:focus {
  left: 12px; top: 12px; z-index: 60;
  background: var(--c-bg-2); color: var(--c-text);
  border: 1px solid var(--b-accent-20);
  padding: .5rem .75rem; border-radius: 8px;
}

/* mobile wrap */
@media (max-width: 780px) {
  .nav-inner { grid-template-columns: auto auto 1fr; }
  .nav-links { display: none; } /* keep it minimal; no hamburger for now */
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  right: clamp(14px, 2vw, 24px);
  bottom: clamp(14px, 2vw, 24px);
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--b-accent-20);
  background: color-mix(in oklab, var(--c-bg-2) 88%, transparent);
  color: var(--c-text);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;        /* hidden state is non-interactive */
  transition: opacity .22s ease, transform .22s ease, background .2s, border-color .2s;
}
.back-to-top:hover {
  background: color-mix(in oklab, var(--c-bg-2) 96%, transparent);
}
.back-to-top:active { transform: translateY(0) scale(0.96); }

/* visible state */
.back-to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;        /* clickable when shown */
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}


/* =========================================
   Section head — heading left, tenure right
========================================= */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.section-head h2 { margin-bottom: 0; }

.tenure {
  margin-left: auto;
  text-align: right;
  line-height: 1;
}
.tenure[hidden] { display: none; }

.tenure-value {
  display: block;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--c-accent-2), var(--c-accent), var(--c-accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tenure-label {
  display: block;
  margin-top: .4rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* =========================================
   Experience — per-role skill chips
========================================= */
.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .1rem;
}

.chip {
  display: inline-block;
  padding: .2rem .65rem;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--c-muted);
  background: var(--b-accent-10);
  border: 1px solid var(--b-accent-20);
  border-radius: 999px;
  white-space: nowrap;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.timeline-item:hover .chip {
  color: var(--c-accent);
  border-color: var(--b-accent-30);
  background: var(--b-accent-20);
}

/* Duration sits with the dates, quieter than the headline total above */
.role-duration {
  display: inline-block;
  margin-left: .5rem;
  padding: .1rem .5rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--c-accent);
  background: var(--b-accent-10);
  border-radius: 999px;
  white-space: nowrap;
}

/* =========================================
   Projects — status + card polish
========================================= */
.project-status.is-wip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: fit-content;
  color: var(--c-muted);
}
.project-status.is-wip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 3px var(--b-accent-10);
}

.project-card:hover .project-art { background-color: var(--cover-panel); }

/* =========================================
   Ambient side animation (flying pixels)
========================================= */
.ambient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .ambient { display: none; }
}

/* =========================================
   Intro curtain
========================================= */
.intro { display: none; }

html.intro-active { overflow: hidden; }
html.intro-active body { overflow: hidden; }

html.intro-active .intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--c-bg-2), var(--c-bg-1) 45%, var(--c-bg-3));
  border-bottom: 1px solid var(--b-accent-20);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  will-change: transform;
}

.intro.lift {
  transform: translateY(-101%);
  transition: transform 1150ms cubic-bezier(.62, .02, .2, 1);
}

.intro.fade {
  opacity: 0;
  transition: opacity 500ms ease;
}

.intro-inner {
  text-align: left;
  padding: 0 1.5rem;
  font-family: var(--font-mono);
}

/* Boot line: quiet status text, then an "ok" that lands after it. */
.intro-status {
  margin-bottom: .9rem;
  font-size: clamp(.72rem, 1.5vw, .95rem);
  letter-spacing: .02em;
  color: var(--c-muted);
  opacity: .8;
  min-height: 1.4em;
}

.intro-ok {
  margin-left: .9em;
  font-weight: 700;
  color: var(--c-accent);
  opacity: 0;
  transform: translateY(-3px);
}
.intro-ok.shown {
  opacity: 1;
  transform: none;
  transition: opacity .25s ease, transform .25s ease;
}

.intro-word {
  display: flex;
  align-items: baseline;
  /* Reserve the finished line up front. The panel centres its contents, so
     without this the whole block slides left as the word grows -- and the
     mascot's hop targets, measured once, would no longer match the letters. */
  min-width: 10ch;
  font-size: clamp(2.2rem, 9vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--c-accent-2);
}

.intro-prompt {
  margin-right: .4em;
  color: var(--c-muted);
  opacity: 0;
}
.intro-prompt.shown { opacity: .65; transition: opacity .2s ease; }

/* Each letter lands with a small kick, as though it were stamped in. */
#introText { display: inline-block; transform-origin: 50% 100%; }
#introText.struck { animation: intro-struck .26s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes intro-struck {
  0%   { transform: translateY(2px) scaleY(.94); }
  100% { transform: none; }
}

.intro-caret {
  display: inline-block;
  width: .55em;
  height: .82em;
  margin-left: .12em;
  background: var(--c-accent);
  opacity: 0;
}
.intro-caret.shown { animation: intro-blink 1s steps(1) infinite; }

@keyframes intro-blink {
  0%, 50% { opacity: .85; }
  51%, 100% { opacity: 0; }
}

/* A physical-looking key: it carries a shadow that collapses when pressed,
   so his weight landing on it reads as the press. */
.intro-enter {
  display: block;
  margin-top: 2.4rem;
  padding: .6rem 1.6rem;
  font-family: var(--font-mono);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--c-accent);
  background: var(--b-accent-10);
  border: 1px solid var(--btn-bd);
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--b-accent-25);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.intro-enter.shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity .3s ease, transform .3s ease;
}

.intro-enter.pressed,
.intro-enter.shown:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--b-accent-25);
  background: var(--c-accent);
  color: var(--c-bg-1);
  transition: transform .09s ease, box-shadow .09s ease, background .09s ease;
}

.intro-skip {
  position: absolute;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  padding: .4rem .9rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--c-muted);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.intro-skip:hover { color: var(--c-accent); border-color: var(--c-accent); }

/* =========================================
   Mascot — the stick figure living on the page
========================================= */
.mascot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 900;
  width: 40px;
  height: 56px;
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity .35s ease;
  will-change: transform;
}
.mascot.awake { opacity: 1; }

.mascot .m-figure {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--c-text);
}

.mascot .m-figure * {
  transform-box: view-box;
  vector-effect: non-scaling-stroke;
}

.mascot .m-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mascot .m-head {
  fill: var(--c-bg-1);
  stroke: currentColor;
  stroke-width: 2.6;
}

/* Facing */
.mascot .m-flip { transform-origin: 20px 28px; transition: transform .18s ease; }
.mascot.face-left .m-flip { transform: scaleX(-1); }

/* Shadow the figure casts on whatever it is standing on */
.mascot .m-shadow {
  fill: rgba(0,0,0,.22);
  transition: opacity .2s ease;
}
.mascot.airborne .m-shadow { opacity: 0; }

/* --- Idle: a slow breath --- */
.mascot.state-idle .m-body { animation: m-breathe 2.6s ease-in-out infinite; }
@keyframes m-breathe {
  50% { transform: translateY(-1px); }
}

/* --- Walk --- */
.mascot.state-walk .m-leg-a { animation: m-leg-a .46s ease-in-out infinite; }
.mascot.state-walk .m-leg-b { animation: m-leg-b .46s ease-in-out infinite; }
.mascot.state-walk .m-arm-a { animation: m-leg-b .46s ease-in-out infinite; }
.mascot.state-walk .m-arm-b { animation: m-leg-a .46s ease-in-out infinite; }
.mascot.state-walk .m-body  { animation: m-bob .23s ease-in-out infinite; }

@keyframes m-leg-a {
  0%, 100% { transform: rotate(22deg); }
  50%      { transform: rotate(-22deg); }
}
@keyframes m-leg-b {
  0%, 100% { transform: rotate(-22deg); }
  50%      { transform: rotate(22deg); }
}
@keyframes m-bob {
  50% { transform: translateY(-1.5px); }
}

/* --- Climb: arms reach overhead and pull, legs push in a small alternation --- */
.mascot.state-climb .m-arm-a { animation: m-climb-arm-a .62s ease-in-out infinite; }
.mascot.state-climb .m-arm-b { animation: m-climb-arm-b .62s ease-in-out infinite; }
.mascot.state-climb .m-leg-a { animation: m-climb-leg-a .62s ease-in-out infinite; }
.mascot.state-climb .m-leg-b { animation: m-climb-leg-b .62s ease-in-out infinite; }

@keyframes m-climb-arm-a {
  0%, 100% { transform: rotate(58deg); }
  50%      { transform: rotate(82deg); }
}
@keyframes m-climb-arm-b {
  0%, 100% { transform: rotate(-82deg); }
  50%      { transform: rotate(-58deg); }
}
@keyframes m-climb-leg-a {
  0%, 100% { transform: rotate(16deg); }
  50%      { transform: rotate(-8deg); }
}
@keyframes m-climb-leg-b {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(16deg); }
}

/* --- Airborne (jump / fall): arms thrown up, legs splayed --- */
.mascot.state-air .m-arm-a { transform: rotate(72deg); }
.mascot.state-air .m-arm-b { transform: rotate(-72deg); }
.mascot.state-air .m-leg-a { transform: rotate(16deg); }
.mascot.state-air .m-leg-b { transform: rotate(-8deg); }
.mascot.state-air .m-arm-a,
.mascot.state-air .m-arm-b,
.mascot.state-air .m-leg-a,
.mascot.state-air .m-leg-b { transition: transform .16s ease; }

/* --- Plop: squash on impact --- */
.mascot.state-plop .m-flip { animation: m-squash .5s cubic-bezier(.3,1.4,.5,1); }
@keyframes m-squash {
  0%   { transform: translateY(6px) scaleY(.58) scaleX(1.32); }
  55%  { transform: translateY(-2px) scaleY(1.1) scaleX(.92); }
  100% { transform: none; }
}
.mascot.face-left.state-plop .m-flip { animation-name: m-squash-left; }
@keyframes m-squash-left {
  0%   { transform: translateY(6px) scaleY(.58) scaleX(-1.32); }
  55%  { transform: translateY(-2px) scaleY(1.1) scaleX(-.92); }
  100% { transform: scaleX(-1); }
}

.mascot .m-dust {
  opacity: 0;
  fill: none;
  stroke: var(--c-muted);
  stroke-width: 2;
  stroke-linecap: round;
}
.mascot.state-plop .m-dust { animation: m-dust .55s ease-out; }
@keyframes m-dust {
  0%   { opacity: .75; transform: scale(.4); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* --- Crouch: the beat of anticipation before a jump --- */
.mascot.state-crouch .m-body  { transform: translateY(5px); }
.mascot.state-crouch .m-arm-a { transform: rotate(55deg); }   /* both arms swing back */
.mascot.state-crouch .m-arm-b { transform: rotate(155deg); }
.mascot.state-crouch .m-leg-a { transform: rotate(13deg); }
.mascot.state-crouch .m-leg-b { transform: rotate(-13deg); }
.mascot.state-crouch .m-body,
.mascot.state-crouch .m-arm-a,
.mascot.state-crouch .m-arm-b,
.mascot.state-crouch .m-leg-a,
.mascot.state-crouch .m-leg-b { transition: transform .12s ease-out; }

/* --- Sit: perched on an edge, legs swinging out over the side --- */
.mascot.state-sit .m-body  { transform: translateY(10px); }
.mascot.state-sit .m-arm-a { transform: rotate(-22deg); }     /* back hand braced behind */
.mascot.state-sit .m-arm-b { transform: rotate(44deg); }      /* front hand on the thigh */
.mascot.state-sit .m-leg-a { animation: m-dangle-a 1.9s ease-in-out infinite alternate; }
.mascot.state-sit .m-leg-b { animation: m-dangle-b 2.3s ease-in-out infinite alternate; }
.mascot.state-sit .m-shadow { opacity: .12; }

@keyframes m-dangle-a { from { transform: rotate(-66deg); } to { transform: rotate(-54deg); } }
@keyframes m-dangle-b { from { transform: rotate(-32deg); } to { transform: rotate(-20deg); } }

/* --- Wave: says hello before opening the door --- */
.mascot.state-wave .m-arm-b { animation: m-wave .42s ease-in-out infinite; }
.mascot.state-wave .m-arm-a { transform: rotate(-10deg); }
.mascot.state-wave .m-body  { animation: m-breathe 2.6s ease-in-out infinite; }

@keyframes m-wave {
  0%, 100% { transform: rotate(-66deg); }
  50%      { transform: rotate(-92deg); }
}

/* --- Stamp: the landing beat as each letter is struck --- */
.mascot.state-stamp .m-body { animation: m-stamp .2s ease-out; }
@keyframes m-stamp {
  0%   { transform: translateY(4px) scaleY(.85); }
  100% { transform: none; }
}

/* --- Press: putting his weight through the key --- */
.mascot.state-press .m-body  { transform: translateY(7px); }
.mascot.state-press .m-arm-a { transform: rotate(-28deg); }
.mascot.state-press .m-arm-b { transform: rotate(28deg); }
.mascot.state-press .m-leg-a { transform: rotate(17deg); }
.mascot.state-press .m-leg-b { transform: rotate(-17deg); }
.mascot.state-press .m-body,
.mascot.state-press .m-arm-a,
.mascot.state-press .m-arm-b,
.mascot.state-press .m-leg-a,
.mascot.state-press .m-leg-b { transition: transform .1s ease-out; }

/* --- Fix: reaches up to straighten whatever he knocked askew --- */
.mascot.state-fix .m-arm-b { animation: m-reach 1.1s ease-in-out; }
.mascot.state-fix .m-arm-a { transform: rotate(-14deg); }
.mascot.state-fix .m-body  { animation: m-lean 1.1s ease-in-out; }

@keyframes m-reach {
  0%, 100% { transform: none; }
  30%, 70% { transform: rotate(-78deg); }
}
@keyframes m-lean {
  0%, 100% { transform: none; }
  30%, 70% { transform: translateY(-1.5px); }
}

/* --- Splat: a hard landing takes him apart, then he puts himself back --- */
.mascot.state-splat .m-arm-a { animation: m-splat-arm-a 1.2s both; }
.mascot.state-splat .m-arm-b { animation: m-splat-arm-b 1.2s both; }
.mascot.state-splat .m-leg-a { animation: m-splat-leg-a 1.2s both; }
.mascot.state-splat .m-leg-b { animation: m-splat-leg-b 1.2s both; }
.mascot.state-splat .m-head  { animation: m-splat-head  1.2s both; }
.mascot.state-splat .m-torso { animation: m-splat-torso 1.2s both; }
.mascot.state-splat .m-dust  { animation: m-dust .55s ease-out; }

/* Each part flies off, lies there a moment, then snaps home on an overshoot. */
@keyframes m-splat-arm-a {
  0%        { transform: none; }
  13%       { transform: translate(-14px, 6px) rotate(-58deg); }
  60%       { transform: translate(-16px, 7px) rotate(-66deg);
              animation-timing-function: cubic-bezier(.3, 1.6, .4, 1); }
  100%      { transform: none; }
}
@keyframes m-splat-arm-b {
  0%        { transform: none; }
  13%       { transform: translate(15px, 5px) rotate(52deg); }
  60%       { transform: translate(17px, 7px) rotate(62deg);
              animation-timing-function: cubic-bezier(.3, 1.6, .4, 1); }
  100%      { transform: none; }
}
@keyframes m-splat-leg-a {
  0%        { transform: none; }
  13%       { transform: translate(-9px, 3px) rotate(-72deg); }
  60%       { transform: translate(-11px, 4px) rotate(-80deg);
              animation-timing-function: cubic-bezier(.3, 1.6, .4, 1); }
  100%      { transform: none; }
}
@keyframes m-splat-leg-b {
  0%        { transform: none; }
  13%       { transform: translate(10px, 3px) rotate(66deg); }
  60%       { transform: translate(12px, 4px) rotate(74deg);
              animation-timing-function: cubic-bezier(.3, 1.6, .4, 1); }
  100%      { transform: none; }
}
@keyframes m-splat-head {
  0%        { transform: none; }
  13%       { transform: translate(6px, -9px); }
  60%       { transform: translate(9px, 8px);
              animation-timing-function: cubic-bezier(.3, 1.7, .4, 1); }
  100%      { transform: none; }
}
@keyframes m-splat-torso {
  0%        { transform: none; }
  13%       { transform: translateY(14px) rotate(80deg) scaleY(.9); }
  60%       { transform: translateY(15px) rotate(84deg) scaleY(.9);
              animation-timing-function: cubic-bezier(.3, 1.5, .4, 1); }
  100%      { transform: none; }
}

/* --- The ladder he takes to get back up the page --- */
.mascot-ladder {
  position: fixed;
  top: 0;
  bottom: 0;
  right: clamp(10px, 3.4vw, 52px);
  width: 26px;
  z-index: 21;
  pointer-events: none;
  opacity: .22;
  transition: opacity .3s ease;
  background:
    linear-gradient(var(--c-accent), var(--c-accent)) left  / 2px 100% no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) right / 2px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--c-accent) 0 2px, transparent 2px 22px);
}
.mascot-ladder.active { opacity: .8; }

@media (prefers-reduced-motion: reduce) { .mascot-ladder { display: none; } }
@media (max-width: 640px)              { .mascot-ladder { display: none; } }

/* --- What he does to the page he lands on --- */
.skills-wall .skill-icon.m-knocked { animation: m-knocked .65s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes m-knocked {
  0%   { transform: translateY(0) rotate(0); }
  18%  { transform: translateY(4px) rotate(-6deg); }
  45%  { transform: translateY(0) rotate(5deg); }
  70%  { transform: rotate(-2.5deg); }
  100% { transform: none; }
}

.project-card.m-pressed,
.now-card.m-pressed { animation: m-pressed .48s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes m-pressed {
  0%   { transform: none; }
  25%  { transform: translateY(3px); }
  100% { transform: none; }
}

/* He knocks the portrait crooked, and puts it back a moment later. */
.hero-avatar img { transition: transform .55s cubic-bezier(.34, 1.5, .5, 1); }
.hero-avatar img.m-tilted { transform: rotate(-2deg); }

/* While the intro panel is up he performs on top of it, not behind it. */
html.intro-active .mascot { z-index: 10000; }

/* --- Lift: riding the panel up, arms out for balance --- */
.mascot.state-lift .m-arm-a { transform: rotate(30deg); }
.mascot.state-lift .m-arm-b { transform: rotate(-30deg); }
.mascot.state-lift .m-leg-a { transform: rotate(9deg); }
.mascot.state-lift .m-leg-b { transform: rotate(-9deg); }
.mascot.state-lift .m-arm-a,
.mascot.state-lift .m-arm-b { transition: transform .2s ease; }
.mascot.state-lift { z-index: 10000; }

@media (prefers-reduced-motion: reduce) {
  .mascot { display: none; }
}

/* The mascot is decoration; below the phone breakpoint the page needs the room */
@media (max-width: 640px) {
  .mascot { display: none; }
}

/* Joint origins for the mascot's limbs (arms hinge at the shoulders,
   legs at the hips), so the rotations above read as a body moving. */
.mascot .m-arm-a,
.mascot .m-arm-b { transform-origin: 20px 20px; }
.mascot .m-leg-a,
.mascot .m-leg-b { transform-origin: 20px 34px; }
.mascot .m-body  { transform-origin: 20px 34px; }
.mascot .m-dust  { transform-origin: 20px 50px; }
