/* ==================================================================
   João Vaz — personal site
   Flat, near-black surface. No gradients as decoration, no glow, no
   blur washes: the page is line-art and type, and the motion does the
   talking. Every animated state is gated on `.js`, so the document
   renders finished when the scripts do not run.
   ================================================================== */

:root {
  --bg: #08090c;
  --bg-2: #0d0f14;
  --ink: #f3f4f7;
  --ink-dim: #a7adbb;
  --ink-faint: #5f6576;
  --line: rgba(255, 255, 255, 0.11);
  --line-soft: rgba(255, 255, 255, 0.055);
  --accent: #6ea8fe;      /* electric blue */
  --accent-2: #b388ff;    /* violet */
  --accent-3: #4fe0c8;    /* teal */
  --maxw: 1160px;
  --gut: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.32, 0.48, 1);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the hero rings bleed past the content box on purpose; `clip` keeps
   that from widening the document the way `hidden` on body alone does */
html { scroll-behavior: auto; overflow-x: clip; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* the hairline column grid the whole page sits on */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line-soft) 0 1px,
    transparent 1px calc(100% / 6)
  );
  background-size: min(var(--maxw), 100vw - 2 * var(--gut)) 100%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.9;
}

main, .nav, .footer { position: relative; z-index: 2; }

::selection { background: var(--accent); color: #06080f; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: 60;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gut);
  transition: background 0.35s var(--ease), padding 0.35s var(--ease),
    border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(8, 9, 12, 0.86);
  border-bottom-color: var(--line);
  padding-top: 13px;
  padding-bottom: 13px;
}
.nav__mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  border: 1px solid var(--line);
}
.nav__mark:hover { border-color: var(--accent); color: var(--accent); }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
/* each label rides in a mask; hover swaps it for its own copy */
.nav__links a:not(.nav__cta) span {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: bottom;
}
.nav__label { font-style: normal; display: inline-block; }
.nav__label--hover {
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  transform: translateY(105%);
}
.js .nav__label { transition: transform 0.4s var(--ease); }
.js .nav__links a:not(.nav__cta):hover .nav__label { transform: translateY(-105%); }
.js .nav__links a:not(.nav__cta):hover .nav__label--hover { transform: translateY(0); }
.nav__links a.is-active { color: var(--accent); }
.nav__cta {
  color: var(--ink);
  padding: 8px 18px;
  border: 1px solid var(--accent);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.nav__cta:hover { background: var(--accent); color: #06080f; }

/* ---------- Layout ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(84px, 13vh, 150px) var(--gut);
}
.section__label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 46px;
}
.section__label span { color: var(--accent); }
.section__label em { font-style: normal; }
/* the rule draws itself once the label lands */
.section__label .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
}
.js .section__label .rule { transform: scaleX(0); }
.js .section__label.is-in .rule {
  animation: ruleDraw 0.9s var(--ease) 0.15s both;
}
@keyframes ruleDraw { from { transform: scaleX(0); } to { transform: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 380px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px var(--gut) 110px;
}
.hero__inner { position: relative; z-index: 2; min-width: 0; }
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.3vw, 13px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 26px;
}
.hero__eyebrow .dot {
  width: 7px; height: 7px;
  background: var(--accent-3);
  border-radius: 50%;
  flex: 0 0 auto;
}
.js .hero__eyebrow .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.hero__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 10.4vw, 132px);
  line-height: 0.88;
  letter-spacing: -0.035em;
  margin-bottom: 34px;
}
/* every character rises out of its own mask */
.hero__line {
  display: block;
  overflow: hidden;
  padding: 0 0.07em 0.08em;
  margin-left: -0.07em;
}
.hero__line-in { display: block; }
.char { display: inline-block; white-space: pre; }
.js .char { transform: translate3d(0, 108%, 0); }
.js .is-lit .char {
  animation: charUp 0.95s var(--spring) both;
  animation-delay: calc(var(--d, 0) * 32ms + var(--base, 0ms));
}
@keyframes charUp {
  from { transform: translate3d(0, 108%, 0); }
  to { transform: none; }
}
.hero__line--accent .hero__line-in { color: var(--accent); }

