/* ============================================================
   Ravidu Sadaruwan Abeywardana · portfolio
   Warm near-black stage, cream type, one signal red.
   ============================================================ */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-400-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/archivo-latin.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("fonts/martian-mono-latin.woff2") format("woff2"); }

:root {
  --bg: #0a0607;
  --bg-2: #130b0c;
  --bg-3: #1c0f11;
  --line: rgba(246, 239, 233, .1);
  --line-2: rgba(246, 239, 233, .2);
  --cream: #f6efe9;
  --cream-2: #cfc5bf;
  --mute: #958a85;
  --red: #e8161e;
  --red-hot: #ff4a3d;
  --red-deep: #6e0205;
  --blood: #2a0306;

  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-body: "Archivo", system-ui, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 4.5vw, 64px);
  --edge: max(var(--gutter), calc((100vw - 1240px) / 2));
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);

  color-scheme: dark;
  scrollbar-color: var(--red-deep) var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 4px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 1.05em; height: 1.05em; flex: none; }
.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: fixed; left: 16px; top: 12px; z-index: 400;
  padding: .7em 1.1em; border-radius: 999px;
  background: var(--cream); color: var(--bg); font-weight: 700;
  transform: translateY(-200%); transition: transform .25s var(--ease);
}
.skip:focus-visible { transform: none; }

em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.005em; color: var(--red-hot); }

/* ---------- pills (the one control shape) ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.55em; border-radius: 999px;
  font-family: var(--f-body); font-weight: 600; font-size: .98rem; letter-spacing: .005em;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, color .25s;
}
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: translateY(0) scale(.98); transition-duration: .08s; }
.pill .ico { transition: transform .35s var(--ease); }
.pill:hover .ico { transform: translate(2px, -2px); }
.pill--cream { background: var(--cream); color: #140b0c; }
.pill--cream:hover { background: #fff; }
.pill--ghost { border-color: var(--line-2); color: var(--cream); }
.pill--ghost:hover { border-color: var(--cream); background: rgba(246, 239, 233, .06); }
.pill--sm { min-height: 44px; padding: 0 1.15em; font-size: .88rem; }

/* ============================================================
   INTRO
   ============================================================ */
.intro {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s var(--ease-in-out);
}
html:not(.js) .intro, .intro-seen .intro { display: none; }
.intro.is-out { clip-path: inset(0 0 100% 0); pointer-events: none; }
.intro__marquee { width: 100%; overflow: hidden; }
.intro__track, .outro__track {
  display: flex; align-items: center; gap: .45em; width: max-content;
  white-space: nowrap; animation: marquee 22s linear infinite;
}
.intro__track {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(3.4rem, 10vw, 9.5rem); letter-spacing: -.045em; line-height: 1;
  color: var(--cream);
}
.intro__track i, .outro__track i { display: inline-block; width: .22em; height: .22em; background: var(--red); flex: none; }
.intro__console { position: absolute; left: 50%; bottom: 14vh; transform: translateX(-50%); text-align: center; font-family: var(--f-mono); font-size: .82rem; white-space: nowrap; }
.intro__query { color: var(--cream-2); }
.intro__prompt { color: var(--red-hot); }
.caret { display: inline-block; width: .6em; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: var(--red-hot); animation: blink 1s steps(1) infinite; }
.intro__count { margin-top: 10px; color: var(--mute); font-size: .74rem; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 100;
  transform: translateX(-50%);
  width: min(1264px, 100% - 2 * var(--gutter) + 24px);
  height: 60px; padding: 0 8px 0 22px;
  display: flex; align-items: center; gap: 20px;
  background: rgba(16, 9, 10, .72);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line); border-radius: 999px;
  transition: transform .5s var(--ease);
}
.nav.is-hidden { transform: translate(-50%, -140%); }
.nav__logo { font-family: var(--f-serif); font-style: italic; font-size: 1.65rem; line-height: 1; color: var(--cream); padding: 6px 0; }
.nav__logo span { color: var(--red); }
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  font-size: .9rem; font-weight: 500; color: var(--cream-2); border-radius: 999px;
  transition: color .2s, background-color .2s;
}
.nav__links a:hover { color: var(--cream); background: rgba(246, 239, 233, .06); }
.nav__menu { display: none; width: 44px; height: 44px; border-radius: 999px; position: relative; }
.nav__menu span:not(.sr) { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--cream); transition: transform .35s var(--ease); }
.nav__menu span:nth-child(1) { top: 18px; }
.nav__menu span:nth-child(2) { top: 25px; }
.nav__menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav__menu[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: clip;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 0% 100%, rgba(110, 2, 5, .55), transparent 70%),
    radial-gradient(40% 50% at 35% 20%, rgba(42, 3, 6, .9), transparent 70%);
}

