/* anto.si v4, the personal site of Antonius Carvalho.
   Themes: light is the default, dark is opt-in via the toggle in the top bar
   (stored in localStorage and a cookie, applied in <head> before paint).
   Colours come from the A mark: orange is the one UI accent (buttons, links,
   focus, active states); gold is for circuit traces, pulses, lit states and
   highlights; sky blue is a sparing secondary data colour (some traces and
   pulse heads). Surfaces are a deep teal family. Radius rule: 6px on
   everything interactive or framed.
   Note: --blue / --on-blue / --blue-hover keep their v3 names so every
   existing rule keeps working, but they now hold the orange button colours. */
:root,
:root[data-theme="light"] {
  --bg: #f2f6f6;
  --bg-rgb: 242 246 246;
  --bg-2: #fbfcfc;
  --bg-2-rgb: 251 252 252;
  --bg-3: #e6eeee;
  --tint-1: #e3eff0;
  --tint-2: #f6f0de;
  --teal-a: #d6e9ea;
  --teal-b: #c3dfe0;
  --line: rgba(15, 50, 55, 0.11);
  --line-2: rgba(15, 50, 55, 0.2);
  --text: #0f2326;
  --text-2: #3d5457;
  --text-3: #566b6e;
  --accent: #b5461a;
  --accent-rgb: 242 107 56;
  --blue: #f26b38; /* button orange */
  --blue-hover: #e45d2a;
  --on-blue: #1d0b03;
  --gold: #c08a1c;
  --gold-rgb: 192 138 28;
  --gold-ink: #8f6210; /* gold for text: 4.9:1 on --bg */
  --gold-dim: rgba(192, 138, 28, 0.38);
  --gold-glow: rgba(192, 138, 28, 0.45);
  --pulse: #e0a92e;
  --sky: #1f9fd0;
  --danger: #b3261e;
  --ok: #1f7a4a;
  --field: #fdfefe;
  --field-line: #9db2b4;
  --field-line-hover: #7a9294;
  --plate: #fdfefe;
  --logo-ink: brightness(0) saturate(0) opacity(0.82);
  --shadow: rgba(15, 50, 55, 0.14);
  --scrim-strong: 0.95;
  --grain: 0.035;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a1a1c;
  --bg-rgb: 10 26 28;
  --bg-2: #0f2427;
  --bg-2-rgb: 15 36 39;
  --bg-3: #143034;
  --tint-1: #10302f;
  --tint-2: #2a2313;
  --teal-a: #123a3c;
  --teal-b: #0c2729;
  --line: rgba(170, 215, 215, 0.12);
  --line-2: rgba(170, 215, 215, 0.22);
  --text: #e8f0f0;
  --text-2: #a9bfc0;
  --text-3: #7f9799;
  --accent: #ff8a5c;
  --accent-rgb: 255 138 92;
  --blue: #f26b38; /* button orange */
  --blue-hover: #ff8250;
  --on-blue: #1d0b03;
  --gold: #e8b84a;
  --gold-rgb: 232 184 74;
  --gold-ink: #e8b84a;
  --gold-dim: rgba(232, 184, 74, 0.35);
  --gold-glow: rgba(232, 184, 74, 0.7);
  --pulse: #ffe08a;
  --sky: #2bb5e6;
  --danger: #f08a7e;
  --ok: #8fd3a9;
  --field: #0b1d20;
  --field-line: #3a5558;
  --field-line-hover: #527073;
  --plate: #e6efef;
  --logo-ink: brightness(0) invert(0.92);
  --shadow: rgba(2, 10, 11, 0.7);
  --scrim-strong: 0.94;
  --grain: 0.05;
  color-scheme: dark;
}
:root {
  --radius: 6px;
  --nav-h: 68px;
  --wrap: 1360px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* z-index scale */
  --z-backdrop: -1;
  --z-content: 1;
  --z-nav: 50;
  --z-sheet: 60;
  --z-grain: 70;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 "Sora", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* Film grain on a fixed, non-interactive layer only. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: var(--grain);
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Page-wide depth backdrop (js/site/backdrop.js). */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--blue); color: var(--on-blue); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: calc(var(--z-sheet) + 1);
  padding: 10px 14px; background: var(--blue); color: var(--on-blue);
  border-radius: var(--radius); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--text-3); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.icon--lg { width: 32px; height: 32px; color: var(--accent); }
