/* ============================================================
   MORGAN REID — IT GRC AUDITOR
   Monochrome, motion-first CV.
   Motion model: CSS drives the continuous loops (marquees, hero
   entrance, badge) so they ALWAYS run; GSAP/Lenis layer scroll
   choreography on top. Reduce-motion is honored only lightly here
   because the site is explicitly a motion showcase.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --fg-rgb: 238, 235, 226;
  --bg-rgb: 7, 7, 8;
  --fg: rgb(var(--fg-rgb));
  --bg: rgb(var(--bg-rgb));
  --line:        rgba(var(--fg-rgb), .14);
  --line-strong: rgba(var(--fg-rgb), .30);
  --muted:       rgba(var(--fg-rgb), .56);

  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  --maxw: 1480px;
  --pad: clamp(1.25rem, 5vw, 6rem);
  --gut: clamp(1.5rem, 4vw, 4rem);
  --strip: clamp(4.4rem, 8vh, 6rem);   /* top marquee clearance under nav */

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.76, 0, .24, 1);
  --r: 2px;
  color-scheme: dark;
}
[data-theme="light"] { --fg-rgb: 12, 12, 13; --bg-rgb: 240, 238, 231; color-scheme: light; }

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body);
  line-height: 1.5; letter-spacing: -0.01em; overflow-x: clip; min-height: 100vh;
  transition: background-color .6s var(--ease), color .6s var(--ease);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor, body.has-custom-cursor * { cursor: none !important; }
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 2000; background: var(--fg); color: var(--bg); padding: .6em 1em; font-family: var(--font-mono); font-size: .8rem; transform: translateY(-200%); transition: transform .3s var(--ease); }
.skip-link:focus { transform: translateY(0); }

/* ---------- TYPE ---------- */
.mono-label { font-family: var(--font-mono); font-size: clamp(.62rem, .9vw, .76rem); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: .96; letter-spacing: -0.03em; }
.section__kicker { font-size: clamp(2rem, 6vw, 5rem); line-height: .98; font-weight: 500; max-width: 16ch; }

/* ---------- FX LAYERS ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 1200; pointer-events: none; width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .045; mix-blend-mode: overlay; animation: grain 6s steps(6) infinite;
}
[data-theme="light"] .grain { mix-blend-mode: multiply; opacity: .05; }
@keyframes grain { 0%,100%{transform:translate(0,0)} 10%{transform:translate(-4%,-4%)} 30%{transform:translate(3%,-2%)} 50%{transform:translate(-2%,4%)} 70%{transform:translate(4%,2%)} 90%{transform:translate(-3%,1%)} }
.bg-field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; }

.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 1500; pointer-events: none; will-change: transform; }
.cursor { width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 1px solid var(--fg); border-radius: 50%; display: grid; place-items: center; mix-blend-mode: difference; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background-color .35s, opacity .3s; }
.cursor-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: var(--fg); border-radius: 50%; mix-blend-mode: difference; }
.cursor__label { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); opacity: 0; transition: opacity .25s; white-space: nowrap; }
.cursor.is-active { width: 86px; height: 86px; margin: -43px 0 0 -43px; background: var(--fg); }
.cursor.is-active .cursor__label { opacity: 1; }
.cursor.is-hide { opacity: 0; }
/* light ("white") mode: drop the difference blend so the ring reads solid black
   against the pale background (dark mode keeps the inverting blend). */
[data-theme="light"] .cursor, [data-theme="light"] .cursor-dot { mix-blend-mode: normal; }
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1300; background: var(--line); pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 0%; background: var(--fg); }

/* ---------- PRELOADER ---------- */
.preloader { display: none; }
.js .preloader { position: fixed; inset: 0; z-index: 1800; background: var(--bg); display: grid; place-items: end stretch; padding: var(--pad); }
.preloader.is-done { display: none !important; }
.preloader__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.preloader__label { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .18em; font-size: clamp(.7rem,1vw,.85rem); color: var(--muted); }
.preloader__count { font-family: var(--font-display); font-weight: 500; font-size: clamp(3rem, 14vw, 12rem); line-height: .8; }
.preloader__pct { font-size: .3em; vertical-align: super; color: var(--muted); }
.preloader__bar { height: 2px; background: var(--line); overflow: hidden; }
.preloader__fill { display: block; height: 100%; width: 0%; background: var(--fg); }