.portrait {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 64%;
  z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34%);
  mask-image: linear-gradient(90deg, transparent 0, #000 34%);
  --lx: 58%; --ly: 26%; --r: 0px;
}
.portrait__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 12%;
  filter: grayscale(1) contrast(1.2) brightness(.82);
  transform: scale(1.04);
}
.js .portrait__img { opacity: 0; }
.is-ready .portrait__img { animation: portrait-in 1.8s var(--ease) both; }
.portrait::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, #d0141c, #7a0308);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.portrait__true, .portrait__grid {
  position: absolute; inset: 0; z-index: 2;
  clip-path: circle(var(--r) at var(--lx) var(--ly));
  pointer-events: none;
}
.portrait__true {
  background-image: var(--src, none);
  background-size: cover; background-position: 50% 12%;
  transform: scale(1.04);
}
.portrait__grid {
  z-index: 3;
  background:
    linear-gradient(rgba(246, 239, 233, .16) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(246, 239, 233, .16) 1px, transparent 1px) 0 0 / 28px 28px;
}
.portrait::before {
  content: ""; position: absolute; z-index: 4;
  left: var(--lx); top: var(--ly);
  width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(246, 239, 233, .75);
  border-radius: 50%;
  pointer-events: none;
}
.lens-readout {
  position: absolute; z-index: 5;
  left: var(--lx); top: var(--ly);
  transform: translate(calc(var(--r) * .72), calc(var(--r) * .72));
  display: grid; gap: 2px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(10, 6, 7, .8); border: 1px solid var(--line-2);
  font-family: var(--f-mono); font-size: .75rem; line-height: 1.4; color: var(--cream-2);
  white-space: nowrap;
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.lens-readout b { color: var(--red-hot); font-weight: 600; }
.portrait.is-on .lens-readout { opacity: 1; }
.portrait.flip-x .lens-readout { transform: translate(calc(-100% - var(--r) * .72), calc(var(--r) * .72)); }
.portrait.flip-y .lens-readout { transform: translate(calc(var(--r) * .72), calc(-100% - var(--r) * .72)); }
.portrait.flip-x.flip-y .lens-readout { transform: translate(calc(-100% - var(--r) * .72), calc(-100% - var(--r) * .72)); }

.hero__copy {
  position: relative; z-index: 2;
  margin-left: var(--edge);
  width: min(660px, 54%);
  padding-block: 128px 120px;
}
.hero__title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(3rem, 6.8vw, 7rem);
  line-height: .94; letter-spacing: -.045em;
  color: var(--cream);
}
.hero__title em { font-size: 1.1em; letter-spacing: -.02em; padding-right: .04em; }
.ln { display: block; overflow: clip; padding-bottom: .08em; }
.ln > span { display: inline-block; }
.js .ln > span { transform: translateY(112%); }
.is-ready .ln > span { transform: none; transition: transform 1.1s var(--ease); }
.is-ready .ln:nth-child(2) > span { transition-delay: .08s; }
.is-ready .ln:nth-child(3) > span { transition-delay: .16s; }

