/* =========================================================
   Juvante Deo Nuenay — Portfolio
   Signature: live workflow-canvas. Accent: electric teal.
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --nav-h: 72px;
}

html[data-theme="dark"] {
  --bg: #090c13;
  --bg-2: #0c1019;
  --surface: #10151f;
  --surface-2: #151c29;
  --line: rgba(160, 178, 209, 0.12);
  --line-2: rgba(160, 178, 209, 0.22);
  --text: #e9eef7;
  --text-dim: #b3bccf;
  --muted: #7d889e;
  --accent: #2fe0c2;
  --accent-2: #16c7a8;
  --accent-blu: #4dc3ff;
  --accent-vio: #8a7dff;
  --grad: linear-gradient(100deg, #2fe0c2 0%, #4dc3ff 52%, #8a7dff 100%);
  --aur1: rgba(47, 224, 194, 0.2);
  --aur2: rgba(138, 125, 255, 0.17);
  --aur3: rgba(77, 195, 255, 0.15);
  --glow: rgba(47, 224, 194, 0.5);
  --glow-soft: rgba(47, 224, 194, 0.14);
  --btn-bg: #2fe0c2;
  --btn-fg: #04130f;
  --grid-dot: rgba(150, 170, 205, 0.10);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --canvas-bg: #f5f7fb;
  --scrim: rgba(4, 7, 12, 0.82);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #e7ecf4;
  --surface: #ffffff;
  --surface-2: #f4f7fc;
  --line: rgba(18, 38, 68, 0.12);
  --line-2: rgba(18, 38, 68, 0.20);
  --text: #0b111c;
  --text-dim: #37425a;
  --muted: #5a6478;
  --accent: #0a7d6a;
  --accent-2: #0fa98c;
  --accent-blu: #2a63c9;
  --accent-vio: #6d5bd0;
  --grad: linear-gradient(100deg, #0a8a72 0%, #2a63c9 52%, #6d5bd0 100%);
  --aur1: rgba(10, 138, 114, 0.14);
  --aur2: rgba(109, 91, 208, 0.12);
  --aur3: rgba(42, 99, 201, 0.11);
  --glow: rgba(15, 169, 140, 0.30);
  --glow-soft: rgba(15, 169, 140, 0.10);
  --btn-bg: #0fa98c;
  --btn-fg: #04241e;
  --grid-dot: rgba(20, 45, 85, 0.10);
  --shadow: 0 24px 60px -28px rgba(20, 40, 80, 0.28);
  --canvas-bg: #f7f9fc;
  --scrim: rgba(226, 232, 242, 0.9);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

/* Contain the horizontal slide-in reveals so they never cause page-level
   horizontal scroll. main excludes the sticky nav, so this is sticky-safe. */
main { overflow-x: clip; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--btn-fg); }

/* ---------- Utilities ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow__pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 8px rgba(47, 224, 194, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 224, 194, 0); }
}

.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 200;
  background: var(--accent);
  color: var(--btn-fg);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: var(--pad-y) 1.5rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn i { font-size: 1.15em; }
.btn--sm { --pad-y: 0.6rem; padding: var(--pad-y) 1.1rem; font-size: 0.9rem; }
.btn--full { width: 100%; }

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 8px 26px -10px var(--glow);
  position: relative;
  overflow: hidden;
}
/* specular shine sweep */
.btn--primary::after {
  content: "";
  position: absolute;
  top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s var(--ease);
  pointer-events: none;
}
.btn--primary:hover::after { left: 130%; }
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -8px var(--glow);
}
.btn--primary:active { transform: translateY(0) scale(0.985); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--ghost:active { transform: translateY(0) scale(0.985); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand__mark { color: var(--accent); display: inline-flex; }
.brand__dot { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 0.1rem;
  margin-left: auto;
  margin-right: 0.4rem;
}
.nav__links a {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
  position: relative;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0.6rem; right: 0.6rem; bottom: 0.32rem;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--text); }

.nav__actions { display: flex; align-items: center; gap: 0.6rem; }

.theme-toggle {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  position: relative;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle i { position: absolute; font-size: 1.2rem; transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
html[data-theme="dark"] .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
html[data-theme="dark"] .icon-moon { opacity: 1; transform: rotate(0) scale(1); color: var(--accent); }
html[data-theme="light"] .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
html[data-theme="light"] .icon-sun { opacity: 1; transform: rotate(0) scale(1); color: var(--accent); }

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
}
.nav__burger span {
  display: block;
  width: 18px; height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem clamp(1rem, 4vw, 2rem) 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.nav__mobile a {
  padding: 0.85rem 0.5rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
}
.nav__mobile .btn { margin-top: 0.75rem; border-bottom: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(2rem, 6vh, 5rem) 0 3rem;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 80% at 60% 40%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 60% 40%, #000 55%, transparent 100%);
  pointer-events: none;
}
.hero__glow {
  position: absolute;
  width: 46vmax; height: 46vmax;
  left: var(--mx, 70%);
  top: var(--my, 30%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow-soft) 0%, transparent 62%);
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 1.1rem 0 1.25rem;
}
.hero__title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  position: relative;
}
.hero__sub {
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  color: var(--text-dim);
  max-width: 46ch;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1.8rem 0 1.4rem;
}
.hero__signature {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- Workflow graph (signature) ---------- */
.hero__canvas { perspective: 1000px; }
.wf {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  will-change: transform;
}
.wf__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.wf__title { display: inline-flex; align-items: center; gap: 0.5rem; }
.wf__live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  animation: pulse 2.4s infinite;
}
.wf__svg { display: block; width: 100%; height: auto; padding: 0.5rem; }

.wire {
  stroke: var(--line-2);
  stroke-width: 2;
  stroke-dasharray: 5 6;
  animation: dash 1.6s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -22; } }