.hero__lede {
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--ink-dim);
  max-width: 560px;
  margin-bottom: 36px;
}
.hero__lede strong { color: var(--ink); font-weight: 600; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px 30px;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
  will-change: transform;
}
/* the fill wipes up from the floor of the button */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
  z-index: 0;
}
.btn--primary { background: var(--accent); color: #06080f; border-color: var(--accent); }
.btn--primary::before { background: var(--ink); }
.btn--ghost { color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn--primary:hover { color: #06080f; }
.btn--ghost:hover { color: #06080f; }
.btn:hover::before { transform: translateY(0); }
.btn span { position: relative; z-index: 1; }

/* ---------- Hero instrument ---------- */
/* the square the portrait and the rings share */
.hero__figure {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.dial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: translate3d(0, var(--dy, 0px), 0) scale(var(--s, 1));
  pointer-events: none;
}
/* the rings run wider than the portrait square they frame */
.dial__svg { transform-origin: center; }
.dial__svg { width: 152%; height: 152%; overflow: visible; }
.dial [class^="dial__"], .dial circle, .dial rect, .dial path {
  fill: none;
  stroke-linecap: butt;
  transform-box: fill-box;
  transform-origin: center;
}
.dial__ticks circle {
  stroke: var(--ink-faint);
  stroke-width: 6;
  stroke-dasharray: 1.6 8.24;
  opacity: 0.55;
}
.js .dial__ticks { animation: spin 90s linear infinite; }

.dial__arc { stroke-width: 2; stroke-dasharray: 190 815.3; }
.dial__arc--1 { stroke: var(--accent); }
.dial__arc--2 { stroke: var(--accent-2); stroke-dashoffset: -335; }
.dial__arc--3 { stroke: var(--accent-3); stroke-dashoffset: -670; }
.js .dial__arcs { animation: spin 26s linear infinite reverse; }

.dial__dash {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 26 16;
}
.js .dial__dash { animation: spin 44s linear infinite; }

.dial__thin { stroke: var(--ink-faint); stroke-width: 1; opacity: 0.5; }
.dial__cross path { stroke: var(--ink-faint); stroke-width: 1; opacity: 0.45; }

.dial__pip { fill: var(--accent-3); stroke: none; }
.js .dial__pip { animation: spin 12s linear infinite; transform-origin: 200px 200px; }
.dial__pip { transform-box: view-box; }

@keyframes spin { to { transform: rotate(360deg); } }

/* js/ui.js sets this once the hero is off screen */
.dial.is-idle * { animation-play-state: paused !important; }

/* the instrument arrives once, drawn from the centre out */
.js .dial { opacity: 0; }
.js .dial.is-in { animation: dialIn 1.5s var(--ease) 0.15s both; }
@keyframes dialIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.js .dial.is-in .dial__svg { animation: dialScale 1.6s var(--spring) 0.15s both; }
@keyframes dialScale {
  from { transform: scale(0.72) rotate(-24deg); }
  to { transform: none; }
}

.hero__scroll {
  position: absolute;
  z-index: 2;
  bottom: 38px;
  left: var(--gut);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero__scroll-line {
  width: 72px; height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: 0; left: -34%;
  width: 34%; height: 100%;
  background: var(--accent);
}
.js .hero__scroll-line::after { animation: runner 2.2s ease-in-out infinite; }
@keyframes runner { 0% { left: -34%; } 100% { left: 108%; } }

/* ---------- Ticker ---------- */
.ticker {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  padding: 13px 0;
}
.ticker__track {
  display: flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
.ticker__track b { color: var(--accent); font-weight: 400; }
.js .ticker__track { animation: marquee var(--dur, 34s) linear infinite; }
@keyframes marquee { to { transform: translate3d(calc(-1 * var(--half, 50%)), 0, 0); } }
.ticker:hover .ticker__track { animation-play-state: paused; }

/* ---------- About ---------- */
.lead {
  font-family: var(--display);
  font-size: clamp(21px, 2.9vw, 31px);
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 900px;
  margin-bottom: 24px;
}
.lead em { color: var(--accent); font-style: normal; }
.lead strong { color: var(--accent-2); font-weight: 500; }


/* sized to nest inside the innermost ring, so every ring stays whole */
.portrait {
  position: relative;
  z-index: 2;
  margin: 0;
  width: 72%;
  aspect-ratio: 1;
}
.portrait__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
/* corner brackets — the instrument language, applied to the photo */
.portrait::before,
.portrait::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border: 1px solid var(--accent);
  transition: transform 0.45s var(--ease);
}
.portrait::before { top: 4%; left: 4%; border-right: 0; border-bottom: 0; }
.portrait::after { bottom: 4%; right: 4%; border-left: 0; border-top: 0; }
.portrait:hover::before { transform: translate(-7px, -7px); }
.portrait:hover::after { transform: translate(7px, 7px); }
.portrait__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transition: transform 0.7s var(--ease);
}
.portrait:hover .portrait__frame img { transform: scale(1.05); }

/* ---------- Stats ---------- */
/* one hairline grid, not six floating tiles */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 74px;
}
.stat {
  position: relative;
  background: var(--bg);
  padding: 28px 24px 26px;
  overflow: hidden;
  transition: background 0.4s var(--ease);
}
.stat::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease);
}
.stat:hover { background: var(--bg-2); }
.stat:hover::after { transform: none; }
.stat__num {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.stat:nth-child(3n + 1) .stat__num { color: var(--accent); }
.stat:nth-child(3n + 2) .stat__num { color: var(--accent-2); }
.stat:nth-child(3n + 3) .stat__num { color: var(--accent-3); }
.stat__label { font-size: 13.5px; color: var(--ink-dim); line-height: 1.45; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; --tl-fill: 1; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--line);
}
/* the read spine — js/ui.js scales it with the reading position */
.timeline::after {
  content: "";
  position: absolute;
  left: 6px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--accent);
  transform: scaleY(var(--tl-fill));
  transform-origin: 50% 0;
}
.tl {
  position: relative;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 40px;
  padding: 0 0 58px 40px;
}
.tl::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 13px; height: 13px;
  background: var(--bg);
  border: 1px solid var(--ink-faint);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--spring),
    background 0.4s var(--ease);
}
.tl.is-active::before {
  border-color: var(--accent);
  background: var(--accent);
  transform: rotate(45deg) scale(1.05);
}
.tl__body { transition: opacity 0.5s var(--ease); }
.js .tl__body { opacity: 0.62; }
.js .tl.is-active .tl__body { opacity: 1; }
.tl__meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 4px;
  position: sticky;
  top: 110px;
  align-self: start;
}
.tl__date {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.tl__org { font-size: 13px; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 7px; }
.tl__body h3 {
  font-family: var(--display);
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 13px;
}
.tl__body h3 span { color: var(--ink-faint); font-weight: 400; font-size: 0.78em; }
.tl__body p { color: var(--ink-dim); max-width: 620px; margin-bottom: 16px; font-size: 15.5px; }
.tl__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tl__tags li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.tl__tags li:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- Selection ---------- *
   A programme, not a job. It sits after the timeline and keeps the same
   two-column rhythm, but it carries an accent edge and a live marker so
   it never reads as a fourth role. */
.selection {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 40px;
  margin-top: 8px;
  padding: 28px 26px 30px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-3);
  background: rgba(79, 224, 200, 0.035);
  transition: background 0.4s var(--ease);
}
.selection:hover { background: rgba(79, 224, 200, 0.06); }
.selection__meta { display: flex; flex-direction: column; gap: 8px; padding-top: 3px; }
.selection__now {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent-3);
}
.selection__now .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-3);
  flex: 0 0 auto;
}
.js .selection__now .dot { animation: pulse 2.4s ease-in-out infinite; }
.selection__where { font-size: 13px; color: var(--ink-faint); }
.selection__body h3 {
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.selection__body p { color: var(--ink-dim); max-width: 620px; margin-bottom: 16px; font-size: 15.5px; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 52px;
}
.card {
  position: relative;
  background: var(--bg);
  padding: 30px 28px 28px;
  overflow: hidden;
  transition: background 0.4s var(--ease);
}
/* a hairline sweeps the top edge on hover */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent-2);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease);
}
.card:hover { background: var(--bg-2); }
.card:hover::before { transform: none; }
.card__top { margin-bottom: 46px; display: flex; align-items: center; gap: 9px; }
.card__top .ic { color: var(--accent-3); }
.card__kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-3);
}
.card h3 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.card p { font-size: 14.5px; color: var(--ink-dim); margin-bottom: 24px; }
.card__foot { display: flex; gap: 8px; flex-wrap: wrap; }
.card__foot span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--ink-faint);
}
.card__mark { width: 18px; height: 18px; display: block; flex: 0 0 auto; }