.hero__lede { margin-top: 30px; max-width: 44ch; font-size: clamp(1.05rem, 1.3vw, 1.2rem); color: var(--cream-2); }
.hero__lede strong { color: var(--cream); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.js .hero__lede, .js .hero__actions, .js .hero__hint { opacity: 0; transform: translateY(16px); }
.is-ready .hero__lede, .is-ready .hero__actions { opacity: 1; transform: none; transition: opacity .9s var(--ease) .35s, transform .9s var(--ease) .35s; }
.is-ready .hero__actions { transition-delay: .45s; }

.hero__hint {
  position: absolute; z-index: 3; bottom: 30px; left: 68%;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(10, 6, 7, .62); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .8rem; color: var(--cream-2); white-space: nowrap;
  translate: -50% 0;
}
.is-ready .hero__hint { opacity: 1; transform: none; transition: opacity .9s var(--ease) 1s, transform .9s var(--ease) 1s; }
.is-ready .hero__hint.is-gone { opacity: 0; transition-delay: 0s; }
.hero__hint .ico { color: var(--red-hot); }
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }
.hero__side {
  position: absolute; z-index: 3; right: calc(var(--gutter) * .6); top: 50%;
  writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg);
  font-family: var(--f-mono); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cream-2);
}

/* ============================================================
   SHARED SECTION TYPE
   ============================================================ */
.h2 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.5rem, 5.4vw, 5rem);
  line-height: .98; letter-spacing: -.04em;
  text-wrap: balance;
}
.h2 em { font-size: 1.08em; letter-spacing: -.015em; }
.head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px 64px; align-items: end; margin-bottom: clamp(48px, 7vw, 88px); }
.head p { max-width: 46ch; color: var(--cream-2); }

/* ---------- approach ---------- */
.approach { padding-block: clamp(120px, 22vh, 240px); }
.approach__text {
  max-width: 26ch;
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1.08; letter-spacing: -.035em;
  color: var(--cream);
}
.approach__text em { font-size: 1.1em; }
.js .approach__text .w { color: rgba(246, 239, 233, .14); transition: color .5s var(--ease); }
.js .approach__text em .w { color: rgba(255, 74, 61, .22); }
.js .approach__text .w.is-lit { color: var(--cream); }
.js .approach__text em .w.is-lit { color: var(--red-hot); }

/* ---------- about ---------- */
.about { padding-bottom: clamp(110px, 14vw, 180px); }
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 72px; align-items: start; }
.about__body { display: grid; gap: 18px; padding-top: 10px; color: var(--cream-2); font-size: 1.1rem; max-width: 52ch; }
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(64px, 8vw, 104px);
  border-top: 1px solid var(--line);
}
.facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 12px; padding: 30px 24px 0 0; }
.facts > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
.facts dt { font-family: var(--f-mono); font-size: .75rem; line-height: 1.5; color: var(--mute); max-width: 24ch; }
.facts dd {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.4rem, 4.2vw, 4rem); line-height: 1; letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.facts small { margin-left: .25em; font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: clamp(1.15rem, 2vw, 1.9rem); letter-spacing: 0; color: var(--red-hot); }