/* ---------- NAV ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; padding: clamp(1rem, 2vw, 1.6rem) var(--pad); mix-blend-mode: difference; color: #fff; transition: transform .55s var(--ease-inout); }
.nav.is-hidden { transform: translateY(-130%); }
.nav__brand { display: flex; align-items: center; gap: .7rem; }
.nav__monogram { font-family: var(--font-mono); font-weight: 700; font-size: .9rem; border: 1.5px solid currentColor; width: 2.4em; height: 2.4em; display: grid; place-items: center; }
.nav__brandmeta { display: flex; flex-direction: column; line-height: 1.05; }
.nav__name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.nav__role { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.nav__links { display: flex; gap: clamp(.8rem, 1.6vw, 1.8rem); }
.nav__links a { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; position: relative; padding: .2em 0; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav__links a:hover::after, .nav__links a.is-current::after { transform: scaleX(1); transform-origin: left; }
.nav__actions { display: flex; align-items: center; gap: 1rem; }
.theme-toggle { padding: .3em; }
.theme-toggle__track { display: block; width: 44px; height: 22px; border: 1.5px solid currentColor; border-radius: 22px; position: relative; }
.theme-toggle__thumb { position: absolute; top: 50%; left: 3px; transform: translateY(-50%); width: 14px; height: 14px; background: currentColor; border-radius: 50%; transition: left .4s var(--ease-inout); }
[data-theme="light"] .theme-toggle__thumb { left: 24px; }
.menu-btn { display: none; flex-direction: column; gap: 5px; width: 30px; }
.menu-btn span { display: block; height: 1.5px; background: currentColor; transition: transform .4s var(--ease), opacity .3s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
.mobile-menu { position: fixed; inset: 0; z-index: 990; background: var(--bg); display: grid; place-items: center; clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease-inout); pointer-events: none; }
.mobile-menu.is-open { clip-path: inset(0 0 0% 0); pointer-events: auto; }
.mobile-menu nav { display: flex; flex-direction: column; gap: .3rem; }
.mobile-menu a { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 9vw, 3.4rem); display: flex; align-items: baseline; gap: 1rem; }
.mobile-menu__idx { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }

/* ============================================================
   MARQUEE — pure CSS, seamless, continuously scrolling RIGHT.
   Track holds two identical groups; translating -50%→0 loops.
   Uses the `translate` property so `transform` stays free for skew.
   ============================================================ */
.marquee { overflow: hidden; border-block: 1px solid var(--line); --mq-dur: 24s; }
.marquee__track {
  display: flex; width: max-content; will-change: translate;
  animation: mq-right var(--mq-dur, 38s) linear infinite;
}
/* marquees keep moving even under the cursor (no hover-pause) */
.marquee__group { display: flex; align-items: center; flex: 0 0 auto; }
/* cursor "ink": letters are outline by default and fill solid only inside the
   cursor circle (JS feeds --cx/--cy per group). */
.marquee--ink .marquee__group {
  background-image: radial-gradient(circle 30px at var(--cx, -400px) var(--cy, -400px), var(--fg) 0, var(--fg) 22px, transparent 30px);
  -webkit-background-clip: text; background-clip: text; background-repeat: no-repeat;
}
.marquee--ink em, .marquee--ink i { color: transparent; -webkit-text-stroke: 1px var(--fg); }
@keyframes mq-right { from { translate: -50% 0; } to { translate: 0 0; } }
.marquee em { font-family: var(--font-display); font-style: normal; font-weight: 600; font-size: clamp(1.6rem, 4vw, 3rem); text-transform: uppercase; padding: 0 1.2rem; letter-spacing: -0.02em; white-space: nowrap; }
.marquee i { font-style: normal; opacity: .4; font-size: clamp(1rem,2vw,1.6rem); }

/* Top marquee: sits under the fixed nav, above the hero */
.marquee--top { border-top: none; padding-block: clamp(.8rem,1.6vw,1.3rem); margin-top: var(--strip); }

/* Services marquee: outline type, faster */
.marquee--services { --mq-dur: 19s; }
.marquee--services em { color: transparent; -webkit-text-stroke: 1px var(--fg); }

/* Card marquee (engagements): the cards themselves scroll right */
.marquee--cards { --mq-dur: 46s; border: none; }
.marquee--cards .marquee__group { gap: 0; }