.wf__node rect {
  fill: var(--bg-2);
  stroke: var(--line-2);
  stroke-width: 1.5;
  transition: stroke 0.3s var(--ease);
}
html[data-theme="light"] .wf__node rect { fill: #fff; }
.wf__node text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  fill: var(--text);
}
.wf__node .node-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  fill: var(--muted);
}
.node-dot { fill: var(--muted); }
.node-dot--ai { fill: var(--accent); }
.node-dot--ok { fill: var(--accent); }
.wf__node--ai rect { stroke: color-mix(in srgb, var(--accent) 55%, var(--line-2)); }

.packet {
  fill: var(--accent);
  filter: drop-shadow(0 0 5px var(--glow));
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 4vw, 2rem);
}
.section__head { max-width: 60ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.section__lead {
  margin-top: 0.9rem;
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 58ch;
}

/* ---------- Stats ---------- */
.stats {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
/* A signal sweeps the top/bottom borders, like these figures are being
   read live off the automations rather than printed once and left static. */
.stats::before,
.stats::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 45%, var(--accent) 55%, transparent 100%);
  background-size: 45% 100%;
  background-repeat: no-repeat;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px var(--glow));
  animation: stats-scan 6s linear infinite;
  pointer-events: none;
}
.stats::before { top: -1px; }
.stats::after { bottom: -1px; animation-direction: reverse; animation-delay: -3s; }
@keyframes stats-scan {
  0% { background-position: -55% 0; }
  100% { background-position: 155% 0; }
}
.stats__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.stat { display: flex; flex-direction: column; gap: 0.35rem; }
.stat__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.9rem);
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat__label { color: var(--muted); font-size: 0.92rem; }
.stat + .stat { position: relative; }
.stat + .stat::before {
  content: "";
  position: absolute;
  left: -0.75rem; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--line);
}

/* ---------- Work / Projects ---------- */
.projects { display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 5.5rem); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.project--reverse .project__info { order: 2; }
.project--reverse .project__canvas { order: 1; }

.project__info { min-width: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 0.32rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  background: var(--glow-soft);
}
.project__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0.7rem;
}
.project__desc { color: var(--text-dim); max-width: 52ch; }

/* Case-study framing */
.cs-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.project__problem {
  color: var(--text);
  max-width: 52ch;
  margin-bottom: 1rem;
  padding-left: 0.9rem;
  border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.project__problem .cs-label { color: var(--accent); }
.project__desc .cs-label { color: var(--muted); }

.flow {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.2rem;
}
.flow li {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  position: relative;
}
.flow li:not(:last-child)::after {
  content: "→";
  margin: 0 0.05rem 0 0.45rem;
  color: var(--accent);
}

.project__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.project__tools span {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2);
}
.project__result {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-dim);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--glow-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.project__result i { color: var(--accent); font-size: 1.05rem; position: relative; top: 2px; }
.project__result strong { color: var(--text); font-weight: 600; }
.cs-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