/* ---------- skills: the chart ---------- */
.skills { position: relative; padding-block: clamp(110px, 14vw, 180px); background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }
.chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.chart__col { display: flex; flex-direction: column; justify-content: flex-end; }
.chart__n { font-family: var(--f-display); font-weight: 700; font-size: 2.4rem; letter-spacing: -.04em; line-height: 1; margin-bottom: 14px; color: var(--cream); }
.chart__n::after { content: " tools"; font-family: var(--f-mono); font-size: .75rem; font-weight: 400; letter-spacing: 0; color: var(--mute); }
.chart__stack { display: flex; flex-direction: column-reverse; gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.chart__stack li {
  padding: .66em 1em; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(246, 239, 233, .03);
  font-weight: 600; font-size: .9rem; line-height: 1.2; text-align: center; color: var(--cream);
  transition: background-color .25s, border-color .25s, transform .25s var(--ease);
}
.chart__stack li:hover { border-color: var(--cream); transform: translateY(-2px); }
.chart__stack li.hot { background: var(--red); border-color: var(--red); color: #fff; }
.chart__col h3 { margin-top: 18px; font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }
.chart__col > p:last-child { margin-top: 6px; min-height: 4.8em; font-size: .94rem; color: var(--cream-2); }
.js .chart li { opacity: 0; }
.chart.is-live li { animation: drop 1s var(--ease) both; animation-delay: var(--d, 0s); }

/* ---------- work: sideways ---------- */
.work { position: relative; padding-block: clamp(80px, 10vw, 120px); }
.head--work { grid-template-columns: 1fr auto; margin-bottom: 44px; }
.work__progress { font-family: var(--f-mono); font-size: .8rem; color: var(--mute); }
.work__progress span { color: var(--cream); }
.work__track { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.case {
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 26px; overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s;
}
.case:hover { transform: translateY(-4px); border-color: var(--line-2); }
.case__vis {
  position: relative; height: 260px; padding: 36px 32px 44px;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  background: radial-gradient(120% 120% at 100% 0%, rgba(110, 2, 5, .7), transparent 60%), var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.vis__note { position: absolute; left: 32px; bottom: 16px; font-family: var(--f-mono); font-size: .75rem; color: var(--mute); }
.case__body { display: flex; flex-direction: column; gap: 12px; padding: 28px 30px 30px; flex: 1; }
.case__meta { display: flex; align-items: baseline; gap: 12px; margin-top: -4px; font-family: var(--f-mono); font-size: .75rem; color: var(--mute); }
.case__n { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.03em; color: var(--red-hot); }
.case h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.45rem, 2vw, 1.8rem); line-height: 1.1; letter-spacing: -.03em; }
.case__body > p:not(.case__meta) { color: var(--cream-2); font-size: .98rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.tags li { padding: .45em .85em; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--f-mono); font-size: .75rem; color: var(--cream-2); }

/* visuals drawn from the real figures */
.vb, .vi { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: .75rem; color: var(--mute); }
.vb i, .vi i { position: relative; height: 26px; border-radius: 6px; }
.vb i::after, .vi i::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: max(var(--w), 3px);
  border-radius: inherit; background: var(--red-hot);
  transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease) .2s;
}
.vb--after i::after { background: var(--cream); }
.vb b, .vi b { color: var(--cream); font-weight: 600; }
.vi { grid-template-columns: 1fr auto; grid-template-areas: "label val" "bar bar"; row-gap: 8px; }
.vi span { grid-area: label; } .vi b { grid-area: val; } .vi i { grid-area: bar; border: 1px dashed rgba(246, 239, 233, .35); }
.is-in .vb i::after, .is-in .vi i::after, html:not(.js) .vb i::after, html:not(.js) .vi i::after { transform: none; }

.sku-grid {
  --c: 8px;
  width: calc(var(--c) * 50); height: calc(var(--c) * 20); max-width: 100%;
  margin-inline: auto; position: relative;
  background:
    linear-gradient(90deg, var(--bg-3) 2px, transparent 2px) 0 0 / var(--c) var(--c),
    linear-gradient(var(--bg-3) 2px, transparent 2px) 0 0 / var(--c) var(--c),
    rgba(246, 239, 233, .14);
}
.sku-grid::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bg-3) 2px, transparent 2px) 0 0 / var(--c) var(--c),
    linear-gradient(var(--bg-3) 2px, transparent 2px) 0 0 / var(--c) var(--c),
    var(--red-hot);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 2.2s var(--ease) .2s;
}
.is-in .sku-grid::after, html:not(.js) .sku-grid::after { clip-path: inset(0 0 0 0); }

.big-num { font-family: var(--f-display); font-weight: 800; font-size: clamp(4.2rem, 8vw, 6.6rem); line-height: .9; letter-spacing: -.06em; color: var(--red-hot); }

.docs, .people { display: flex; flex-wrap: wrap; gap: 7px; }
.docs { max-width: 300px; }
.docs span { width: 20px; height: 26px; border-radius: 3px; background: var(--cream); clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%); opacity: .9; }
.people span { width: 18px; height: 18px; border-radius: 50%; background: var(--red-hot); }
.js .docs span, .js .people span { transform: scale(0); transition: transform .5s var(--ease); transition-delay: var(--d, 0s); }
.is-in .docs span, .is-in .people span { transform: none; }

