/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ---------- atmosphere ---------- */
.halftone {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, var(--accent) 1px, transparent 1.3px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 78% 8%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 65% 55% at 78% 8%, #000 0%, transparent 72%);
  opacity: 0.42;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: url('../assets/img/grain.svg');
  opacity: 0.03;
}
main, header.nav, footer { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
.nav-mark { text-decoration: none; font-weight: 700; color: var(--ink); }
.nav-mark span { color: var(--accent); }
.nav ul { display: flex; gap: clamp(12px, 2.4vw, 28px); list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; color: var(--ink-mute); transition: color .2s; }
.nav ul a:hover, .nav ul a[aria-current="true"] { color: var(--accent); }
@media (max-width: 720px) {
  /* all links stay reachable: the list becomes a swipeable strip */
  .nav .wrap { gap: 12px; }
  .nav ul {
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    gap: 18px; padding-right: 8px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav ul li { flex: none; }
}

/* ---------- section scaffolding ---------- */
section { position: relative; padding-block: clamp(72px, 12vw, 140px); scroll-margin-top: 56px; }
.marker { color: var(--accent); margin-bottom: 20px; white-space: pre; }
.marker b { font-weight: 400; color: var(--ink-mute); }
.section-title { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 18ch; margin-bottom: 20px; }
.lede { color: var(--ink-mute); max-width: 62ch; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .22s, box-shadow .22s;
}
.panel:hover, .panel:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 48px -12px var(--glow); }

.chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--ink-mute);
  font-size: 11px;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--accent);
  transition: box-shadow .22s, background .22s, color .22s;
}
.btn-solid { background: var(--accent); color: var(--bg); font-weight: 700; }
.btn-solid:hover { box-shadow: 0 0 32px var(--glow); }
.btn-ghost { color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--glow); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(56px, 9vw, 110px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.ghost {
  font-family: var(--font-sans); font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent-dim);
  line-height: .8; letter-spacing: -0.04em;
  pointer-events: none; user-select: none;
}
.hero .ghost { position: absolute; left: -0.04em; top: 38px; font-size: clamp(7rem, 22vw, 20rem); opacity: .22; z-index: -1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chips .chip { color: var(--accent); border-color: var(--accent-dim); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.5rem); margin-bottom: 24px; }
.hero h1 .mono-word {
  font-family: var(--font-mono); font-weight: 400;
  font-size: .82em; letter-spacing: -0.03em; text-transform: none;
  color: var(--accent);
}
.hero .lede { margin-bottom: 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 56px); margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dd { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.stats dt { color: var(--ink-mute); margin-top: 8px; max-width: 18ch; font-size: 11px; }

/* fake browser stack */
.stack { position: relative; height: 420px; }
.win {
  position: absolute; width: min(100%, 360px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px #000c;
  transition: transform .5s var(--ease), border-color .22s;
}
.win:nth-child(1) { top: 0;   right: 12%; transform: rotate(-3deg); }
.win:nth-child(2) { top: 120px; right: 0;   transform: rotate(4deg); }
.win:nth-child(3) { top: 240px; right: 20%; transform: rotate(-1.5deg); }
.stack:hover .win:nth-child(1) { transform: translate(-28px, -24px) rotate(-6deg); }
.stack:hover .win:nth-child(2) { transform: translate(24px, 0) rotate(7deg); }
.stack:hover .win:nth-child(3) { transform: translate(-12px, 30px) rotate(-3deg); }
.win:hover { border-color: var(--accent); }
.win-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-mute); font-size: 11px; }
.win-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.win-bar i + i { background: var(--line); }
.win-body { padding: 18px; display: grid; gap: 10px; }
.win-body .row { height: 8px; border-radius: 4px; background: var(--line); }
.win-body .row.a { background: var(--accent-dim); width: 40%; }
.win-body .row.s { width: 70%; }
.win-body .row.xs { width: 45%; }
.win-body .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.win-body .grid span { height: 34px; border-radius: 6px; border: 1px solid var(--line); }
.win-body .grid span:first-child { border-color: var(--accent-dim); }
.win-body .wave { display: flex; align-items: center; gap: 4px; height: 44px; }
.win-body .wave span { flex: 1; background: var(--accent-dim); border-radius: 2px; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .stack { height: 360px; max-width: 420px; }
}
@media (max-width: 480px) {
  .stack { display: none; }
}