/* Canvas frame (screenshot) */
.project__canvas {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--canvas-bg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project__canvas:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.project__canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.canvas-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.canvas-bar--sm { padding: 0.4rem 0.6rem; font-size: 0.6rem; gap: 0.4rem; }
.canvas-bar--sm .dots i { width: 6px; height: 6px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dots i:first-child { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.project__canvas img {
  width: 100%;
  height: 300px;
  object-fit: contain;
  object-position: center;
  padding: 1rem;
  background:
    radial-gradient(rgba(20, 40, 80, 0.06) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--canvas-bg);
}
.project__canvas--tall img { height: 420px; }
.canvas-zoom {
  position: absolute;
  right: 0.85rem; bottom: 0.85rem;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.project__canvas:hover .canvas-zoom,
.project__canvas:focus-visible .canvas-zoom { opacity: 1; transform: translateY(0); }

/* Wide banner variant: image on top, case-study text in two readable columns */
.project--wide { grid-template-columns: 1fr; gap: 1.5rem; }
.project--wide .project__canvas img { height: clamp(200px, 26vw, 360px); }
.project--wide .project__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 2.5rem;
  align-items: start;
}
.project--wide .tag { grid-column: 1; }
.project--wide .project__title { grid-column: 1 / -1; margin: 0.2rem 0 0.4rem; }
.project--wide .project__problem { grid-column: 1; }
.project--wide .project__desc { grid-column: 2; }
.project--wide .flow { grid-column: 1 / -1; }
.project--wide .project__tools { grid-column: 1 / -1; }
.project--wide .project__result { grid-column: 1 / -1; }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__id {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.about__photo {
  flex-shrink: 0;
  width: 116px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--canvas-bg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.about__photo:hover { transform: translateY(-3px); border-color: var(--accent); }
.about__photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: grayscale(35%) contrast(1.03);
}
.about__id .section__title { margin: 0; }
.about__intro p { color: var(--text-dim); margin-top: 1rem; max-width: 58ch; }
.creds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.creds h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.creds__loc { margin-top: 1.25rem; }
.creds ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.creds li { font-size: 0.92rem; color: var(--text-dim); }

.about__cards { display: flex; flex-direction: column; gap: 1rem; }
.cap {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.cap:hover { border-color: var(--accent); transform: translateY(-3px); }
.cap__k {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  margin-bottom: 0.55rem;
}
.cap__k i { color: var(--accent); font-size: 1.25rem; }
.cap p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  padding: 1.4rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee 24s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
.chip i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
}
.chip__logo {
  width: 1.2em; height: 1.2em;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.chip:hover .chip__logo { color: var(--accent); }
.chip__mono {
  display: inline-grid;
  place-items: center;
  width: 1.55em; height: 1.55em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.marquee__label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

/* ---------- Certifications ---------- */
.certs__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  max-width: none;
}
.certs__head > div { max-width: 56ch; }
.certs__resume { flex-shrink: 0; }
.certs__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}
.cert {
  flex: 1 1 300px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.cert:hover { transform: translateY(-5px); border-color: var(--accent); }
.cert:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cert__frame {
  position: relative;
  display: block;
  aspect-ratio: 1.414 / 1;
  overflow: hidden;
  background: var(--canvas-bg);
  border-bottom: 1px solid var(--line);
}
.cert__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s var(--ease);
}
.cert:hover .cert__frame img { transform: scale(1.04); }
.cert__zoom {
  position: absolute;
  right: 0.7rem; bottom: 0.7rem;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.cert:hover .cert__zoom,
.cert:focus-visible .cert__zoom { opacity: 1; transform: translateY(0); }
.cert__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.05rem 1.1rem;
}
.cert__name { font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--text); line-height: 1.25; }
.cert__issuer { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

/* ---------- Process + Book ---------- */
.book__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.steps { list-style: none; padding: 0; margin-top: 2rem; display: flex; flex-direction: column; gap: 1.4rem; }
.steps li { display: flex; gap: 1.1rem; align-items: flex-start; }
.steps__n {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  flex-shrink: 0;
  background: var(--glow-soft);
}
.steps h4 { font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; margin-bottom: 0.25rem; }
.steps p { color: var(--muted); font-size: 0.95rem; max-width: 44ch; }

.book__card {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: var(--shadow);
}
.book__card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; }
.book__card > p { color: var(--text-dim); margin: 0.6rem 0 1.3rem; }
.calendly-inline-widget {
  margin-top: 1.3rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer__brand p { color: var(--muted); margin-top: 0.9rem; max-width: 34ch; font-size: 0.95rem; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer__links { display: flex; flex-direction: column; }
.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-dim);
  padding: 0.45rem 0;
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}
.footer__links a:hover { color: var(--accent); }
.footer__links i { color: var(--accent); font-size: 1.1rem; }
.footer__links .brand-svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: var(--accent);
  flex-shrink: 0;
}
.footer__cta .btn { margin-top: 0.2rem; }
.footer__base {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 4rem);
  opacity: 0;
  animation: fade 0.25s var(--ease) forwards;
}
.lightbox[hidden] { display: none; }
@keyframes fade { to { opacity: 1; } }
.lightbox__fig {
  max-width: min(1200px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lightbox__fig img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: #fff;
}
.lightbox__fig figcaption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  display: grid; place-items: center;
  font-size: 1.3rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.lightbox__close:hover { border-color: var(--accent); transform: rotate(90deg); }

/* ---------- Custom cursor + click FX ---------- */
.cursor-dot,
.cursor-ring { display: none; }
body.has-cursor .cursor-dot,
body.has-cursor .cursor-ring {
  display: block;
  position: fixed;
  top: 0; left: 0;
  z-index: 400;
  pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: normal;
}
body.has-cursor { cursor: none; }
body.has-cursor a,
body.has-cursor button,
body.has-cursor [data-lightbox] { cursor: none; }
/* Hand back the native cursor over the embedded Calendly iframe so it
   doesn't freeze/jump at the boundary (see script.js). */
body.has-cursor.cursor-suspended,
body.has-cursor.cursor-suspended a,
body.has-cursor.cursor-suspended button { cursor: auto; }
.cursor-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow);
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent);
  transform: translate(-50%, -50%);
  transition: width 0.22s var(--ease), height 0.22s var(--ease),
    background 0.22s var(--ease), border-color 0.22s var(--ease);
}
body.cursor-hover .cursor-ring {
  width: 52px; height: 52px;
  background: var(--glow-soft);
  border-color: var(--accent);
}