.icon--xl { width: 44px; height: 44px; color: var(--accent); }

/* ---------- Type ---------- */
.h2 {
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 18ch;
  text-wrap: balance;
}
.lead { color: var(--text-2); font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.65; max-width: 52ch; }
.eyebrow {
  margin-bottom: 20px;
  font: 500 12px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
h3 { font-weight: 600; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.015em; }

/* ---------- Buttons ---------- */
.btn {
  --h: 50px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 0.9375rem/1 "Sora", system-ui, sans-serif;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn .icon { transition: transform 0.35s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn--primary { background: var(--blue); color: var(--on-blue); }
.btn--primary:hover { background: var(--blue-hover); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: rgb(var(--bg-rgb) / 0.5); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--sm { --h: 42px; padding: 0 18px; font-size: 0.875rem; }

/* ---------- Navigation (always visible, so the theme toggle is too) ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
.nav.is-scrolled {
  background: rgb(var(--bg-rgb) / 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-h);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.nav__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.nav__mark { width: 40px; height: auto; flex: none; }
.nav__name { font: 600 1.0625rem/1 "Sora", system-ui, sans-serif; letter-spacing: -0.02em; }
.nav__dot { color: var(--accent); }
.nav__links { display: flex; gap: 26px; }
.nav__links a {
  position: relative;
  font-size: 0.875rem;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.25s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover, .nav__links a.is-current { color: var(--text); }
.nav__links a:hover::after, .nav__links a.is-current::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: rgb(var(--bg-rgb) / 0.5); color: var(--text); cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn .icon { width: 20px; height: 20px; }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .icon { position: absolute; transition: transform 0.6s var(--ease), opacity 0.4s ease; }
.theme-toggle .i-sun { transform: rotate(0deg); opacity: 1; }
.theme-toggle .i-moon { transform: rotate(-90deg) translateY(14px); opacity: 0; }
[data-theme="dark"] .theme-toggle .i-sun { transform: rotate(90deg) translateY(14px); opacity: 0; }
[data-theme="dark"] .theme-toggle .i-moon { transform: rotate(0deg); opacity: 1; }
.nav__toggle { display: none; }
.nav__sheet {
  position: fixed;
  inset: var(--nav-h) 0 auto;
  z-index: var(--z-sheet);
  padding: 12px var(--gutter) 28px;
  background: rgb(var(--bg-rgb) / 0.97);
  border-bottom: 1px solid var(--line);
}
.nav__sheet nav { display: grid; gap: 4px; }
.nav__sheet a:not(.btn) { padding: 14px 0; font-size: 1.125rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.nav__sheet .btn { margin-top: 18px; }

@media (max-width: 1180px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }
}
@media (max-width: 420px) { .nav__name { font-size: 0.9375rem; } .nav__mark { width: 34px; } }

/* Theme switch: the new theme spreads from the toggle (View Transitions). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: clip;
  isolation: isolate;
}
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero__scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* A soft pool behind the copy only, so the depth backdrop stays visible
     across the rest of the hero. */
  background:
    radial-gradient(ellipse 46% 52% at 26% 52%, rgb(var(--bg-rgb) / 0.6) 0%, rgb(var(--bg-rgb) / 0.35) 55%, rgb(var(--bg-rgb) / 0) 100%),
    linear-gradient(0deg, rgb(var(--bg-rgb) / 0.9) 0%, rgb(var(--bg-rgb) / 0) 16%);
}
.hero__particles { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.hero__inner { position: relative; z-index: 1; padding-top: calc(var(--nav-h) + 24px); padding-bottom: 64px; }
/* The copy is a 3D plate (js/site/tilt.js). Once the particles have landed,
   its layers lift apart in depth via the individual translate property, which
   composes with the GSAP transforms used for the scroll exit. */
.hero__copy { --gx: 50%; --gy: 50%; position: relative; width: fit-content; max-width: 100%; transform-style: preserve-3d; }
.hero__copy::before {
  content: ""; position: absolute; inset: -44px -52px; z-index: -1; pointer-events: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(420px circle at var(--gx) var(--gy), rgb(var(--gold-rgb) / 0.1), transparent 70%),
    rgb(var(--bg-rgb) / 0.55);
  /* Frosted glass: chips behind the copy blur into depth, text stays sharp. */
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  backdrop-filter: blur(7px) saturate(120%);
  translate: 0 0 -40px;
  opacity: 0;
  transition: opacity 0.8s ease, translate 1.1s var(--ease);
}
.hero__copy > * { transition: translate 1.1s var(--ease); }
.hero__copy.is-lifted::before { opacity: 1; }
.hero__copy.is-lifted .hero__title { translate: 0 0 36px; }
.hero__copy.is-lifted .hero__sub { translate: 0 0 18px; }
.hero__copy.is-lifted .hero__ctas { translate: 0 0 28px; }
/* Desktop: keep the plate well left of the hero chip on the right. */
@media (min-width: 768px) { .hero__copy { max-width: min(900px, 56vw); } }
@media (max-width: 767px) { .hero__copy::before { inset: -16px -8px; } }
.hero__title {
  font-weight: 600;
  font-size: clamp(2.1rem, 3.05vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.hero__line { display: block; white-space: nowrap; }
.hero__line--light { font-weight: 300; color: var(--text-2); }
.hero__title .char { display: inline-block; text-align: center; will-change: transform; }
.hero__sub { margin-top: 28px; max-width: 44ch; color: var(--text-2); font-size: clamp(1rem, 1.25vw, 1.1875rem); line-height: 1.6; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

@media (max-width: 767px) {
  .hero { align-items: flex-end; }
  .hero__scrim {
    background: linear-gradient(0deg, var(--bg) 0%, rgb(var(--bg-rgb) / 0.92) 45%, rgb(var(--bg-rgb) / 0.2) 75%, rgb(var(--bg-rgb) / 0) 100%);
  }
  .hero__inner { padding-top: 46dvh; padding-bottom: 48px; }
  .hero__line { white-space: normal; }
  .hero__ctas .btn { flex: 1 1 100%; }
}

/* ---------- Partners marquee ---------- */
.partners { padding: 36px 0 56px; border-bottom: 1px solid var(--line); background: rgb(var(--bg-rgb) / 0.7); }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; align-items: center; gap: clamp(48px, 6vw, 88px); width: max-content; padding-right: clamp(48px, 6vw, 88px); }
.marquee__track li { flex: none; }
.marquee.is-static { -webkit-mask-image: none; mask-image: none; }
.marquee.is-static .marquee__track { width: auto; flex-wrap: wrap; justify-content: center; row-gap: 32px; padding-inline: var(--gutter); }
/* Partner logos render in a single ink colour per theme so the row reads as one. */
.logo { height: 26px; width: auto; opacity: 0.6; transition: opacity 0.3s ease; filter: var(--logo-ink); }
.logo--sq { width: 32px; height: 32px; }
.logo:hover { opacity: 1; }

/* ---------- Statement (pinned) ---------- */
.statement {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 64px;
  overflow: clip;
}
.statement__traces { position: absolute; inset: 0; pointer-events: none; }
.statement__text {
  position: relative;
  max-width: 24ch;
  margin-left: clamp(0px, 8vw, 140px);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}
.motion-ok .statement__text .word { opacity: 0.14; }
@media (max-width: 767px) { .statement__text { margin-left: 0; } }

/* Shared trace SVG styles (generated by js/site/traces.js) */
.traces-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.traces-svg path { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.55; vector-effect: non-scaling-stroke; }
.traces-svg path.is-blue { stroke: var(--sky); opacity: 0.4; }
.traces-svg circle { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.7; vector-effect: non-scaling-stroke; }
.traces-svg .pulse { fill: var(--pulse); stroke: none; opacity: 1; filter: drop-shadow(0 0 4px var(--gold-glow)); }

/* ---------- Friday ecosystem diagram ---------- */
.eco { position: relative; min-height: 100dvh; display: flex; align-items: center; padding: calc(var(--nav-h) + 32px) 0 48px; }
.eco__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.eco__steps { margin-top: 44px; display: grid; gap: 4px; }
.eco__step {
  position: relative;
  padding: 18px 0 18px 26px;
  border-left: 1px solid var(--line-2);
}
.eco__step::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 1px;
  background: var(--gold); transform: scaleY(0); transform-origin: top;
  transition: transform 0.6s var(--ease);
}
.eco__step h3 { font-size: 1.125rem; color: var(--text-3); transition: color 0.4s ease; }
.eco__step p { margin-top: 8px; max-width: 46ch; color: var(--text-2); font-size: 0.9375rem; line-height: 1.6; transition: opacity 0.4s ease; }
.eco__step.is-active::before { transform: scaleY(1); }
.eco__step.is-active h3 { color: var(--text); }
.eco.is-pinnable .eco__step:not(.is-active) p { opacity: 0.4; }

.eco__visual { position: relative; }
.eco__diagram { position: relative; width: 100%; max-width: min(620px, 72dvh); aspect-ratio: 1; margin-inline: auto; }
.eco__diagram > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eco__wire { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.eco__wire--live { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.eco__pulse { fill: var(--pulse); filter: drop-shadow(0 0 5px var(--gold-glow)); }
.eco__ring { fill: none; stroke: var(--line-2); stroke-dasharray: 2 6; }
.eco__node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: 104px;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--text-3);
  transition: color 0.4s ease;
}
.eco__chip {
  position: relative;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
  transition: border-color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease, transform 1.1s var(--ease);
}
/* Two staggered ripple rings radiate from every live service. */
.eco__chip::before, .eco__chip::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1.5px solid var(--gold); opacity: 0;
}
.eco__node.is-on .eco__chip::before { animation: eco-ripple 2.4s var(--ease) infinite; }
.eco__node.is-on .eco__chip::after { animation: eco-ripple 2.4s var(--ease) 1.2s infinite; }
@keyframes eco-ripple {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(2.1); opacity: 0; }
}
/* --grow (0..1) is driven by the signal travelling to this chip (ecosystem.js). */
.eco__chip { scale: calc(1 + var(--grow, 0) * 0.16); }
.eco__chip .icon { width: 26px; height: 26px; color: var(--text-3); opacity: 0.5; transition: color 0.5s ease, opacity 0.5s ease; }
.eco__chip img { width: 26px; height: 26px; filter: grayscale(1); opacity: 0.4; transition: filter 0.5s ease, opacity 0.5s ease; }
.eco__node.is-on { color: var(--text); }
.eco__node.is-on .eco__chip {
  border-color: var(--blue); background: var(--bg-2);
  transform: scale(1.12);
  box-shadow: 0 14px 30px -12px rgb(var(--accent-rgb) / 0.5);
}
.eco__node.is-on .eco__chip .icon { color: var(--accent); opacity: 1; }
.eco__node { transition: color 0.4s ease; }
.eco__node.is-on > span:last-child { font-weight: 600; }
.eco__node.is-on .eco__chip img { filter: none; opacity: 1; }
.eco__core {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid; place-items: center; align-content: center; gap: 10px;
  width: 30%; aspect-ratio: 1;
  padding: 12px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(160deg, var(--tint-2), var(--tint-1) 70%);
  box-shadow: 0 30px 70px -30px rgb(var(--gold-rgb) / 0.55);
  text-align: center;
}
.eco__core img { width: 62%; height: auto; }
.eco__core span { max-width: 13ch; font-size: 0.8125rem; font-weight: 500; line-height: 1.3; color: var(--text); }

@media (max-width: 899px) {
  .eco { min-height: 0; padding: 96px 0; }
  .eco__grid { grid-template-columns: 1fr; }
  .eco__visual { order: -1; }
  .eco__node { width: 80px; font-size: 0.6875rem; }
  .eco__chip { width: 44px; height: 44px; }
  .eco__chip img, .eco__chip .icon { width: 22px; height: 22px; }
  .eco__core span { font-size: 0.6875rem; }
}

/* ---------- Career highlights horizontal pan ---------- */
.pan { position: relative; overflow: clip; }
.pan__track {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 36px);
  width: max-content;
  height: 100dvh;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 72px;
}
.pan__rail { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pan__rail path { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.7; }
.pan__rail circle { fill: var(--bg); stroke: var(--gold); stroke-width: 1.2; transition: fill 0.4s ease; }
.pan__rail circle.is-lit { fill: var(--gold); filter: drop-shadow(0 0 6px var(--gold-glow)); }
.pan__panel { position: relative; flex: none; }
.pan__panel--intro { width: min(560px, 84vw); padding-right: clamp(20px, 4vw, 64px); }
.pan__panel--intro .lead { margin-top: 24px; }
.pan__panel--card {
  width: min(340px, 78vw);
  min-height: 380px;
  padding: 32px 28px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(var(--bg-2-rgb) / 0.75), rgb(var(--bg-2-rgb) / 0.96));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 60px -36px var(--shadow);
}
/* A gold rule along the top edge, brightest at the left corner. */
.pan__panel--card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), rgb(var(--gold-rgb) / 0.35) 55%, transparent);
}
.pan__card-traces { position: absolute; inset: 0 0 45% 30%; z-index: -1; opacity: 0.75; }
.pan__panel--card p { color: var(--text-2); font-size: 0.9375rem; line-height: 1.6; }
.pan__panel--card .pan__stat {
  margin-bottom: auto;
  padding-bottom: 24px;
  color: var(--gold-ink);
  font-weight: 600;
  font-size: clamp(2rem, 2.6vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.pan__panel--low { align-self: flex-end; margin-bottom: 2vh; }

/* Mobile / reduced motion: native horizontal scroll with snap. */
.pan.is-native .pan__track {
  width: auto;
  height: auto;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  padding-top: 96px; padding-bottom: 96px;
  align-items: stretch;
}
.pan.is-native .pan__track::-webkit-scrollbar { display: none; }
.pan.is-native .pan__panel { scroll-snap-align: start; align-self: stretch; margin: 0; }
.pan.is-native .pan__panel--intro { width: 86vw; }
.pan.is-native .pan__rail { display: none; }

/* ---------- AI projects sticky stack ---------- */
.agents { padding: clamp(96px, 14vh, 160px) 0 clamp(64px, 10vh, 120px); }
.agents__title { margin-bottom: clamp(40px, 6vh, 72px); }
/* Large gaps = scroll distance each card holds before the next covers it. */
.agents__stack { display: grid; gap: 34dvh; padding-bottom: 20dvh; }
@media (max-width: 767px) { .agents__stack { gap: 18dvh; padding-bottom: 8dvh; } }
.agent {
  --dim: 0;
  position: sticky;
  top: calc(var(--nav-h) + 24px + var(--i, 0) * 18px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: min(560px, 72dvh);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 -20px 60px -30px var(--shadow);
  transform-origin: 50% 0%;
}
/* Receding cards dim under an overlay instead of turning see-through. */
.agent::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: var(--bg); opacity: calc(var(--dim) * 0.7);
}

.agent__body { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: clamp(28px, 4vw, 56px); }
.agent__body h3 { font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -0.025em; }
.agent__body > p { color: var(--text-2); max-width: 44ch; }
/* Media panel: circuit traces behind a small board of tech logos. Each card
   gets its own surface so the stack has rhythm. */
.agent__media {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  min-height: 260px;
  border-left: 1px solid var(--line);
  background: linear-gradient(150deg, var(--teal-a), var(--teal-b));
}
.agent--b .agent__media {
  background:
    radial-gradient(90% 80% at 80% 10%, rgb(var(--gold-rgb) / 0.22), transparent 70%),
    var(--tint-2);
}
.agent--c .agent__media { background: radial-gradient(90% 80% at 50% 100%, rgb(var(--gold-rgb) / 0.1), transparent 70%), var(--bg-3); }
.agent--d .agent__media {
  background:
    radial-gradient(80% 70% at 20% 90%, rgb(var(--accent-rgb) / 0.12), transparent 70%),
    var(--tint-1);
}
.agent__traces { position: absolute; inset: 0; z-index: 0; opacity: 0.85; pointer-events: none; }
.agent__logos {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px;
  width: calc(2 * 92px + 14px);
}
.agent__logos li {
  display: grid; place-items: center;
  width: 92px; height: 92px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: rgb(var(--bg-2-rgb) / 0.92);
  box-shadow: 0 14px 28px -18px var(--shadow);
}
.agent__logos img { width: 40px; height: 40px; filter: var(--logo-ink); opacity: 0.85; }

/* Agent flow: four steps linked by a gold trace, with a pulse riding it. */
.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 22px;
}
.flow::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 1px;
  background: var(--gold-dim);
}
.flow::after {
  content: ""; position: absolute; top: 2px; left: 0; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  animation: flow-pulse 3.6s var(--ease) infinite;
}
.flow li {
  position: relative;
  font: 400 0.75rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-2);
}
.flow li::before {
  content: ""; position: absolute; left: 0; top: -22px; width: 11px; height: 11px;
  border: 1px solid var(--gold); border-radius: 50%; background: var(--bg-2);
}
@keyframes flow-pulse {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(calc(var(--flow-w, 400px) - 8px)); opacity: 0; }
}