/* sideways scroll on wide screens */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .js .work[data-ready] { padding: 0; height: var(--hs-h, 400vh); }
  .js .work[data-ready] .work__sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: 40px; }
  .js .work[data-ready] .work__track {
    display: flex; width: max-content; margin: 0; gap: 28px;
    padding-inline: var(--edge);
    transform: translate3d(var(--hs-x, 0px), 0, 0);
    will-change: transform;
  }
  .js .work[data-ready] .case { width: min(540px, 40vw); flex: none; }
}

/* ---------- experience ---------- */
.exp { padding-block: clamp(110px, 14vw, 180px); }
.timeline { position: relative; margin-top: clamp(48px, 7vw, 80px); padding-left: 44px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.timeline::after { background: var(--red-hot); transform-origin: top; transform: scaleY(var(--p, 0)); }
html:not(.js) .timeline::after { transform: none; }
.timeline li {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .55fr) minmax(0, 1.3fr);
  gap: 16px 40px; align-items: start;
  padding: 36px 0; border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline li::before {
  content: ""; position: absolute; left: -40px; top: 48px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--mute);
  transition: background-color .3s, border-color .3s, box-shadow .3s;
}
.timeline li.is-past::before { background: var(--red-hot); border-color: var(--red-hot); box-shadow: 0 0 0 5px rgba(255, 74, 61, .16); }
.tl__role h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.35rem, 2vw, 1.7rem); letter-spacing: -.025em; line-height: 1.15; }
.tl__org { margin-top: 6px; font-weight: 600; font-size: .95rem; color: var(--red-hot); }
.tl__place { margin-top: 4px; font-family: var(--f-mono); font-size: .75rem; color: var(--mute); }
.tl__year { font-family: var(--f-display); font-weight: 700; font-size: clamp(2.4rem, 4.4vw, 3.8rem); line-height: 1; letter-spacing: -.05em; color: var(--cream); font-variant-numeric: tabular-nums; }
.tl--edu .tl__year { color: var(--mute); }
.tl__text { color: var(--cream-2); font-size: .98rem; padding-top: 4px; }

/* ---------- contact ---------- */
.contact {
  position: relative; overflow: clip;
  padding-top: clamp(120px, 16vw, 200px);
  background: radial-gradient(70% 60% at 80% 100%, rgba(110, 2, 5, .6), transparent 70%);
}
.contact__title {
  max-width: 13ch;
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(3rem, 8vw, 8rem); line-height: .94; letter-spacing: -.05em;
  text-wrap: balance;
}
.contact__title em { font-size: 1.08em; letter-spacing: -.02em; }
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: clamp(40px, 5vw, 64px); }
.contact__mail {
  display: inline-flex; align-items: center; gap: .3em;
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.8rem); letter-spacing: -.03em;
  background: linear-gradient(var(--red-hot), var(--red-hot)) 0 100% / 0 2px no-repeat;
  padding-bottom: 4px;
  transition: background-size .5s var(--ease);
  overflow-wrap: anywhere;
}
.contact__mail:hover { background-size: 100% 2px; }
.contact__mail .ico { width: .8em; height: .8em; color: var(--red-hot); transition: transform .4s var(--ease); }
.contact__mail:hover .ico { transform: translate(3px, -3px); }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 28px; }
.contact__links a { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; font-weight: 600; color: var(--cream-2); transition: color .2s; }
.contact__links a:hover { color: var(--cream); }
.outro { margin-top: clamp(100px, 12vw, 160px); overflow: hidden; padding-bottom: 12px; }
.outro__track {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(4rem, 12vw, 11.5rem); line-height: 1; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1px rgba(246, 239, 233, .22);
  animation-duration: 40s;
}

.foot { border-top: 1px solid var(--line); }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 26px 34px; font-size: .88rem; color: var(--mute); }