.cursor-trail { position: fixed; inset: 0; z-index: 380; pointer-events: none; }
.fx-layer { position: fixed; inset: 0; z-index: 390; pointer-events: none; }
.ripple {
  position: fixed;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ripple 0.6s var(--ease) forwards;
}
@keyframes ripple {
  0% { width: 8px; height: 8px; opacity: 0.9; }
  100% { width: 90px; height: 90px; opacity: 0; }
}
.spark {
  position: fixed;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  z-index: 300;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--grad);
  box-shadow: 0 0 10px var(--glow);
}

/* ---------- Pain / relate cards ---------- */
.pain__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.pcard {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  text-align: left;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.pcard:hover, .pcard:focus-visible, .pcard.is-open {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2));
  box-shadow: var(--shadow);
}
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pcard__front, .pcard__back {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 168px;
}
.pcard__front i { font-size: 1.7rem; color: var(--muted); }
.pcard__t { font-size: 1rem; color: var(--text); line-height: 1.45; }
.pcard__hint {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pcard__hint::after { content: "→"; transition: transform 0.3s var(--ease); }
.pcard:hover .pcard__hint::after { transform: translateX(4px); }
.pcard__back {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface));
  transform: translateY(101%);
  transition: transform 0.42s var(--ease);
  justify-content: center;
}
.pcard__back i { font-size: 1.7rem; color: var(--accent); }
.pcard__back .pcard__t { color: var(--text); font-weight: 500; }
.pcard:hover .pcard__back,
.pcard:focus-visible .pcard__back,
.pcard.is-open .pcard__back { transform: translateY(0); }

/* ---------- Time calculator ---------- */
.calc__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.calc__lead { color: var(--text-dim); margin-top: 0.9rem; max-width: 44ch; }
.calc__notes { list-style: none; padding: 0; margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; }
.calc__notes li { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.92rem; }
.calc__notes i { color: var(--accent); font-size: 1.1rem; }