/* ---------- SECTIONS ---------- */
.section { max-width: var(--maxw); margin-inline: auto; padding: clamp(4.5rem, 12vh, 11rem) var(--pad); }
.section__head { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: clamp(2.5rem, 6vh, 5rem); position: relative; }
.section__head::after { content: ""; height: 1px; background: var(--line); width: 100%; order: -1; margin-bottom: 1.4rem; }
@media (min-width: 1080px) { .section__idx { position: sticky; top: 6.5rem; } }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: calc(100svh - var(--strip));
  padding: clamp(2.5rem, 7vh, 5rem) var(--pad) clamp(2rem, 5vh, 4rem);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.hero__grid { position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: clamp(60px, 8vw, 120px) clamp(60px, 8vw, 120px); -webkit-mask-image: radial-gradient(120% 80% at 50% 35%, #000 30%, transparent 78%); mask-image: radial-gradient(120% 80% at 50% 35%, #000 30%, transparent 78%); opacity: .6; }
.hero > * { position: relative; z-index: 1; }
.hero__topline { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hero__avail { display: inline-flex; align-items: center; gap: .6em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); position: relative; flex: none; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--fg); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0%{transform:scale(1);opacity:.7} 100%{transform:scale(3.4);opacity:0} }

.hero__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(4.2rem, 21vw, 20rem); line-height: .82; letter-spacing: -0.045em; margin: auto 0; text-transform: uppercase; overflow: hidden; }
.hero__line { display: block; }
.hero__line--outline { color: transparent; -webkit-text-stroke: 1.4px var(--fg); }