/* ---------- cursor ring (fine pointers only) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor span {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(246, 239, 233, .55); border-radius: 50%;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background-color .3s, border-color .3s, opacity .3s;
}
.cursor.is-on { opacity: 1; }
.cursor.is-link span { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: rgba(255, 74, 61, .12); border-color: var(--red-hot); }
.cursor.is-lens span { opacity: 0; }

/* ============================================================
   motion
   ============================================================ */
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes portrait-in { from { transform: scale(1.14); opacity: 0; } to { transform: scale(1.04); opacity: 1; } }
@keyframes drop {
  0% { opacity: 0; transform: translateY(-46vh) rotate(var(--rot, 0deg)); }
  12% { opacity: 1; }
  70% { transform: translateY(0) rotate(calc(var(--rot, 0deg) * .25)); }
  84% { transform: translateY(-6px) rotate(0deg); }
  100% { opacity: 1; transform: none; }
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1080px) {
  .chart { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 24px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts > div:nth-child(n+3) { padding-top: 36px; }
}

@media (max-width: 900px) {
  .nav { padding-left: 18px; }
  .nav nav { margin-left: 0; }
  .nav__cta { margin-left: auto; }
  .nav__menu { display: block; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    flex-direction: column; gap: 0; padding: 10px;
    background: rgba(16, 9, 10, .97); border: 1px solid var(--line); border-radius: 22px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s, transform .3s var(--ease), visibility .3s;
  }
  .nav__links a { width: 100%; font-size: 1.05rem; padding: 0 16px; min-height: 50px; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }

  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .portrait {
    position: relative; width: 100%; height: 66svh; min-height: 380px;
    -webkit-mask-image: linear-gradient(0deg, transparent 0, #000 42%); mask-image: linear-gradient(0deg, transparent 0, #000 42%);
  }
  .hero__copy { width: auto; margin: -21svh var(--gutter) 0; padding-block: 0 72px; }
  .hero__title { font-size: clamp(2.6rem, 11vw, 3.6rem); }
  .hero__lede { margin-top: 20px; }
  .hero__actions { margin-top: 24px; }
  .hero__hint { top: calc(45svh - 64px); bottom: auto; left: 50%; }
  .hero__side { display: none; }
  .head, .about__grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 8px; }
  .tl__year { order: -1; font-size: 2.2rem; }
}

@media (max-width: 560px) {
  .chart { gap: 48px 12px; }
  .chart__stack { gap: 5px; }
  .chart__stack li { padding: .55em .5em; font-size: .76rem; }
  .chart__n { font-size: 1.9rem; }
  .chart__col h3 { font-size: 1.1rem; }
  .chart__col > p:last-child { min-height: 7.6em; font-size: .86rem; }
  .portrait__img, .portrait__true { object-position: 50% 0; background-position: 50% 0; }
  .facts { grid-template-columns: 1fr; }
  .facts > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .facts > div:nth-child(n+2) { padding-top: 26px; }
  .facts > div { padding-bottom: 26px; }
  .hero__actions .pill { flex: 1 1 auto; }
  .case__vis { padding-inline: 22px; }
  .sku-grid { --c: 6px; }
  .vis__note { left: 22px; }
  .nav__cta { display: none; }
  .nav__menu { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .intro__track, .outro__track { animation: none !important; }
}

/* ============================================================
   two sides: Analytics / Apps & Websites
   ============================================================ */
html:not([data-mode="apps"]) [data-side="apps"],
html[data-mode="apps"] [data-side="analytics"] { display: none !important; }

.mode {
  position: relative;
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: 999px;
  background: rgba(246, 239, 233, .06); border: 1px solid var(--line-2);
  isolation: isolate;
}
.mode::before {
  content: ""; position: absolute; z-index: -1;
  top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 999px; background: var(--red);
  transition: transform .45s var(--ease);
}
html[data-mode="apps"] .mode::before { transform: translateX(100%); }
.mode__btn {
  min-height: 44px; padding: 0 1.15em; border-radius: 999px;
  font-weight: 600; font-size: .9rem; white-space: nowrap; color: var(--cream-2);
  transition: color .3s;
}
.mode__btn[aria-pressed="true"] { color: #fff; }
.mode__btn:hover { color: var(--cream); }
.mode--hero { margin-top: 30px; }
.mode--hero + .hero__actions { margin-top: 18px; }
.mode--nav { margin-left: 14px; }
.mode--nav .mode__btn { min-height: 38px; font-size: .82rem; padding: 0 1em; }
.js .mode--hero { opacity: 0; transform: translateY(16px); }
.is-ready .mode--hero { opacity: 1; transform: none; transition: opacity .9s var(--ease) .4s, transform .9s var(--ease) .4s; }

/* the swap itself */
main { transition: opacity .28s ease, filter .28s ease; }
html.is-switching main { opacity: 0; filter: blur(6px); }

/* apps chart has three columns */
.chart--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* apps work grid */
.work--apps { padding-block: clamp(80px, 10vw, 140px); }
.builds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vis-flow .flow { display: flex; align-items: center; gap: 0; font-family: var(--f-mono); font-size: .75rem; color: var(--cream); }
.vis-flow .flow span { padding: .7em 1em; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); white-space: nowrap; }
.vis-flow .flow span:last-child { background: var(--red); border-color: var(--red); color: #fff; }
.vis-flow .flow i { position: relative; flex: 1; min-width: 18px; height: 1px; background: var(--line-2); overflow: hidden; }
.vis-flow .flow i::after { content: ""; position: absolute; top: -1px; left: -30%; width: 30%; height: 3px; background: var(--red-hot); animation: pulse-run 2.6s linear infinite; }
.vis-flow .flow i:nth-of-type(2)::after { animation-delay: 1.3s; }
.vis-chat { gap: 10px; }
.bub { max-width: 82%; padding: .65em .95em; border-radius: 16px; font-size: .88rem; line-height: 1.4; }
.bub--in { align-self: flex-start; background: rgba(246, 239, 233, .08); color: var(--cream); border-bottom-left-radius: 4px; }
.bub--out { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 4px; }
.case--cta { background: transparent; border-style: dashed; border-color: var(--line-2); }
.cta-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  height: 100%; padding: 36px 30px;
  background: radial-gradient(90% 70% at 100% 100%, rgba(110, 2, 5, .55), transparent 70%);
}
.cta-card__plus { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-2); margin-bottom: auto; transition: transform .5s var(--ease), border-color .3s; }
.cta-card__plus::before, .cta-card__plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 1.5px; margin: -.75px 0 0 -10px; background: var(--cream); }
.cta-card__plus::after { transform: rotate(90deg); }
.cta-card:hover .cta-card__plus { transform: rotate(90deg); border-color: var(--red-hot); }
.cta-card__title { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.05; letter-spacing: -.035em; }
.cta-card__text { color: var(--cream-2); font-size: .98rem; max-width: 30ch; }
.cta-card .pill { margin-top: 8px; }