/* ---------- marquee ---------- */
.marquee { position: relative; z-index: 1; border-block: 1px solid var(--line); padding-block: 14px; overflow: hidden; display: grid; gap: 10px; }
.marquee ul { display: flex; gap: 40px; width: max-content; margin: 0; padding: 0; list-style: none; animation: slide 38s linear infinite; }
.marquee ul + ul { animation-duration: 52s; animation-direction: reverse; }
.marquee:hover ul { animation-play-state: paused; }
.marquee li { display: flex; align-items: center; gap: 12px; color: var(--ink-mute); white-space: nowrap; }
.marquee li::before { content: ''; border-left: 7px solid var(--accent); border-block: 4.5px solid transparent; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee ul { animation: none; } }

/* ---------- /01 into ---------- */
.into-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 40px; }
.into-grid .panel { padding: 28px; }
.into-grid .about { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start; }
.into-grid .about p { color: var(--ink-mute); max-width: 62ch; }
.portrait { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
@media (max-width: 560px) { .into-grid .about { grid-template-columns: 1fr; } .portrait { max-width: 220px; } }
.into-grid h3 { font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.into-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.into-grid .side { display: grid; gap: 16px; }
@media (max-width: 800px) { .into-grid { grid-template-columns: 1fr; } }

/* ---------- /02 software ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 40px; list-style: none; padding: 0; }
.card { display: flex; flex-direction: column; padding: 22px; min-height: 230px; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--ink-mute); font-size: 11px; }
.card-top .status { color: var(--accent); }
.card h3 { font-size: 1.35rem; margin-bottom: 4px; }
.card .role { color: var(--ink-mute); font-size: 11px; margin-bottom: 12px; }
.card p { color: var(--ink-mute); font-size: 15px; margin-bottom: 16px; }
.card .chips { margin: 0 0 16px; }
.card .chips .chip { color: var(--ink-mute); border-color: var(--line); }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-mute); }
.card-foot a { color: var(--accent); text-decoration: none; }
.card-foot a:hover { text-decoration: underline; }

/* ---------- /03 timeline ---------- */
.timeline { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 56px; }
.tl-year { display: grid; grid-template-columns: 160px 1fr; gap: 32px; }
.tl-year .yr {
  position: sticky; top: 88px; align-self: start;
  font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; text-transform: none;
  color: var(--accent); line-height: 1;
}
.tl-items { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 1px solid var(--line); display: grid; gap: 22px; }
.tl-items li { position: relative; }
.tl-items li::before {
  content: ''; position: absolute; left: -33px; top: .55em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl-items li:first-child::before { background: var(--accent); box-shadow: 0 0 12px var(--glow); }
.tl-items strong { font-weight: 600; }
.tl-items .detail { display: block; color: var(--ink-mute); font-size: 15px; margin-top: 2px; }
@media (max-width: 640px) {
  .tl-year { grid-template-columns: 1fr; gap: 16px; }
  .tl-year .yr { position: static; }
}

/* ---------- /04 writing ---------- */
.writing { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 40px; list-style: none; padding: 0; }
.writing .panel { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.writing .kind { color: var(--accent); font-size: 11px; }
.writing h3 { font-size: 1.2rem; line-height: 1.25; }
.writing p { color: var(--ink-mute); font-size: 15px; }
.writing .card-foot { margin-top: auto; }

/* ---------- thesis + contact ---------- */
.thesis { text-align: center; padding-block: clamp(96px, 16vw, 200px); }
.thesis p {
  font-size: clamp(2rem, 5.4vw, 4.4rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em;
  max-width: 20ch; margin-inline: auto;
}
.thesis p em { font-style: normal; color: var(--accent); }
.contact { padding-top: 0; text-align: center; }
.contact .lede { margin: 0 auto 32px; }
.contact .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin-top: 32px; list-style: none; padding: 0; }
.contact .links a { color: var(--ink-mute); text-decoration: none; }
.contact .links a:hover { color: var(--accent); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); overflow: hidden; }
footer .meta a { color: inherit; }
footer .meta a:hover { color: var(--accent); }
footer .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 24px; color: var(--ink-mute); font-size: 11px; }
footer .ghost { pointer-events: auto; font-size: 27vw; text-align: center; margin-bottom: -0.2em; opacity: .5; white-space: nowrap; }

/* ---------- print / no-motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .win, .panel, .btn { transition: none; }
}

/* ---------- legal page ---------- */
.legal { padding-block: clamp(56px, 9vw, 110px); }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 12px; }
.legal h2 { font-size: 1.25rem; margin: 40px 0 10px; }
.legal p, .legal li { color: var(--ink-mute); max-width: 62ch; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent); }