.calc__card {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calc__bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.calc__body { padding: clamp(1.4rem, 3vw, 2rem); }
.calc__field { display: block; margin-bottom: 1.3rem; }
.calc__q { display: block; font-size: 0.98rem; color: var(--text-dim); margin-bottom: 0.6rem; }
.calc__q b { color: var(--text); font-family: var(--font-mono); }

/* Range slider */
.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--btn-bg);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--glow);
  transition: transform 0.15s var(--ease);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--btn-bg);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--glow);
}
.range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.calc__out {
  margin: 1.6rem 0 1.2rem;
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius-sm);
  background: var(--glow-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.calc__big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.calc__big small { font-family: var(--font-body); font-weight: 400; font-size: 0.95rem; color: var(--muted); letter-spacing: 0; }
.calc__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--text-dim);
}
.calc__sub b { color: var(--text); font-family: var(--font-mono); }
.calc__money b { color: var(--accent); }
.calc__money.is-hidden { display: none; }
.calc__cta-line { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.9rem; text-align: center; }

/* ---------- FAQ ---------- */
.faq__list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}
.faq__list .reveal:nth-child(2) { --d: 1; }
.faq__list .reveal:nth-child(3) { --d: 2; }
.faq__list .reveal:nth-child(4) { --d: 3; }
.faq__list .reveal:nth-child(5) { --d: 4; }
.faq__list .reveal:nth-child(6) { --d: 5; }
.faq__item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}
.faq__item[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-2)); }
.faq__item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.faq__item summary i {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.faq__item[open] summary i { transform: rotate(45deg); }
.faq__a { padding: 0 1.3rem 1.25rem; }
.faq__a p { color: var(--text-dim); max-width: 68ch; }
html.js .faq__item[open] .faq__a { animation: faq-open 0.4s var(--ease); }
@keyframes faq-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Magnetic buttons get a snappier transform transition */
.magnetic { transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease); will-change: transform; }

/* ---------- Reveal on scroll ----------
   Hidden state only applies when JS is active (html.js), so content
   stays visible if the script fails to load.
   Variants change the entrance direction; .reveal--repeat re-animates
   on scroll out/in (handled in JS). */
.reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
html.js .reveal { opacity: 0; transform: translateY(26px); }
html.js .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* Entrance variants — all snap back to none via .is-in above */
html.js .reveal--left  { transform: translateX(-46px); }
html.js .reveal--right { transform: translateX(46px); }
html.js .reveal--up    { transform: translateY(58px); }
html.js .reveal--pop   { transform: translateY(22px) scale(0.93); }
html.js .reveal--blur  { filter: blur(12px); }
.reveal--pop { transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---------- Hero aurora (ambient color wash) ---------- */
.hero__aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}
.hero__aurora i:nth-child(1) {
  width: 46vmax; height: 46vmax;
  left: -12%; top: -18%;
  background: radial-gradient(circle, var(--aur1), transparent 62%);
  animation: aur-a 21s ease-in-out infinite alternate;
}
.hero__aurora i:nth-child(2) {
  width: 40vmax; height: 40vmax;
  right: -14%; top: -6%;
  background: radial-gradient(circle, var(--aur2), transparent 62%);
  animation: aur-b 26s ease-in-out infinite alternate;
}
.hero__aurora i:nth-child(3) {
  width: 36vmax; height: 36vmax;
  left: 24%; bottom: -30%;
  background: radial-gradient(circle, var(--aur3), transparent 62%);
  animation: aur-c 18s ease-in-out infinite alternate;
}
@keyframes aur-a { to { transform: translate(9%, 12%) scale(1.12); } }
@keyframes aur-b { to { transform: translate(-10%, 10%) scale(0.94); } }
@keyframes aur-c { to { transform: translate(6%, -12%) scale(1.08); } }

/* ---------- Section title gradient underline ---------- */
.section__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  margin-top: 0.6rem;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s var(--ease) 0.2s;
}
.reveal.is-in .section__title::after,
.section__title.reveal.is-in::after { transform: scaleX(1); }

/* ---------- Cursor spotlight on cards (fine pointers, set via JS) ---------- */
.fx-spot { position: relative; }
.fx-spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  background: radial-gradient(
    260px circle at var(--fx-x, 50%) var(--fx-y, 50%),
    color-mix(in srgb, var(--accent) 13%, transparent),
    transparent 65%
  );
  z-index: 2;
}
.fx-spot:hover::after { opacity: 1; }