/* Name sweeps in from the right → settles left (plays after preloader) */
.js .hero__line { opacity: 0; }
.js body.loaded .hero__line { animation: heroIn 1.3s var(--ease-inout) both; }
.js body.loaded .hero__line:first-child { animation-delay: .05s; }
.js body.loaded .hero__line--outline { animation-delay: .24s; }
@keyframes heroIn {
  0%   { opacity: 0; transform: translateX(48%) skewX(-6deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateX(0) skewX(0); }
}

.hero__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.hero__lede { font-size: clamp(1.05rem, 1.8vw, 1.5rem); max-width: 34ch; line-height: 1.35; letter-spacing: -0.02em; color: rgba(var(--fg-rgb), .9); }
.rotator { display: inline-grid; vertical-align: bottom; }
.rotator__word { font-style: italic; font-family: var(--font-display); font-weight: 600; grid-area: 1/1; }
.scroll-cue { display: inline-flex; align-items: center; gap: .8rem; }
.scroll-cue__txt { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.scroll-cue__line { width: 60px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue__line i { position: absolute; inset: 0; background: var(--fg); transform: translateX(-100%); animation: cue 2.2s var(--ease-inout) infinite; }
@keyframes cue { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(100%)} }

/* ---------- PROFILE ---------- */
.profile__body { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gut); align-items: start; }
.profile__statement { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 3.2vw, 2.7rem); line-height: 1.22; letter-spacing: -0.02em; }
.profile__statement .word { display: inline-block; }
.profile__aside { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.ticklist { margin-top: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.ticklist li { position: relative; padding-left: 1.6em; font-size: 1rem; color: rgba(var(--fg-rgb), .85); }
.ticklist li::before { content: ""; position: absolute; left: 0; top: .5em; width: .8em; height: .45em; border-left: 1.5px solid var(--fg); border-bottom: 1.5px solid var(--fg); transform: rotate(-45deg); }
/* profile motif — tall spinning dot-disk; stretches the full height of the row */
.profile__motif { align-self: stretch; display: flex; justify-content: center; align-items: stretch; min-height: 340px; }
.motif-canvas { width: 100%; max-width: 360px; height: 100%; min-height: 340px; display: block; }
/* rotating Delta ↔ Δ in a fixed-width slot so surrounding text never shifts */
.delta-rot { display: inline-grid; vertical-align: baseline; }
.delta-rot__item { grid-area: 1 / 1; text-align: center; }
.delta-rot__item[aria-hidden="true"] { opacity: 0; }
.stats { margin-top: clamp(3rem, 7vh, 6rem); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stat { padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem,2vw,1.6rem) clamp(1.5rem,3vw,2.5rem) 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat__num { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: .8rem; max-width: 18ch; line-height: 1.4; }
/* 3-stat variant: equal thirds, centered */
.stats--3 { grid-template-columns: repeat(3, 1fr); }
.stats--3 .stat { text-align: center; padding: clamp(1.5rem,3vw,2.5rem) clamp(1rem,2vw,1.6rem); }
.stats--3 .stat__label { margin-inline: auto; }
.stat__label a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: opacity .3s; }
.stat__label a:hover { opacity: .65; }

/* ---------- EXPERTISE ---------- */
.domains { border-top: 1px solid var(--line); }
.domain { display: grid; grid-template-columns: 5rem 1fr 1.2fr; gap: var(--gut); align-items: baseline; padding: clamp(1.4rem, 3vw, 2.4rem) 0; border-bottom: 1px solid var(--line); position: relative; transition: padding-left .5s var(--ease); }
.domain::before { content: ""; position: absolute; inset: 0; background: var(--fg); transform: scaleY(0); transform-origin: bottom; z-index: -1; transition: transform .5s var(--ease); }
.domain__no { align-self: start; padding-top: .35em; }
.domain__name { font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 500; transition: color .4s var(--ease); }
.domain__desc { color: var(--muted); font-size: clamp(.95rem, 1.3vw, 1.08rem); max-width: 46ch; transition: color .4s var(--ease); }
@media (hover: hover) {
  .domain:hover { padding-left: 2rem; }
  .domain:hover::before { transform: scaleY(1); transform-origin: top; }
  .domain:hover .domain__name, .domain:hover .domain__desc { color: var(--bg); }
  .domain:hover .domain__no { color: rgba(var(--bg-rgb), .6); }
}

/* ---------- RISK ---------- */
.risk__layout { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.heatmap { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto auto; grid-template-areas: "cap cap" "y grid" ". x" "leg leg"; gap: .8rem; }
.heatmap__cap { grid-area: cap; }
.heatmap__yaxis { grid-area: y; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; align-self: center; }
.heatmap__xaxis { grid-area: x; text-align: center; }
.heatmap__grid { grid-area: grid; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 6px; aspect-ratio: 1 / 1; }
.cell { border: 1px solid var(--line); position: relative; border-radius: var(--r); background: rgba(var(--fg-rgb), 0); transition: background-color .6s var(--ease); display: grid; place-items: center; }
.cell[data-sev="1"] { --sev: .07; } .cell[data-sev="2"] { --sev: .24; } .cell[data-sev="3"] { --sev: .52; } .cell[data-sev="4"] { --sev: .9; }
.cell.is-on { background: rgba(var(--fg-rgb), var(--sev)); }
.cell__dot { width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 2px solid var(--fg); transform: scale(0); transition: transform .5s var(--ease) .3s; box-shadow: 0 0 0 4px rgba(var(--bg-rgb), .5); }
.cell.has-risk .cell__dot { transform: scale(1); }
.cell.has-risk:hover .cell__dot { transform: scale(1.35); }
.cell__tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--fg); color: var(--bg); font-family: var(--font-mono); font-size: .62rem; padding: .4em .6em; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 5; border-radius: var(--r); }
.cell.has-risk:hover .cell__tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.heatmap__legend { grid-area: leg; display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .6rem; }
.heatmap__legend li { display: inline-flex; align-items: center; gap: .5em; }
.heatmap__legend i { width: 14px; height: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.heatmap__legend i[data-sev="1"]{ background: rgba(var(--fg-rgb), .07); } .heatmap__legend i[data-sev="2"]{ background: rgba(var(--fg-rgb), .24); } .heatmap__legend i[data-sev="3"]{ background: rgba(var(--fg-rgb), .52); } .heatmap__legend i[data-sev="4"]{ background: rgba(var(--fg-rgb), .9); }
.matrix__cap { margin-bottom: 1.6rem; }
.matrix__list { display: flex; flex-direction: column; gap: 1.15rem; }
.bar { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 1rem; align-items: center; }
.bar__name { font-size: clamp(.85rem, 1.1vw, 1rem); }
.bar__track { height: 8px; background: var(--line); position: relative; border-radius: 10px; overflow: hidden; }
.bar__track i { position: absolute; inset: 0; width: 0%; background: var(--fg); border-radius: 10px; }
.bar__val { font-variant-numeric: tabular-nums; }

/* ============================================================
   SNAKE TIMELINE — a winding rail that draws as you scroll,
   with role "stations" sliding in and waypoint dots popping.
   ============================================================ */
.snake { position: relative; --rail: clamp(54px, 11vw, 165px); padding-left: var(--rail); }
.snake__rail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.snake__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.snake__bg, .snake__line { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.snake__bg { stroke: var(--line); stroke-width: 2; }
.snake__line { stroke: var(--fg); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(var(--fg-rgb), .35)); }
.tl { position: relative; z-index: 1; display: grid; grid-template-columns: 11rem 1fr; gap: var(--gut); padding: clamp(3.2rem, 8vw, 7rem) 0; }
.tl + .tl { border-top: 1px solid var(--line); }
/* waypoint dots alternate left/right inside the rail; JS draws the line through them */
.tl__dot { position: absolute; top: clamp(2.8rem, 7vw, 5.5rem); width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2.5px solid var(--fg); box-shadow: 0 0 0 6px rgba(var(--bg-rgb), .9); transform: scale(0); transition: transform .55s var(--ease) .12s; z-index: 3; }
.tl:nth-child(odd)  .tl__dot { left: calc(-0.72 * var(--rail) - 7.5px); }
.tl:nth-child(even) .tl__dot { left: calc(-0.28 * var(--rail) - 7.5px); }
.tl.in .tl__dot { transform: scale(1); }
/* one-shot ring as each waypoint lands */
.tl__dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--fg); opacity: 0; pointer-events: none; }
.tl.in .tl__dot::after { animation: dotRing 1s var(--ease) .2s; }
@keyframes dotRing { from { transform: scale(.5); opacity: .85; } to { transform: scale(3.2); opacity: 0; } }
.tl__when { display: flex; flex-direction: column; gap: .2rem; }
.tl__when span { font-size: clamp(1.4rem, 2.4vw, 2rem); font-family: var(--font-display); }
.tl__present { color: var(--muted) !important; font-size: .8rem !important; font-family: var(--font-mono) !important; letter-spacing: .14em; text-transform: uppercase; }
.tl__role { font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 500; }
.tl__org { color: var(--muted); margin: .4rem 0 1rem; font-size: 1.05rem; }
.tl__desc { max-width: 60ch; font-size: clamp(1rem, 1.3vw, 1.15rem); color: rgba(var(--fg-rgb), .82); }
.tl__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.tl__tags li { border: 1px solid var(--line); padding: .35em .8em; border-radius: 30px; }