/* ---------- LatticeLoader ---------- */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  background: hsl(148 58% 11%);
  color: hsl(148 20% 92%);
  transition: opacity .35s ease;
  animation: loader-failsafe 0s 7s forwards; /* never trap the page if JS stalls */
}
.lattice { display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
.lattice i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .15; transition: opacity 90ms linear, background .2s; }
.loader-label { font-size: 14px; letter-spacing: .12em; }
.loader-time { font-size: 12px; opacity: .7; min-width: 6ch; text-align: center; }
.loader.done .lattice i { background: #22c55e; }
.loader.done .loader-label { color: #22c55e; }
.loader.out { opacity: 0; pointer-events: none; }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- GridMotion (auto-running) ---------- */
.gridmotion { position: relative; z-index: 1; height: clamp(320px, 42vw, 480px); overflow: hidden; border-block: 1px solid var(--line); }
.gm-tilt { position: absolute; inset: -30% -20%; display: grid; align-content: center; gap: 14px; transform: rotate(-12deg); }
.gm-row { display: flex; gap: 14px; width: max-content; animation: gm 60s linear infinite; }
.gm-row:nth-child(even) { animation-direction: reverse; animation-duration: 75s; }
.gm-row:nth-child(3) { animation-duration: 52s; }
.gm-tile {
  flex: none; width: 220px; height: 120px; border-radius: var(--radius);
  display: grid; place-items: center; text-align: center; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-mute);
}
.gm-accent { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.gm-img { padding: 0; overflow: hidden; }
.gm-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); mix-blend-mode: luminosity; opacity: .8; }
.gm-logo { padding: 16px 20px; }                       /* transparent logos sit on the normal tile */
.gm-logo img { width: 100%; height: 100%; object-fit: contain; }
@keyframes gm { to { transform: translateX(-25%); } }   /* one of four copies */
@media (prefers-reduced-motion: reduce) { .gm-row { animation: none; } }

/* ---------- easter eggs ---------- */
.catch-zone { display: flex; justify-content: center; padding-block: 40px 8px; position: relative; }
.catch-me { position: relative; }
.the-end { height: 1px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; translate: -50% 16px;
  background: var(--accent); color: var(--bg); font-weight: 700;
  padding: 10px 16px; border-radius: 999px; max-width: calc(100vw - 32px); text-align: center;
  opacity: 0; transition: opacity .25s, translate .25s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; translate: -50% 0; }
