/* ═══════════════════════════════════════════════════════════════════════════
   briandom.dev — styles
   Colors are tokens on :root; light theme overrides them below.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0c10;
  --bg-2: #101218;
  --surface: #14161d;
  --surface-2: #1a1d26;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eceef3;
  --text-2: #a4a9b6;
  --text-3: #6d7280;
  --accent: #bd3f0b;
  --accent-2: #bde2f0;
  --accent-ink: #ffffff;
  --grid-dot: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --grain-opacity: 0.05;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-2: #efede7;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --line: rgba(17, 18, 22, 0.08);
  --line-strong: rgba(17, 18, 22, 0.16);
  --text: #121317;
  --text-2: #4c505b;
  --text-3: #868a94;
  --accent: #bd3f0b;
  --accent-2: #3683a1;
  --accent-ink: #ffffff;
  --grid-dot: rgba(17, 18, 22, 0.09);
  --shadow: 0 1px 2px rgba(17,18,22,.04), 0 20px 40px -24px rgba(17, 18, 22, 0.25);
  --grain-opacity: 0.03;
  color-scheme: light;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
h1 em, h2 em {
  font-family: "Michroma", var(--font-sans);
  font-style: normal; font-weight: 400; letter-spacing: 0;
  color: var(--accent);
  padding-right: .06em;
}

/* Pop words: thin corner brackets that hug the letters (positions set in main.js) */
h1 em, h2 em { position: relative; display: inline-block; --gap: .14em; }
h1 em::before, h1 em::after, h2 em::before, h2 em::after {
  content: ""; position: absolute; width: .3em; height: .3em; pointer-events: none;
  border: 1.5px solid var(--accent-2); opacity: .75;
  animation: pop-breathe 4s ease-in-out infinite;
}
h1 em::before, h2 em::before {
  top: calc(var(--ink-t, 0px) - var(--gap)); left: calc(var(--ink-l, 0px) - var(--gap));
  border-right: 0; border-bottom: 0; --dx: -3px; --dy: -3px;
}
h1 em::after, h2 em::after {
  bottom: calc(var(--ink-b, 0px) - var(--gap)); right: calc(var(--ink-r, 0px) - var(--gap));
  border-left: 0; border-top: 0; --dx: 3px; --dy: 3px;
}
@keyframes pop-breathe { 0%, 100% { transform: translate(0, 0); opacity: .35; } 50% { transform: translate(var(--dx), var(--dy)); opacity: .85; } }
@media (prefers-reduced-motion: reduce) { h1 em::before, h1 em::after, h2 em::before, h2 em::after { animation: none; } }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: var(--grain-opacity);
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn:hover svg { transform: translateX(3px); }
.btn svg { transition: transform .25s var(--ease); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); box-shadow: none; }
.btn--small { height: 36px; padding: 0 16px; font-size: 14px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--text-2);
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
:root[data-theme="dark"] .i-moon, :root:not([data-theme]) .i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }

.label, .eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }

/* ───────── Nav ───────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
}
.nav__logo { font-weight: 700; font-size: 22px; letter-spacing: -0.05em; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.nav__links a { padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--text-2); transition: color .2s, background-color .2s; }
.nav__links a:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.nav__links a.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.nav__actions { display: flex; gap: 10px; align-items: center; }

/* ───────── Hero ───────── */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 100px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 70%) var(--my, 30%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(800px circle at 85% 10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    radial-gradient(700px circle at 0% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero__title { font-size: clamp(44px, 7.2vw, 96px); margin: 24px 0 24px; }
.hero__sub { font-size: clamp(17px, 1.5vw, 20px); color: var(--text-2); max-width: 34em; margin: 0 0 36px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__portrait { position: relative; justify-self: center; width: min(380px, 80vw); aspect-ratio: 1; }
.portrait { position: absolute; inset: 12%; border-radius: 50%; display: grid; place-items: center; }
.portrait img, .portrait .initials {
  position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.portrait .initials {
  display: grid; place-items: center; font-weight: 600; letter-spacing: -0.06em;
  font-size: clamp(56px, 9vw, 96px);
  background: radial-gradient(circle at 30% 25%, var(--surface-2), var(--surface));
}
.portrait__ring {
  position: absolute; inset: -14px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), transparent 55%, var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  animation: spin 14s linear infinite;
}
.portrait::after {
  content: ""; position: absolute; inset: -46px; border-radius: 50%; border: 1px dashed var(--line-strong); opacity: .6;
}
@keyframes spin { to { transform: rotate(360deg); } }
.floating-tag {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
.floating-tag span { color: var(--accent); }
.floating-tag--a { top: 6%; left: -6%; }
.floating-tag--b { top: 46%; right: -10%; animation-delay: -2s; }
.floating-tag--b span { color: #ff8a6b; }
.floating-tag--c { bottom: 4%; left: 6%; animation-delay: -4s; }
.floating-tag--c span { color: #f28c38; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.marquee {
  position: relative; margin-top: clamp(48px, 8vh, 96px); border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee__track span { padding: 0 28px; font-size: 15px; color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 56px; }
.marquee__track span::after { content: "✦"; color: var(--text-3); font-size: 10px; margin-left: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ───────── Sections ───────── */
.section { padding: clamp(80px, 12vw, 160px) 0; position: relative; }
.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(36px, 5.4vw, 68px); margin-top: 18px; }
.section-head--row { display: flex; align-items: end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.section-head__aside { max-width: 26em; color: var(--text-2); margin: 0; }

/* About */
.about__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about__text p { color: var(--text-2); font-size: 17px; margin: 0 0 1.1em; }
.about__text .lead { color: var(--text); font-size: clamp(20px, 2vw, 24px); line-height: 1.45; letter-spacing: -0.015em; }
.about__text .lead em { color: var(--accent); }

.stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.stat { background: var(--surface); padding: 28px 24px; display: flex; flex-wrap: wrap; align-items: baseline; }
.stat__num { font-size: clamp(40px, 4.4vw, 56px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__plus { font-size: 28px; color: var(--accent); font-weight: 500; margin-left: 2px; }
.stat__label { flex-basis: 100%; margin-top: 10px; font-size: 13px; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }

.process { margin-top: clamp(56px, 8vw, 96px); }
.process__title { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-bottom: 20px; }
.process__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: step; }
.process__steps li {
  position: relative; padding: 22px 20px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  transition: transform .35s var(--ease), border-color .35s;
}
.process__steps li:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.process__steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 34px; right: -13px; width: 14px; height: 1px; background: var(--line-strong);
}
.process__n { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.process__steps strong { display: block; margin: 10px 0 6px; font-weight: 600; letter-spacing: -0.01em; }
.process__steps p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* Interests bento */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card {
  position: relative; padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  overflow: hidden; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end;
  transition: border-color .35s, transform .35s var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card--wide { grid-column: span 2; }
.card__icon { position: absolute; top: 24px; left: 28px; font-size: 22px; color: var(--accent); }
.card h3 { font-size: 22px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-2); max-width: 36em; }
.card--accent { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 60%), var(--surface); }
.card--accent .card__icon { color: var(--accent-2); }

/* Projects */
.project { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(20px, 3vw, 36px); border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--surface); transition: border-color .35s; }
.project:hover { border-color: var(--line-strong); }
.project__art { display: block; border-radius: calc(var(--radius) - 6px); background: var(--bg); border: 1px solid var(--line); background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }
.project__art svg { display: block; width: 100%; height: auto; transition: transform .6s var(--ease); }
.project__art:hover svg { transform: scale(1.03); }
.project__flow { animation: project-flow 1.4s linear infinite; }
.project__pulse { transform-origin: 260px 180px; animation: project-pulse 4s var(--ease) infinite; }
@keyframes project-flow { to { stroke-dashoffset: -20; } }
@keyframes project-pulse { 0%, 100% { opacity: .25; transform: scale(1); } 50% { opacity: .7; transform: scale(1.08); } }
.project__tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.project__body h3 { font-size: clamp(28px, 3.4vw, 40px); margin: 10px 0 12px; letter-spacing: -.02em; }
.project__body p { color: var(--text-2); margin: 0 0 20px; max-width: 40em; }
.project__chips { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.project__chips li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); background: var(--surface-2); }
@media (max-width: 860px) { .project { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .project__flow, .project__pulse { animation: none; } }

/* What's next */
.next__list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.next__list li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--line); transition: padding-left .35s var(--ease); }
.next__list li:hover { padding-left: 12px; }
.next__k { color: var(--accent); font-size: 22px; line-height: 1.3; }
.next__list strong { display: block; font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; }
.next__list p { margin: 6px 0 0; color: var(--text-2); }

/* Contact */
.contact { text-align: center; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px circle at 50% 60%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.contact__inner { position: relative; }
.contact__title { font-size: clamp(40px, 6.4vw, 84px); margin: 20px auto 40px; max-width: 14em; }
.contact__mail {
  display: inline-flex; align-items: center; gap: 12px; font-size: clamp(22px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.03em;
  padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); transition: border-color .3s, gap .3s var(--ease); word-break: break-all;
}
.contact__mail:hover { border-color: var(--accent); gap: 18px; }
.contact__mail svg { flex-shrink: 0; color: var(--accent); }
.contact__links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.contact__links a { padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--text-2); transition: color .2s, border-color .2s, background-color .2s; }
.contact__links a:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }

.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--text-3); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Constellation (project map)
   ═══════════════════════════════════════════════════════════════════════════ */
.section--work { padding-bottom: 0; }
.cx {
  position: relative; margin: 0 var(--gutter);
  height: min(86vh, 900px); min-height: 560px;
  border: 1px solid var(--line); border-radius: 28px; overflow: hidden; overflow: clip;
  background: var(--bg-2);
  --k: 1;
}
.cx.is-max, .cx:fullscreen { position: fixed; inset: 0; margin: 0; height: 100%; border-radius: 0; z-index: 90; border: 0; }
.cx__viewport {
  position: absolute; inset: 0; cursor: grab; outline: none;
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.cx.is-engaged .cx__viewport { touch-action: none; }
.cx.is-dragging .cx__viewport, .cx.is-dragging .cx-node { cursor: grabbing; }
.cx::after { /* vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, color-mix(in srgb, var(--bg-2) 85%, transparent) 100%);
}
.cx__world { position: absolute; top: 0; left: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.cx__edges { position: absolute; overflow: visible; width: 1px; height: 1px; left: 0; top: 0; }
.cx__nodes { position: absolute; left: 0; top: 0; }

.cx-edge {
  fill: none; stroke: var(--c); stroke-width: 1.5; opacity: .45;
  vector-effect: non-scaling-stroke; transition: opacity .4s;
}
.cx-edge--d1 { stroke-width: 2; opacity: .55; }
.cx-edge--d3, .cx-edge--d4 { stroke-dasharray: 4 5; opacity: .4; }
.cx-edge.is-leaving { opacity: 0; }

/* Shared node */
.cx-node {
  position: absolute; left: 0; top: 0; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  text-align: left; color: var(--text); -webkit-tap-highlight-color: transparent;
}
.cx-node > * { transition: opacity .45s var(--ease), transform .45s var(--ease), border-color .25s, box-shadow .25s, background-color .25s; }
.cx-node.is-entering > *, .cx-node.is-leaving > * { opacity: 0; transform: scale(.6); }
.cx-node.is-leaving { pointer-events: none; }
.cx-node:focus-visible { outline: none; }
.cx-node:focus-visible > * { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--c); }

/* Root */
.cx-node--root { display: grid; justify-items: center; gap: 12px; }
.cx-node--root > .cx-root__pulse { transition: none; }
.cx-root__face {
  position: relative; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 60px -6px color-mix(in srgb, var(--accent) 50%, transparent);
}
.cx-root__face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.cx-node--root.has-photo .cx-root__face img { opacity: 1; }
.cx-node--root.has-photo .cx-root__initials { opacity: 0; }
.cx-root__initials { font-size: 44px; font-weight: 600; letter-spacing: -0.06em; }
.cx-root__label {
  font-size: 13px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-2);
  padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.cx-root__pulse {
  position: absolute; top: 66px; left: 50%; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%;
  border: 1px solid var(--accent); opacity: 0; animation: pulse 5s var(--ease) infinite; pointer-events: none;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.9); opacity: 0; } }
.cx-node--root:hover .cx-root__face { transform: scale(1.04); }

/* Category & group pills */
.cx-pill {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 7px 16px 7px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cx-pill__icon {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: 14px;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c);
}
.cx-pill__label { font-weight: 600; font-size: 16px; letter-spacing: -0.015em; }
.cx-pill__count {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line);
}
.cx-node--category .cx-pill { padding: 8px 20px 8px 9px; }
.cx-node--category .cx-pill__icon { width: 32px; height: 32px; font-size: 16px; }
.cx-node--category .cx-pill__label { font-size: 18px; }
.cx-node--group .cx-pill { padding: 5px 14px 5px 6px; }
.cx-node--group .cx-pill__icon { width: 24px; height: 24px; font-size: 12px; }
.cx-node--group .cx-pill__label { font-size: 15px; }
.cx-node:hover .cx-pill, .cx-node.is-open .cx-pill {
  border-color: var(--c);
  box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--c) 14%, transparent), 0 0 40px -10px var(--c);
}
.cx-node.is-open .cx-pill__count { background: var(--c); color: var(--accent-ink); border-color: transparent; }
:root[data-theme="light"] .cx-node.is-open .cx-pill__count { color: #fff; }

/* Project card */
.cx-card {
  display: flex; flex-direction: column; gap: 6px; width: 240px; padding: 16px 18px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.cx-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--c), transparent); }