/* ---------- CREDENTIALS ---------- */
.certgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); perspective: 1300px; }
.cert { background: var(--bg); padding: clamp(1.5rem, 3vw, 2.4rem); min-height: 13rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; transition: background-color .4s var(--ease); transform-style: preserve-3d; }
.cert__abbr { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -0.03em; transition: color .4s; }
.cert__full { font-size: .92rem; color: var(--muted); margin-top: auto; padding-top: 1.2rem; line-height: 1.35; transition: color .4s; }
.cert__by { position: absolute; top: clamp(1.5rem,3vw,2.4rem); right: clamp(1.5rem,3vw,2.4rem); transition: color .4s; }
@media (hover: hover) { .cert:hover { background: var(--fg); } .cert:hover .cert__abbr { color: var(--bg); } .cert:hover .cert__full, .cert:hover .cert__by { color: rgba(var(--bg-rgb), .7); } }

/* ---------- ENGAGEMENT CARDS ---------- */
.work .case { background: var(--bg); padding: clamp(1.8rem, 3.5vw, 3rem); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1.2rem; min-height: 22rem; justify-content: space-between; min-width: min(86vw, 420px); border-right: 1px solid var(--line); transform-style: preserve-3d; }
.work .case::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.work .case:hover::after { transform: scaleX(1); }
.case__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.case__metric { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.case__metric b { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 5vw, 4rem); line-height: .9; font-variant-numeric: tabular-nums; }
.case__metric small { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: .3rem; }
.case__title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; }
.case__desc { color: rgba(var(--fg-rgb), .78); max-width: 44ch; }
.case__foot { display: flex; gap: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.case__foot span { position: relative; padding-left: 1.2em; }
.case__foot span::before { content: "▸"; position: absolute; left: 0; opacity: .6; }

/* ---------- CONTACT ---------- */
.contact { position: relative; }
.contact__inner { display: flex; flex-direction: column; gap: clamp(1.5rem, 4vh, 3rem); }
/* phrase is outline; the highlighted bit ("embrace it") is solid-filled italic */
.contact__head { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 8vw, 7rem); line-height: .96; letter-spacing: -0.04em; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1.4px var(--fg); }
.contact__head em { font-style: italic; color: var(--fg); -webkit-text-stroke: 0; }
.contact__email { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 5vw, 4rem); letter-spacing: -0.03em; display: inline-block; width: fit-content; position: relative; padding-bottom: .1em; }
.contact__email::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--fg); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.contact__email:hover::after { transform: scaleX(1); transform-origin: left; }
.contact__row { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 2rem; }
.contact__links { display: flex; gap: 1.6rem; }
.contact__links a:hover { color: var(--fg); }
.btn-print { display: inline-flex; align-items: center; gap: .7em; border: 1px solid var(--line-strong); padding: .9em 1.4em; border-radius: 40px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s; }
.btn-print:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.contact__status { display: inline-flex; align-items: center; gap: .6em; }