/* ---------- Themed scrollbar ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 30%, var(--surface-2));
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }

/* ---------- Automation checkup (diagnostic quiz) ---------- */
.checkup__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.checkup__lead { color: var(--text-dim); margin-top: 0.9rem; max-width: 46ch; }
.calc__bar .checkup__step { margin-left: auto; color: var(--muted); }
.checkup__progress {
  height: 4px;
  background: var(--surface-2);
}
.checkup__progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
  transition: width 0.5s var(--ease);
}
.checkup__body { padding: clamp(1.3rem, 3vw, 1.9rem); }

.qstep { display: none; border: none; margin: 0; padding: 0; min-inline-size: auto; }
.qstep.is-active { display: block; animation: q-in 0.45s var(--ease); }
@keyframes q-in {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
.qstep__q {
  display: block;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 1rem;
}
.qstep__hint {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.3rem;
  font-weight: 400;
}
.qopts { display: grid; gap: 0.55rem; }
.qopt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-dim);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.qopt i { font-size: 1.25rem; color: var(--accent); flex-shrink: 0; }
.qopt:hover { border-color: var(--accent); transform: translateX(4px); color: var(--text); }
.qopt::after {
  content: "";
  margin-left: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.qopt.is-picked {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 18px -8px var(--glow);
}
.qopt.is-picked::after {
  content: "✓";
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-fg);
}
.qnote {
  width: 100%;
  min-height: 96px;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  resize: vertical;
}
.qnote:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}
.qback {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  transition: color 0.2s var(--ease);
}
.qback:hover { color: var(--text); }