@media (max-width: 767px) {
  .agent { grid-template-columns: 1fr; min-height: 0; top: calc(var(--nav-h) + 12px + var(--i, 0) * 10px); }
  .agent__media { order: -1; min-height: 0; padding: 28px 16px; border-left: 0; border-bottom: 1px solid var(--line); }
  .agent__logos { width: auto; gap: 10px; }
  .agent__logos li { width: 64px; height: 64px; }
  .agent__logos img { width: 30px; height: 30px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .flow::before, .flow::after { display: none; }
}

/* ---------- Skills bento ---------- */
.services { padding: clamp(96px, 14vh, 160px) 0; overflow-x: clip; }
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(220px, auto);
  gap: 16px;
  margin-top: clamp(40px, 6vh, 64px);
}
.tile {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex;
  overflow: hidden;
  isolation: isolate;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 20px 50px -40px var(--shadow);
  transition: border-color 0.4s ease;
}
/* Transform transition only once GSAP has finished revealing the tile. */
.tile.is-in { transition: border-color 0.4s ease, transform 0.4s var(--ease); }
/* Spotlight border that follows the pointer (set by JS). */
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgb(var(--gold-rgb) / 0.85), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s ease;
}
.tile:hover::before { opacity: 1; }
.tile__content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: auto; }
.tile__content .icon--lg { margin-bottom: 10px; }
.tile p { color: var(--text-2); font-size: 0.9375rem; line-height: 1.55; max-width: 44ch; }
.tile__traces { position: absolute; inset: 0; z-index: 0; opacity: 0.9; }