/* spinning availability badge */
.badge { position: absolute; top: clamp(1rem, 4vw, 3rem); right: 0; width: clamp(104px, 13vw, 156px); height: clamp(104px, 13vw, 156px); z-index: 2; }
.badge__ring { width: 100%; height: 100%; animation: spin 16s linear infinite; transform-origin: center; }
.badge__ring text { font-family: var(--font-mono); font-size: 7px; letter-spacing: .26em; fill: var(--fg); text-transform: uppercase; }
.badge__core { position: absolute; inset: 0; margin: auto; width: 2.4em; height: 2.4em; display: grid; place-items: center; font-size: 1.1rem; border: 1px solid var(--line); border-radius: 50%; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (max-width: 680px) { .badge { display: none; } }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: clamp(2.5rem, 5vh, 4rem) var(--pad) clamp(1.5rem,3vh,2.5rem); overflow: hidden; }
/* font-size is fitted to the width by JS (initFitText); clamp is the no-JS fallback */
.footer__big { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.8rem, 8vw, 10rem); line-height: .82; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px var(--line-strong); white-space: nowrap; margin-bottom: 2rem; }
.footer__big span { display: inline-block; }
.footer__row { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.footer__clock span { color: var(--fg); }
.footer__top:hover { color: var(--fg); }
.footer__note { margin-top: 1rem; opacity: .5; }

/* ============================================================
   REVEAL SYSTEM — JS adds `.in`; CSS does the animation.
   No-JS shows everything; `.no-anim` is the hard safety net.
   ============================================================ */
.js [data-reveal] { opacity: 0; transform: translateY(60px); transition: opacity 1s var(--ease), transform 1s var(--ease); will-change: opacity, transform; }
.js [data-reveal="left"]  { transform: translateX(-110px); }
.js [data-reveal="right"] { transform: translateX(110px); }
.js [data-reveal="scale"] { transform: scale(.9); transform-origin: left center; }
.js [data-reveal].in { opacity: 1; transform: none; }
.no-anim [data-reveal], .no-anim .tl, .no-anim .hero__line { opacity: 1 !important; transform: none !important; animation: none !important; }
.no-anim .tl__dot, .no-anim .bar__track i { transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .nav__links { display: none; } .menu-btn { display: flex; }
  .risk__layout { grid-template-columns: 1fr; }
  .certgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .profile__body { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat { border-bottom: 1px solid var(--line); }
  .domain { grid-template-columns: 1fr; gap: .6rem; } .domain__no { order: -1; }
  .tl { grid-template-columns: 1fr; gap: 1rem; }
  .tl__when { flex-direction: row; gap: 1rem; align-items: baseline; }
  .certgrid { grid-template-columns: 1fr 1fr; }
  .nav__brandmeta { display: none; }
  .bar { grid-template-columns: 1fr auto; } .bar__track { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 420px) { .certgrid { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr; } .stat { border-right: none; } }

/* ---------- REDUCE MOTION (light touch — site is a motion piece) ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain { display: none; }            /* only the heaviest texture is dropped */
  .bg-field { opacity: .3; }
}

/* ---------- PRINT ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --fg-rgb: 10,10,10; --bg-rgb: 255,255,255; }
  .grain, .bg-field, .cursor, .cursor-dot, .scroll-progress, .preloader,
  .nav, .mobile-menu, .marquee, .hero__grid, .scroll-cue, .menu-btn,
  .theme-toggle, .btn-print, .footer__big, .badge { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { min-height: auto; padding: 0 0 8mm; }
  .hero__title, .hero__line--outline { font-size: 42pt; -webkit-text-stroke: 0; color: #000; opacity: 1 !important; animation: none !important; }
  .section { padding: 6mm 0; max-width: none; page-break-inside: avoid; }
  .section__kicker, .contact__head { font-size: 20pt; }
  .snake { padding-left: 0; } .snake__rail { display: none; } .tl__dot { display: none; }
  .domain, .tl, .case, .cert { break-inside: avoid; }
  .marquee--cards .marquee__track { transform: none !important; translate: none !important; animation: none !important; width: auto !important; display: grid; grid-template-columns: 1fr 1fr; }
  [data-reveal], .tl { opacity: 1 !important; transform: none !important; }
  a { color: #000; }
}