.cx-card__meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.cx-card__title { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; line-height: 1.25; }
.cx-card__sum { font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cx-card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--c); font-weight: 500; }
.cx-card__arrow { transition: transform .25s var(--ease); }
.cx-node--project:hover .cx-card, .cx-node--project.is-open .cx-card { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); box-shadow: var(--shadow), 0 0 50px -16px var(--c); }
.cx-node--project:hover .cx-card__arrow { transform: translateX(4px); }

/* Note */
.cx-note {
  display: block; width: 220px; padding: 14px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--c) 7%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--c) 45%, var(--line));
}
.cx-note__label { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--c); margin-bottom: 6px; }
.cx-note__text { font-family: var(--font-serif); font-size: 18px; line-height: 1.3; color: var(--text); }

/* Media */
.cx-media { display: block; width: 220px; }
.cx-media__frame {
  display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.cx-media__frame img { width: 100%; height: 100%; object-fit: cover; }
.cx-media__cap { display: block; margin-top: 8px; font-size: 12px; color: var(--text-2); text-align: center; }
.cx-node--media:hover .cx-media__frame { border-color: var(--c); transform: translateY(-2px); }
.cx-node--media .cx-media__frame { transition: transform .3s var(--ease), border-color .25s; }

/* Placeholder "screenshots" — replaced as soon as you add real images */
.mock {
  --m: var(--c, var(--accent));
  position: relative; width: 100%; height: 100%; display: grid; gap: 6%; padding: 7%;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.mock i { display: block; border-radius: 4px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.mock--dashboard { grid-template-columns: repeat(4, 1fr); grid-template-rows: 18% 1fr 1fr; }
.mock--dashboard i:nth-child(-n+4) { background: color-mix(in srgb, var(--m) 30%, transparent); }
.mock--dashboard i:nth-child(5) { grid-column: span 3; background:
  linear-gradient(to top, color-mix(in srgb, var(--m) 55%, transparent) 0 40%, transparent 40%) 8% 100% / 10% 100% no-repeat,
  linear-gradient(to top, color-mix(in srgb, var(--m) 55%, transparent) 0 70%, transparent 70%) 26% 100% / 10% 100% no-repeat,
  linear-gradient(to top, color-mix(in srgb, var(--m) 55%, transparent) 0 55%, transparent 55%) 44% 100% / 10% 100% no-repeat,
  linear-gradient(to top, color-mix(in srgb, var(--m) 55%, transparent) 0 85%, transparent 85%) 62% 100% / 10% 100% no-repeat,
  linear-gradient(to top, color-mix(in srgb, var(--m) 55%, transparent) 0 65%, transparent 65%) 80% 100% / 10% 100% no-repeat,
  color-mix(in srgb, var(--text) 5%, transparent); }
.mock--dashboard i:nth-child(6) { grid-row: span 2; border-radius: 50%; aspect-ratio: 1; align-self: center;
  background: conic-gradient(var(--m) 0 62%, color-mix(in srgb, var(--text) 10%, transparent) 62%);
  -webkit-mask: radial-gradient(circle, transparent 45%, #000 46%); mask: radial-gradient(circle, transparent 45%, #000 46%); }
.mock--dashboard i:nth-child(7) { grid-column: span 3; }
.mock--dashboard i:nth-child(8) { display: none; }
.mock--app { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 14% 1fr 1fr 18%; padding-inline: 30%; }
.mock--app { background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.mock--app i:nth-child(1) { grid-column: span 3; background: color-mix(in srgb, var(--m) 35%, transparent); }
.mock--app i:nth-child(2) { grid-column: span 3; background: linear-gradient(135deg, color-mix(in srgb, var(--m) 50%, transparent), color-mix(in srgb, var(--m) 10%, transparent)); }
.mock--app i:nth-child(3), .mock--app i:nth-child(4), .mock--app i:nth-child(5) { }
.mock--app i:nth-child(6), .mock--app i:nth-child(7), .mock--app i:nth-child(8) { border-radius: 50%; aspect-ratio: 1; justify-self: center; height: 100%; }
.mock--flow { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; align-items: center; }
.mock--flow i { height: 34%; border: 1px solid color-mix(in srgb, var(--m) 50%, transparent); background: color-mix(in srgb, var(--m) 14%, transparent); position: relative; }
.mock--flow i:nth-child(n+5) { opacity: .5; }
.mock--flow::after { content: ""; position: absolute; left: 10%; right: 10%; top: 31%; height: 1px; background: color-mix(in srgb, var(--m) 50%, transparent); }
.mock--brand { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mock--brand i:nth-child(1) { grid-column: span 2; grid-row: span 2; border-radius: 50%; aspect-ratio: 1; align-self: center; justify-self: center; height: 90%;
  background: conic-gradient(from 200deg, var(--m), color-mix(in srgb, var(--m) 20%, transparent), var(--m)); }
.mock--brand i:nth-child(2) { background: var(--m); }
.mock--brand i:nth-child(3) { background: color-mix(in srgb, var(--m) 50%, transparent); }
.mock--brand i:nth-child(4) { background: var(--text); opacity: .8; }
.mock--brand i:nth-child(5) { background: color-mix(in srgb, var(--text) 20%, transparent); }
.mock--brand i:nth-child(n+6) { display: none; }

/* HUD */
.cx__hud { position: absolute; left: 16px; right: 16px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.cx__hud > * { pointer-events: auto; }
.cx__hud--top { top: 16px; }
.cx__hud--bottom { bottom: 16px; }
.cx__crumbs, .cx__controls, .cx__hint {
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.cx__crumbs button, .cx__controls button {
  height: 32px; min-width: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-2); white-space: nowrap; display: grid; place-items: center;
  transition: background-color .2s, color .2s;
}
.cx__controls button:has(svg) { padding: 0; width: 32px; }
.cx__crumbs button:hover, .cx__controls button:hover { background: var(--surface-2); color: var(--text); }
.cx__crumbs button[aria-current] { color: var(--text); font-weight: 500; }
.cx__crumb-sep { color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.cx__crumbs button { flex-shrink: 0; }
.cx__controls [data-cx="keep"] { display: inline-flex; gap: 8px; padding: 0 12px 0 8px; }
.cx-switch { position: relative; width: 26px; height: 15px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s; flex-shrink: 0; }
.cx-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background-color .2s; }
[data-cx="keep"][aria-checked="true"] { color: var(--text); }
[data-cx="keep"][aria-checked="true"] .cx-switch { background: var(--accent); }
[data-cx="keep"][aria-checked="true"] .cx-switch::after { transform: translateX(11px); background: #fff; }
.cx__sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
.cx__hint { padding: 8px 14px; font-size: 12px; color: var(--text-3); gap: 6px; transition: color .3s, border-color .3s; white-space: nowrap; }
.kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); }
.cx.show-engage-hint .cx__hint { color: var(--text); border-color: var(--accent); }
.cx.show-engage-hint .cx__hint::before { content: "Click the map first, then "; }

/* Detail panel */
.cx__panel {
  position: absolute; z-index: 30; top: 12px; right: 12px; bottom: 12px; width: min(420px, 36vw);
  border-radius: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
  transform: translateX(calc(100% + 24px)); transition: transform .5s var(--ease); visibility: hidden;
}
.cx.panel-open .cx__panel { transform: none; visibility: visible; }
.cx__hud { transition: right .5s var(--ease); }
@media (min-width: 861px) { .cx.panel-open .cx__hud { right: calc(min(420px, 36vw) + 28px); } .cx.panel-open .cx__hint { display: none; } }
.cx__panel-body { height: 100%; overflow-y: auto; padding: 28px 26px 32px; overscroll-behavior: contain; }
.cx__panel-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text-2); z-index: 1;
}
.cx__panel-close:hover { color: var(--text); border-color: var(--line-strong); }
.cx-p__path { margin: 0 40px 10px 0; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.cx-p__title { font-size: 28px; line-height: 1.1; margin-right: 32px; }
.cx-p__meta { margin: 8px 0 0; color: var(--text-3); font-size: 13px; }
.cx-p__sum { font-family: var(--font-serif); font-size: 22px; line-height: 1.3; color: var(--text); margin: 20px 0; }
.cx__panel-body p { color: var(--text-2); font-size: 15px; }
.cx__panel-body .cx-p__sum { color: var(--text); font-size: 22px; line-height: 1.3; }
.cx-p__learned { margin: 20px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.cx-p__learned span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.cx-p__learned p { margin: 6px 0 0; }
.cx-gal { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 22px 0; }
.cx-gal__item { display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.cx-gal__item img, .cx-gal__item .mock { height: auto; aspect-ratio: 16/10; width: 100%; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }
.cx-gal__item span { display: block; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.cx-p__tags { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cx-p__tags li { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); }
.cx-p__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cx-p__links a { font-size: 14px; font-weight: 500; color: var(--accent); }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(1100px, 92vw); width: 100%; color: var(--text);
}
.lightbox::backdrop { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lightbox[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.lightbox figure { margin: 0; }
.lightbox__media img, .lightbox__media .mock { width: 100%; height: auto; aspect-ratio: 16/10; object-fit: contain; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.lightbox__media img { aspect-ratio: auto; max-height: 82vh; }
.lightbox figcaption { text-align: center; margin-top: 12px; color: var(--text-2); font-size: 14px; }
.lightbox__close { position: absolute; top: 12px; right: 12px; z-index: 1; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; }

/* ───────── Responsive ───────── */
@media (max-width: 960px) {
  .hero__inner, .about__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; width: min(260px, 64vw); margin-top: 8px; }
  .floating-tag--b { right: -14%; }
  .process__steps { grid-template-columns: 1fr 1fr; }
  .process__steps li::after { display: none; }
  .bento { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .cx__panel {
    top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 62%;
    transform: translateY(calc(100% + 24px));
  }
  .cx__hint { display: none; }
  .cx.panel-open .cx__hud--bottom { opacity: 0; pointer-events: none; }
  .cx__hud--bottom { justify-content: center; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .hero { padding-top: 88px; min-height: auto; }
  .hero__title { margin-top: 18px; }
  .process__steps, .bento { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .card { min-height: 180px; }
  .cx { margin: 0 8px; border-radius: 20px; height: 78svh; min-height: 520px; }
  .cx__controls [data-cx="collapse"] { display: none; }
  .cx__hud--top { right: 16px; }
  .cx__crumbs { max-width: calc(100vw - 48px); }
  .next__list li { grid-template-columns: 32px 1fr; }
}

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