/* Tool logos at the foot of a tile: one ink per theme, like the marquee.
   .logos--color keeps the vendors' own colours (Microsoft icons). */
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.logos img { width: 24px; height: 24px; filter: var(--logo-ink); opacity: 0.68; }
.logos--color img { filter: none; opacity: 1; }

/* 4 columns: AI 2x2 + M365 (2); Leadership + ITSM; Infra (2) + Dev (2);
   Data (2) + Cloud (2). Auto-placement fills it with no empty cells. */
.tile--sec {
  grid-column: span 2; grid-row: span 2; min-height: 480px;
  background:
    radial-gradient(70% 60% at 100% 0%, rgb(var(--gold-rgb) / 0.16), transparent 70%),
    linear-gradient(160deg, var(--teal-a), var(--teal-b));
}
.tile--sec h3 { font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -0.025em; }
.tile--net { grid-column: span 2; background: linear-gradient(135deg, var(--tint-1), var(--bg-2) 70%); }
.tile--ai { background: radial-gradient(120% 90% at 100% 0%, rgb(var(--gold-rgb) / 0.2), transparent 65%), var(--tint-2); }
.tile--sw { background: var(--bg-3); }
.tile--tel { grid-column: span 2; }
.tile--con { grid-column: span 2; background: linear-gradient(315deg, var(--tint-2), var(--bg-2) 60%); }
.tile--data { grid-column: span 2; background: linear-gradient(135deg, var(--teal-a), var(--bg-2) 75%); }
.tile--cloud { grid-column: span 2; background: var(--bg-3); }