/* a card that is itself a link to its own page */
.card--link { display: block; padding-bottom: 64px; }
.card__more {
  position: absolute;
  left: 28px; bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.card__more i {
  font-style: normal;
  transition: transform 0.4s var(--spring);
}
.card--link:hover .card__more i { transform: translateX(7px); }
.card--link:hover .card__more { color: var(--ink); }

/* ---------- Icons ---------- */
.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ink-dim);
}
.ic__svg { width: 100%; height: 100%; display: block; }
.ic--lg { width: 32px; height: 32px; }
.ic--flag { color: var(--ink); }
.ic.logo {
  background: #f6f8fc;
  padding: 3px 5px;
  transition: transform 0.25s var(--ease);
}
.ic.logo .ic__svg { width: 100%; height: 100%; }
.ic.logo--olx { width: 86px; height: 23px; padding: 3px 6px; vertical-align: middle; }
.ic.logo--uni { width: 52px; height: 35px; padding: 4px 6px; }
.ic.logo--uni:has(.ic--logo-fill) { padding: 0; overflow: hidden; }
.uni:hover .ic.logo { transform: translateY(-2px); }

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.skill {
  background: var(--bg);
  padding: 32px 28px;
  transition: background 0.4s var(--ease);
}
.skill:hover { background: var(--bg-2); }
.skill h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 18px;
  color: var(--ink-faint);
}
.skill h4::before { content: "// "; color: var(--accent); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 9px 11px;
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-dim);
  transition: transform 0.3s var(--spring), border-color 0.25s var(--ease),
    color 0.25s var(--ease);
}
.chip:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--ink); }
.chip:hover .ic { color: var(--accent); }
.chip .ic { transition: color 0.25s var(--ease); }
/* chips land one after another when their group arrives */
.js [data-stagger] .chip { opacity: 0; }
.js [data-stagger].is-in .chip {
  animation: chipIn 0.55s var(--spring) both;
  animation-delay: calc(var(--d, 0) * 55ms);
}
@keyframes chipIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.94); }
  to { opacity: 1; transform: none; }
}
/* once every chip has landed the animation is dropped, so the hover
   lift below is free to take the transform back */