/* Checkup result */
.qresult { display: none; }
.qresult.is-show { display: block; animation: q-in 0.5s var(--ease); }
.qresult__top {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.1rem;
}
.qring { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.qring svg { width: 100%; height: 100%; }
.qring circle { fill: none; stroke-width: 9; }
.qring__bg { stroke: var(--surface-2); }
.qring__fg {
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.qring .qg1 { stop-color: var(--accent); }
.qring .qg2 { stop-color: var(--accent-vio); }
.qring__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 42px;
}
.qring__num b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.qring__num small { font-size: 0.72rem; color: var(--muted); margin-left: 2px; }
.qresult__band {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: var(--glow-soft);
  margin-bottom: 0.55rem;
}
.qresult__meta p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.93rem;
  margin-top: 0.3rem;
}
.qresult__meta p i { color: var(--accent); }
.qresult__meta p b { color: var(--text); font-weight: 600; }
.qbuild {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--glow-soft);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.qbuild:hover { transform: translateY(-2px); border-color: var(--accent); }
.qbuild__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.qbuild__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0.15rem 0;
}
.qbuild__line { display: block; font-size: 0.85rem; color: var(--text-dim); }
.qbuild > i { font-size: 1.3rem; color: var(--accent); flex-shrink: 0; }
.qmoves {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.5rem;
}
.qmoves li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.qmoves i { color: var(--accent); font-size: 1.05rem; margin-top: 2px; flex-shrink: 0; }
.qcta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.qhint { font-size: 0.82rem; color: var(--muted); margin-top: 0.75rem; }
.qfoot {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}
.qlink {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.qlink:hover { color: var(--accent); }

/* ---------- Nav collapses earlier now that it holds 9 links ---------- */
@media (max-width: 1120px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__mobile.is-open { display: flex; }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__cta { display: none; }
  .nav__mobile.is-open { display: flex; }

  .hero__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__canvas { max-width: 460px; }

  .stats__inner { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
  .stat:nth-child(3)::before, .stat + .stat::before { display: none; }

  .project,
  .project--reverse { grid-template-columns: 1fr; gap: 1.5rem; }
  .project--reverse .project__info { order: 1; }
  .project--reverse .project__canvas { order: 2; }
  .project--wide .project__info { grid-template-columns: 1fr; gap: 0.5rem; }
  .project--wide .project__title,
  .project--wide .project__problem,
  .project--wide .project__desc { grid-column: 1; }

  .pain__grid { grid-template-columns: repeat(2, 1fr); }
  .calc__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .checkup__grid { grid-template-columns: 1fr; gap: 2.5rem; }

  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .book__grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  :root { --nav-h: 64px; }
  .stats__inner { grid-template-columns: 1fr 1fr; }
  .creds { grid-template-columns: 1fr; }
  .about__id { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .about__photo { width: 96px; }
  .project__canvas img { height: 220px; }
  .project__canvas--tall img { height: 300px; }
  .project--wide .project__desc { grid-column: 1; }
  .pain__grid { grid-template-columns: 1fr; }
  .qresult__top { flex-direction: column; align-items: flex-start; }
  .qcta .btn { width: 100%; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__base { flex-direction: column; }
  .hero__title { font-size: clamp(2.1rem, 9vw, 3rem); }
}

/* ---------- Reduced motion ----------
   NOTE: This portfolio's animations (scroll reveals, count-ups, subtle ambient
   motion) are a core, explicitly-requested part of the experience, so they are
   intentionally kept ON even when the OS reports "reduce motion" — the owner's
   own machine has that setting enabled and the motion must still be visible.
   The motion is deliberately gentle (short fades/slides, no large parallax or
   flashing), which keeps it comfortable. The only concession we keep is
   instant (non-smooth) anchor jumps for reduced-motion users. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}

/* ---------- Assistant chat widget ---------- */
.chatfab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 240;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  box-shadow: 0 10px 30px -8px var(--glow);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fab-in 0.6s var(--ease) 1s backwards;
}
.chatfab:hover { transform: translateY(-3px) scale(1.05); }
.chatfab:active { transform: scale(0.95); }
@keyframes fab-in { from { opacity: 0; transform: translateY(16px) scale(0.6); } }
.chatfab i { transition: transform 0.3s var(--ease); }
.chatfab.is-open i { transform: rotate(90deg) scale(0.9); }
.chatfab__ping {
  position: absolute;
  top: 4px; right: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #ffd166;
  border: 2px solid var(--bg);
}
.chatfab.is-open .chatfab__ping { display: none; }

.chat__tip {
  position: fixed;
  right: 92px; bottom: 32px;
  z-index: 239;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.5rem 0.8rem;
  border-radius: 12px 12px 4px 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}
.chat__tip.is-show { opacity: 1; transform: none; }

.chat {
  position: fixed;
  right: 22px; bottom: 92px;
  z-index: 250;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  pointer-events: none;
}
.chat[hidden] { display: none; }
.chat.is-open { opacity: 1; transform: none; pointer-events: auto; }

.chat__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
}
.chat__avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.chat__head b { font-family: var(--font-display); font-size: 0.98rem; display: block; color: var(--text); }
.chat__head small { color: var(--muted); font-size: 0.72rem; display: flex; align-items: center; gap: 0.35rem; }
.chat__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
}
.chat__close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.15rem;
  padding: 0.35rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.chat__close:hover { color: var(--text); }

.chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.msg {
  max-width: 86%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-line;
  animation: msg-in 0.3s var(--ease);
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg--bot {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text-dim);
  border-bottom-left-radius: 4px;
}
.msg--user {
  align-self: flex-end;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-bottom-right-radius: 4px;
}
.msg--typing { display: flex; gap: 4px; padding: 0.8rem 0.9rem; }
.msg--typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  font-style: normal;
  animation: tdot 1.1s infinite;
}
.msg--typing i:nth-child(2) { animation-delay: 0.15s; }
.msg--typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot {
  0%, 60%, 100% { transform: none; opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chat__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-self: flex-start;
  max-width: 90%;
  animation: msg-in 0.3s var(--ease);
}
.chat__act {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--glow-soft);
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.chat__act:hover { background: var(--btn-bg); color: var(--btn-fg); transform: translateY(-1px); }

.chat__chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}
.chat__chips::-webkit-scrollbar { display: none; }
.chat__chip {
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chat__chip:hover { border-color: var(--accent); color: var(--accent); }

.chat__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border-top: 1px solid var(--line);
}
#chatInput {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
#chatInput:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat__send {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.chat__send:hover { transform: scale(1.07); }

@media (max-width: 560px) {
  .chatfab { right: 14px; bottom: 14px; }
  .chat { right: 12px; bottom: 82px; }
  .chat__tip { right: 84px; bottom: 24px; }
  #chatInput { font-size: 16px; }
}

/* ---------- Checkup starter plan (proposal preview) ---------- */
.qplan {
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 12px;
}
.qplan__steps {
  list-style: none;
  padding: 0;
  margin: 0.55rem 0 0;
  display: grid;
  gap: 0.5rem;
  counter-reset: qp;
}
.qplan__steps li {
  font-size: 0.88rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}
.qplan__steps li::before {
  counter-increment: qp;
  content: counter(qp, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 6px;
  padding: 0.14rem 0.4rem;
  flex-shrink: 0;
}
.qplan__steps b { color: var(--text); }