@media (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--sec { grid-row: span 1; min-height: 400px; }
}
@media (max-width: 767px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile, .tile--sec, .tile--net, .tile--tel, .tile--con, .tile--data, .tile--cloud { grid-column: auto; grid-row: auto; min-height: 220px; }
  .tile--sec { min-height: 360px; }
}

/* ---------- About ---------- */
.about { padding: clamp(96px, 14vh, 160px) 0; border-top: 1px solid var(--line); }
.about__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.about__copy .lead { margin-top: 24px; }
.about__copy .btn { margin-top: 40px; }
.values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; margin-top: 56px; }
.values h3 { font-size: 1rem; }
.values p { margin-top: 6px; color: var(--text-2); font-size: 0.9375rem; line-height: 1.55; }
/* Big A mark drawn from micro AI words (js). */
.dither { display: block; width: 100%; aspect-ratio: 1.25 / 1; max-height: 360px; margin-bottom: 32px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.stat { padding-top: 16px; border-top: 1px solid var(--gold-dim); }
.stat__num {
  display: block;
  font-weight: 600;
  font-size: clamp(2.25rem, 3.6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stat__label { display: block; margin-top: 10px; color: var(--text-2); font-size: 0.9375rem; }
@media (max-width: 899px) { .about__grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .values { grid-template-columns: 1fr; } }

/* ---------- Experience timeline ---------- */
.approach { padding: clamp(96px, 14vh, 160px) 0; overflow: clip; }
.approach__title { margin-inline: auto; text-align: center; }
.approach__body { position: relative; margin-top: clamp(56px, 8vh, 96px); }
.approach__path { position: absolute; left: 50%; top: 0; width: 40px; height: 100%; transform: translateX(-50%); overflow: visible; }
.approach__path path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.approach__path .track { stroke: var(--line-2); }
.approach__path .live { stroke: var(--gold); }
.approach__list { display: grid; gap: clamp(56px, 10vh, 120px); }
.approach__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 96px;
}
.approach__item > div { grid-column: 1; text-align: right; max-width: 400px; justify-self: end; }
.approach__item:nth-child(even) > div { grid-column: 2; text-align: left; justify-self: start; }
.approach__item h3 { font-size: clamp(1.5rem, 2.4vw, 2.125rem); letter-spacing: -0.03em; transition: color 0.5s ease; color: var(--text-3); }
.approach__item p { margin-top: 10px; color: var(--text-2); line-height: 1.6; }
.approach__item .approach__when {
  margin: 0 0 10px;
  font: 500 0.75rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.approach__node {
  position: absolute; left: 50%; top: 10px;
  width: 16px; height: 16px; margin-left: -8px;
  border: 1.5px solid var(--line-2); border-radius: 50%;
  background: var(--bg);
  transition: border-color 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease;
}
.approach__item.is-lit h3 { color: var(--text); }
.approach__item.is-lit .approach__node { border-color: var(--gold); background: var(--gold); box-shadow: 0 6px 14px -4px var(--gold-glow); }
@media (max-width: 767px) {
  .approach__title { text-align: left; margin-inline: 0; }
  .approach__path { left: 8px; transform: none; }
  .approach__item { grid-template-columns: 1fr; padding-left: 44px; }
  .approach__item > div, .approach__item:nth-child(even) > div { grid-column: 1; text-align: left; justify-self: start; }
  .approach__node { left: 16px; }
}

/* ---------- Contact ---------- */
.contact { position: relative; padding: clamp(96px, 14vh, 160px) 0; border-top: 1px solid var(--line); overflow: clip; }
.contact__traces { position: absolute; inset: 0; pointer-events: none; opacity: 0.7; }
.contact__grid { position: relative; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.contact__info .lead { margin-top: 20px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 28px 32px; margin-top: 48px; }
.details dt { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.details dt .icon { color: var(--accent); }
.details dd { color: var(--text-2); font-size: 0.9375rem; line-height: 1.6; }
.details a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.details a:hover { color: var(--accent); }

.form {
  display: grid;
  gap: 22px;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: rgb(var(--bg-2-rgb) / 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px -40px var(--shadow);
}
.field { display: grid; gap: 8px; }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.field input, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field textarea { resize: vertical; min-height: 128px; }
.field input:hover, .field textarea:hover { border-color: var(--field-line-hover); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.28); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__hint { font-size: 0.8125rem; color: var(--text-3); }
.field__error { font-size: 0.8125rem; color: var(--danger); }
.form__submit { width: 100%; }
.form__spinner { display: none; width: 20px; height: 20px; animation: spin 0.9s linear infinite; }
.form.is-sending .form__spinner { display: block; }
.form.is-sending .form__submit { pointer-events: none; opacity: 0.85; }
.form__status { font-size: 0.9375rem; color: var(--text-2); min-height: 1.5em; }
.form__status.is-ok { color: var(--ok); }
.form__status.is-err { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 899px) { .contact__grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { padding: 72px 0 32px; border-top: 1px solid var(--line); background: var(--bg-3); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer__brand { display: grid; gap: 14px; align-content: start; }
.footer__brand p { font-size: 0.9375rem; line-height: 1.5; max-width: 32ch; }
.footer__lockup { height: 40px; width: auto; }
.footer__lockup--dark { display: none; }
[data-theme="dark"] .footer__lockup--light { display: none; }
[data-theme="dark"] .footer__lockup--dark { display: block; }
.footer__col { display: grid; gap: 10px; align-content: start; font-size: 0.9375rem; }
.footer__col h3 { margin-bottom: 6px; font-size: 0.875rem; }
.footer__col a { color: var(--text-2); text-decoration: none; }
.footer__col a:hover { color: var(--text); }
.social { display: flex; gap: 8px; margin-bottom: 6px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text-2); transition: color 0.25s ease, border-color 0.25s ease; }
.social a:hover { color: var(--accent); border-color: var(--accent); }
.footer__base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.8125rem; }
@media (max-width: 899px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Motion initial states ----------
   .motion-pre is set in <head> so the hero never flashes before the
   headline assembles; main.js swaps it for .motion-ok once GSAP is running.
   The unhide keyframe is a safety net if scripts never arrive. */
.motion-pre .hero__title, .motion-pre [data-hero-fade] { opacity: 0; animation: mk-unhide 0.4s ease 4s forwards; }
@keyframes mk-unhide { to { opacity: 1; } }
.motion-ok [data-reveal] { opacity: 0; }
.motion-ok [data-hero-fade] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .flow::after { display: none; }
  .agent { position: relative; top: auto; }
}