@keyframes pulse-run { to { left: 110%; } }

@media (max-width: 1180px) { .mode--nav { display: none; } }
@media (max-width: 1080px) { .chart--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .builds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .builds { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .chart--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode--hero { display: grid; width: 100%; }
  .mode__btn { padding: 0 .6em; }
}
@media (prefers-reduced-motion: reduce) { html.is-switching main { opacity: 1; filter: none; } }
.hero.replay .ln > span { animation: line-rise 1s var(--ease) both; }
.hero.replay .ln:nth-child(2) > span { animation-delay: .07s; }
.hero.replay .ln:nth-child(3) > span { animation-delay: .14s; }
@keyframes line-rise { from { transform: translateY(112%); } to { transform: none; } }

/* ---------- particle portrait ---------- */
.portrait__particles { position: absolute; inset: 0; z-index: 2; touch-action: pan-y; }
.portrait.has-particles .portrait__img { visibility: hidden; }
.portrait.has-particles::after,
.portrait.has-particles::before,
.portrait.has-particles .portrait__true,
.portrait.has-particles .portrait__grid { display: none; }
.portrait.has-particles .lens-readout { transform: translate(26px, 26px); }
.portrait.has-particles.flip-x .lens-readout { transform: translate(calc(-100% - 26px), 26px); }
.portrait.has-particles.flip-y .lens-readout { transform: translate(26px, calc(-100% - 26px)); }
.portrait.has-particles.flip-x.flip-y .lens-readout { transform: translate(calc(-100% - 26px), calc(-100% - 26px)); }