.bug-field { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.bug {
  position: absolute; width: 24px; height: 28px; padding: 0; border: 0; cursor: crosshair;
  pointer-events: auto; rotate: var(--r);
  background: var(--accent);
  -webkit-mask: url('../assets/img/bug.svg') center / contain no-repeat;
  mask: url('../assets/img/bug.svg') center / contain no-repeat;
  animation: wiggle .35s ease-in-out infinite alternate;
}
.bug.boca { background: linear-gradient(#103f79 0 42%, #f3b229 42% 62%, #103f79 62%); }
.bug.squashed { animation: none; scale: 1.4 .2; opacity: 0; transition: scale .2s, opacity .3s; }
@keyframes wiggle { to { rotate: calc(var(--r) + 8deg); } }
@media (prefers-reduced-motion: reduce) { .bug { animation: none; } }

/* ---------- touch devices ---------- */
@media (pointer: coarse) {
  /* 44px tap targets without changing the visual size of the text */
  .nav a, .card-foot a, .contact .links a, footer .meta a, .writing .card-foot a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .nav-mark { -webkit-tap-highlight-color: transparent; }
  .panel:hover { box-shadow: none; border-color: var(--line); }   /* no sticky hover after a tap */
  .stack:hover .win { transform: none; }
}
@media (max-width: 560px) {
  .gm-tile { width: 150px; height: 84px; font-size: 10px; padding: 8px; }
  .gm-row, .gm-tilt { gap: 10px; }
  .gridmotion { height: 260px; }
  .hero .cta .btn { flex: 1 1 auto; justify-content: center; }
  .stats { gap: 20px 28px; }
  .into-grid .panel, .into-grid .about { padding: 20px; }
  .card { min-height: 0; }
  .contact .btn { max-width: 100%; font-size: 11px; letter-spacing: .06em; }
  footer .meta { flex-direction: column; }
}

/* small logo marks beside names */
.mark { display: inline-block; height: 1.15em; width: auto; max-width: 3.6em; object-fit: contain; vertical-align: -0.2em; margin-right: .45em; }
.tl-items .mark { height: 1.3em; }
.mark-word { max-width: 6em; margin-right: .3em; }
.mq-logo { height: 18px; width: auto; }

/* Everything stays inside its tile: photos crop to fill, logos fit with padding. */
.gm-tile { position: relative; overflow: hidden; }
.gm-tile img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.gm-img img { object-fit: cover; object-position: center; }
.gm-logo { padding: 0; }
.gm-logo img { inset: 16px 22px; width: calc(100% - 44px); height: calc(100% - 32px); object-fit: contain; }
@media (max-width: 560px) { .gm-logo img { inset: 10px 14px; width: calc(100% - 28px); height: calc(100% - 20px); } }

/* expandable timeline entry (native <details>, works without JS) */
.tl-more summary { cursor: pointer; list-style: none; }
.tl-more summary::-webkit-details-marker { display: none; }
.tl-more summary .detail { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
.tl-more summary .detail::after { content: '▸'; transition: transform .2s; }
.tl-more[open] summary .detail::after { transform: rotate(90deg); }
.tl-sub { list-style: none; margin: 14px 0 0; padding: 0 0 0 16px; border-left: 1px dashed var(--line); display: grid; gap: 12px; }
.tl-sub .detail { display: block; color: var(--ink-mute); font-size: 15px; }

/* ---------- motion (js/motion.js adds .motion; nothing hides without it) ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px var(--glow); }

.motion .rv { opacity: 0; transform: translateY(26px); filter: blur(4px); transition: opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms), filter .7s var(--ease) var(--d, 0ms); }
.motion .rv.in { opacity: 1; transform: none; filter: none; }

/* hero words rise after the loader (~1.1s) */
.motion .hero h1 .w { display: inline-block; opacity: 0; transform: translateY(0.5em) rotate(2deg); animation: word-in .8s var(--ease) forwards; animation-delay: calc(.1s + var(--i) * 70ms); }
@keyframes word-in { to { opacity: 1; transform: none; } }
.motion .hero .chips, .motion .hero .lede, .motion .hero .cta, .motion .hero .stats { opacity: 0; animation: fade-up .8s var(--ease) forwards; }
.motion .hero .chips { animation-delay: 0s; }
.motion .hero .lede { animation-delay: .55s; }
.motion .hero .cta { animation-delay: .7s; }
.motion .hero .stats { animation-delay: .85s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* hero windows: fly in, then float */
.motion .stack { transition: translate .4s var(--ease); }
.motion .win { animation: win-in 1s var(--ease) both; }
.motion .win:nth-child(1) { animation-delay: .35s; }
.motion .win:nth-child(2) { animation-delay: .5s; }
.motion .win:nth-child(3) { animation-delay: .65s; }
@keyframes win-in { from { opacity: 0; translate: 60px 30px; } }
.motion .win-body .wave span { animation: eq 1.1s ease-in-out infinite alternate; transform-origin: 50% 50%; }
.motion .win-body .wave span:nth-child(3n) { animation-duration: .8s; }
.motion .win-body .wave span:nth-child(3n+1) { animation-duration: 1.4s; }
@keyframes eq { to { transform: scaleY(.35); } }
.motion .win-body .row.a { animation: shimmer 2.4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .45; } }

/* ghost wordmark breathes */
.motion .hero .ghost { animation: ghost 9s ease-in-out infinite; }
@keyframes ghost { 50% { opacity: .32; transform: translateX(-1.5%); } }

/* timeline rail draws with scroll, dots pop */
.motion .tl-items { border-left-color: transparent; position: relative; }
.motion .tl-items::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.motion .tl-items::after { content: ''; position: absolute; left: -1px; top: 0; width: 1px; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(var(--rail, 0)); box-shadow: 0 0 10px var(--glow); }
.motion .tl-items > li::before { transform: scale(0); transition: transform .5s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0ms) + 150ms); }
.motion .tl-items > li.in::before { transform: scale(1); }
.motion .tl-year .yr { transition: letter-spacing .8s var(--ease); }

/* expandable Velora list slides open */
.tl-more[open] .tl-sub li { animation: fade-up .5s var(--ease) both; }
.tl-more[open] .tl-sub li:nth-child(2) { animation-delay: .08s; }
.tl-more[open] .tl-sub li:nth-child(3) { animation-delay: .16s; }

/* panels: cursor spotlight */
.motion .panel { background-image: radial-gradient(260px circle at var(--mx, -300px) var(--my, -300px), var(--glow), transparent 70%); }
.motion .card { transition: transform .25s var(--ease), border-color .22s, box-shadow .22s; will-change: transform; }
.motion .btn { transition: transform .2s var(--ease), box-shadow .22s, background .22s, color .22s; }

/* marker slash blinks like a cursor */
.motion .marker::after { content: '_'; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* thesis: accent words sweep in */
.motion .thesis em { background: linear-gradient(90deg, var(--accent), var(--accent)) no-repeat 0 92% / 0% 3px; transition: background-size 1.1s var(--ease) .5s; }
.motion .thesis p.in em { background-size: 100% 3px; }

/* footer wordmark slow drift */
.motion footer .ghost { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateX(-3%); } }

/* footer legal links: clearly clickable, 44px targets on touch */
.legal-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.legal-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 4px; }
.legal-links a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* The giant wordmark's glyphs overflow upward (line-height < 1) and were
   catching clicks meant for the footer links. Keep links above it. */
footer .meta, .catch-zone { position: relative; z-index: 2; }
footer .ghost { position: relative; z-index: 1; }

/* hold the hero entrance until the intro/loader has finished */
.motion:not(.loaded) .hero h1 .w, .motion:not(.loaded) .hero .chips, .motion:not(.loaded) .hero .lede,
.motion:not(.loaded) .hero .cta, .motion:not(.loaded) .hero .stats, .motion:not(.loaded) .win { animation-play-state: paused; }

/* ---------- intro: equaliser bars sweep in, pulse, scatter ---------- */
.loader .lattice, .loader .loader-label, .loader .loader-time { transition: opacity .45s ease, transform .45s var(--ease); }
.loader.intro .lattice, .loader.intro .loader-label, .loader.intro .loader-time { opacity: 0; transform: scale(.85); }
.intro-bars {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  pointer-events: none; animation: bars-travel 1.8s cubic-bezier(.3, .1, .2, 1) both;
}
@keyframes bars-travel { from { transform: translateX(-70vw); } to { transform: translateX(14vw); } }
.intro-bars i {
  width: 7px; height: min(160px, 22vh); border-radius: 4px;
  background: linear-gradient(hsl(148 80% 72%), hsl(148 70% 45%));
  box-shadow: 0 0 14px hsl(148 80% 55% / .45);
  scale: 1 0; opacity: 0;
  animation: bar-in .45s var(--ease) calc(var(--i) * 32ms) forwards, bar-pulse .42s ease-in-out calc(var(--i) * -55ms) infinite alternate;
  transition: translate .6s cubic-bezier(.2, .7, .2, 1), rotate .6s ease, opacity .5s ease;
}
@keyframes bar-in { to { scale: 1 1; opacity: 1; } }
@keyframes bar-pulse { from { transform: scaleY(var(--h)); } to { transform: scaleY(.18); } }
.loader.scatter .intro-bars { animation-play-state: paused; }
.loader.scatter .intro-bars i { translate: var(--sx) var(--sy); rotate: var(--sr); opacity: 0; }