.js [data-stagger].is-instant .chip { animation: none; opacity: 1; }

/* education + languages */
.edu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-top: 0;
}
.edu__block { background: var(--bg); padding: 30px 28px; }
.edu__cap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 24px;
}
.edu__cap .ic { width: 15px; height: 15px; color: var(--accent-3); }
.unis, .langs { display: flex; flex-direction: column; gap: 16px; }
.uni, .lang {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.35s var(--ease);
}
.uni:hover, .lang:hover { transform: translateX(5px); }
.uni h4, .lang h4 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.uni span, .lang span { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Contact ---------- */
.section--contact { padding-bottom: 110px; }
.contact__title {
  font-family: var(--display);
  font-size: clamp(38px, 7.4vw, 96px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 56px;
}
.contact__links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.contact__link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 26px 24px;
  background: var(--bg);
  overflow: hidden;
  transition: background 0.4s var(--ease);
}
.contact__link:hover { background: var(--bg-2); }
.contact__link-label {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
}
.contact__link-val {
  font-family: var(--display);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 500;
  transition: transform 0.4s var(--ease), color 0.3s var(--ease);
}
.contact__link:hover .contact__link-val { transform: translateX(6px); color: var(--accent); }
.contact__link-arrow {
  position: absolute;
  right: 24px; bottom: 22px;
  font-size: 20px;
  color: var(--accent);
  opacity: 0;
  transform: translate3d(-10px, 10px, 0);
  transition: opacity 0.35s var(--ease), transform 0.4s var(--spring);
}
.contact__link:hover .contact__link-arrow { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px var(--gut) 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  flex-wrap: wrap;
  gap: 10px;
}

/* ==================================================================
   Reveal on scroll
   The finished state is the default. Only `.js` — set by an inline
   script in the head — hides anything, and js/ui.js is what puts it
   back. A reveal that never fires is therefore visible, not blank.
   The `to` keyframe lands on `transform: none` on purpose: a held
   transform would become the containing block for `.tl__meta`'s
   sticky positioning and pin the dates to the page.
   ================================================================== */
.js .reveal { opacity: 0; }
.js .reveal.is-in {
  animation: revealIn 0.85s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.is-in.is-instant { animation: none; opacity: 1; }
@keyframes revealIn {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body::before { background-image: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px calc(100% / 3)); }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 140px;
    padding-bottom: 120px;
    align-content: center;
    gap: 44px;
  }
  /* the portrait leads, the copy follows */
  .hero__figure { grid-row: 1; width: min(64vw, 260px); justify-self: start; }
  .dial__svg { width: 148%; height: 148%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; }
  .contact__links { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 1fr; gap: 12px; padding-left: 32px; }
  .selection { grid-template-columns: 1fr; gap: 14px; }
  .tl__meta { position: static; top: auto; flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
  .js .tl__body { opacity: 1; }
  .nav__links a:not(.nav__cta) { display: none; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; text-align: center; }
}

/* ==================================================================
   Reduced motion
   Not a shortened animation — a different branch. js/scroll.js never
   starts its loop, and every sequence renders at its end state.
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal, .js .reveal.is-in { opacity: 1; animation: none; }
  .js .char, .char { transform: none; }
  .js .dial, .js .dial.is-in { opacity: 1; }
  .js [data-stagger] .chip { opacity: 1; }
  .js .section__label .rule { transform: none; }
  .js .tl__body { opacity: 1; }
  .tl__meta { position: static; }
  .timeline { --tl-fill: 1; }
}
