:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --a1: #7c5cff;
  --a2: #00d4c0;
  --a3: #ff5fb4;
  --grad: linear-gradient(100deg, var(--a1), var(--a2) 55%, var(--a3));
  --radius: 20px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="dark"] {
  --bg: #07070c;
  --bg2: #0d0d16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #ececf4;
  --muted: #8d8da6;
  --particle: 180, 170, 255;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f6fb;
  --bg2: #ffffff;
  --surface: rgba(20, 20, 60, 0.035);
  --surface-2: rgba(20, 20, 60, 0.07);
  --border: rgba(20, 20, 60, 0.1);
  --text: #12121e;
  --muted: #5d5d78;
  --a2: #00a596;
  --particle: 90, 70, 220;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(60rem 40rem at 85% -10%, color-mix(in srgb, var(--a1) 18%, transparent), transparent 60%),
    radial-gradient(50rem 30rem at -10% 40%, color-mix(in srgb, var(--a2) 10%, transparent), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--font-mono); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--bg2); padding: 0.5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--a2); outline-offset: 3px; border-radius: 6px; }
kbd { font-family: var(--font-mono); font-size: 0.72rem; padding: 0.1rem 0.35rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }

.cursor-glow {
  position: fixed; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--a1) 14%, transparent), transparent 65%);
  transform: translate(-50%, -50%); left: var(--mx, -999px); top: var(--my, -999px);
  transition: opacity 0.3s;
}

/* NAV */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(var(--maxw), calc(100% - 28px));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0.8rem 0.6rem 1.2rem;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--border); border-radius: 999px;
}
.logo { font: 700 1.35rem var(--font-display); letter-spacing: -0.04em; display: flex; align-items: center; gap: 2px; }
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a { font-size: 0.88rem; color: var(--muted); padding: 0.4rem 0.8rem; border-radius: 999px; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; gap: 0.4rem; align-items: center; }
.kbd-btn { display: flex; gap: 3px; padding: 0.35rem 0.5rem; border-radius: 999px; }
.kbd-btn:hover kbd { border-color: var(--a1); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
[data-theme="dark"] .sun, [data-theme="light"] .moon { display: none; }

.caret { display: inline-block; width: 0.55em; height: 1.05em; background: var(--a2); vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* HERO */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 7rem 1.5rem 4rem; overflow: hidden; }
#latent { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; width: min(var(--maxw), 100%); }
.eyebrow { font-size: 0.8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); backdrop-filter: blur(6px); }
.eyebrow b { color: var(--a2); font-weight: 500; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 0 0 var(--a2); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-title { font: 700 clamp(3.6rem, 13vw, 10.5rem) / 0.88 var(--font-display); letter-spacing: -0.055em; margin: 1.6rem 0 1.2rem; }
.hero-title .line { display: block; opacity: 0; transform: translateY(40px); animation: rise 1s var(--ease) forwards; }
.hero-title .line:nth-child(2) { padding-bottom: 0.14em; margin-bottom: -0.14em; animation-delay: 0.12s; background-size: 200% auto; animation: rise 1s var(--ease) 0.12s forwards, shimmer 8s linear infinite; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: 200% center; } }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--muted); max-width: 40ch; }
.prompt { margin-top: 1.4rem; font-size: clamp(0.95rem, 1.7vw, 1.15rem); min-height: 1.8em; }
.prompt-label { color: var(--a1); margin-right: 0.6rem; }
#stream .tok { opacity: 0; animation: tok 0.35s forwards; }
@keyframes tok { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 0.6rem 1.8rem; margin-top: 2.8rem; list-style: none; font-size: 0.82rem; color: var(--muted); }
.hero-facts b { color: var(--text); font-weight: 500; }
/* HERO PHOTO: framed portrait in the latent space */
.hero-photo { position: absolute; z-index: 1; right: max(1.5rem, calc((100% - var(--maxw)) / 2 + 1rem)); top: 50%; width: clamp(230px, 23vw, 340px); aspect-ratio: 4 / 5; translate: 0 -44%; opacity: 0; animation: rise 1.2s var(--ease) 0.35s forwards; }
.hero-photo::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(closest-side, color-mix(in srgb, var(--a1) 30%, transparent), transparent); filter: blur(20px); z-index: -2; }
.hero-photo::after { content: ""; position: absolute; inset: 0; translate: 18px 18px; border-radius: 26px; border: 1px solid color-mix(in srgb, var(--a2) 55%, transparent); z-index: -1; }
.hero-photo-ring { width: 100%; height: 100%; border-radius: 26px; padding: 3px; background: linear-gradient(135deg, var(--a1), var(--a2), var(--a3)); box-shadow: 0 40px 90px -40px var(--a1); }
.hero-photo-ring img { display: block; width: 100%; height: 100%; border-radius: 23px; object-fit: cover; object-position: 50% 30%; }
.hero-photo-tag { position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.85rem; font-size: 0.72rem; border-radius: 999px; color: var(--text); background: color-mix(in srgb, var(--bg2) 82%, transparent); border: 1px solid var(--border); backdrop-filter: blur(8px); white-space: nowrap; }
.scroll-hint { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translate(-50%, 6px); } }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.4rem; border-radius: 999px; font-weight: 500; font-size: 0.95rem; border: 1px solid var(--border); transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; position: relative; }
.btn.primary:hover { box-shadow: 0 10px 40px -10px var(--a1), 0 0 0 1px var(--a1); }
.btn.ghost { background: var(--surface); backdrop-filter: blur(6px); }
.btn.ghost:hover { background: var(--surface-2); }
.spark { display: inline-block; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SECTIONS */
.section { width: min(var(--maxw), calc(100% - 3rem)); margin: 0 auto; padding: 7rem 0 2rem; position: relative; z-index: 1; }
.section-head { max-width: 760px; margin-bottom: 3rem; }
.kicker { font-size: 0.78rem; color: var(--a2); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.8rem; }
h2 { font: 600 clamp(2rem, 4.6vw, 3.4rem) / 1.05 var(--font-display); letter-spacing: -0.035em; }
.lede { color: var(--muted); margin-top: 1rem; font-size: 1.06rem; max-width: 65ch; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* METRICS */
.brands { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); padding: 1.6rem 0 1.8rem; overflow: hidden; }
.brands-label { text-align: center; font-size: 0.82rem; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 1.4rem; padding: 0 1rem; }
.brands-label .grad { font-weight: 700; font-size: 1.05rem; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 3.2rem; padding: 0.4rem 1.6rem; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 1.6rem)); } }
.brand { display: flex; align-items: center; gap: 0.9rem; white-space: nowrap; }
.brand .logo-tile { width: 76px; height: 76px; padding: 11px; border-radius: 20px; }
.brand b { font: 600 1.35rem var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.2rem; }
.show { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); padding: 1.2rem 1.4rem 1.6rem; overflow: hidden; transition: border-color 0.3s, translate 0.3s var(--ease), box-shadow 0.3s; }
.show:hover { translate: 0 -4px; border-color: color-mix(in srgb, var(--a1) 45%, var(--border)); box-shadow: 0 24px 50px -30px var(--a1); }
.show h3 { font: 600 1.35rem var(--font-display); letter-spacing: -0.02em; margin-top: 1.2rem; }
.show p { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }
.viz { height: 170px; border-radius: 14px; background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--a1) 14%, transparent), transparent 70%), var(--surface); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.viz svg { width: 88%; height: auto; overflow: visible; }
.viz-llm { place-items: stretch; align-content: center; gap: 1.1rem; padding: 0 1.4rem; }
.chat-line { font-size: 0.95rem; color: var(--text); min-height: 1.4em; white-space: nowrap; overflow: hidden; }
.chat-line i { font-style: normal; color: var(--a2); margin-right: 0.5rem; font-weight: 700; }
.caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--a1); animation: blink 1s steps(1) infinite; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.tokens span { height: 10px; width: var(--w); border-radius: 6px; background: var(--grad); background-size: 300px 100%; opacity: 0.15; animation: stream 2.8s var(--ease) infinite; animation-delay: calc(var(--t) * 0.12s); }
@keyframes stream { 15%, 70% { opacity: 0.9; } 100% { opacity: 0.15; } }
.viz-net .edge { stroke: var(--border); stroke-width: 1.5; fill: none; }
.viz-net .packet { fill: var(--a2); filter: drop-shadow(0 0 4px var(--a2)); }
.viz-net .node { fill: var(--bg2); stroke: var(--a1); stroke-width: 2.5; animation: node 2.4s ease-in-out infinite; animation-delay: calc(var(--d) * 0.3s); }
@keyframes node { 50% { stroke: var(--a2); filter: drop-shadow(0 0 6px var(--a1)); } }
.viz-bars .bar { fill: color-mix(in srgb, var(--a1) 55%, var(--a2)); opacity: 0.85; transform-box: fill-box; transform-origin: bottom; animation: grow 3.2s var(--ease) infinite; animation-delay: calc(var(--d) * 0.12s); }
.viz-bars .bar:nth-child(n+5) { fill: color-mix(in srgb, var(--a2) 70%, var(--a1)); }
@keyframes grow { 0% { transform: scaleY(0.15); } 35%, 80% { transform: scaleY(1); } 100% { transform: scaleY(0.15); } }
.viz-bars .trend { fill: none; stroke: var(--a3); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: trend 3.2s var(--ease) infinite; }
@keyframes trend { 35%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }

/* WORK CARDS */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: 1rem; }
.card {
  position: relative; padding: 1.7rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); overflow: hidden; display: flex; flex-direction: column; gap: 0.9rem;
  transition: transform 0.4s var(--ease), border-color 0.3s, opacity 0.4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--x, 50%) var(--y, 50%), color-mix(in srgb, var(--a1) 16%, transparent), transparent 45%);
}
.card:hover { border-color: color-mix(in srgb, var(--a1) 50%, var(--border)); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card.featured { grid-column: span 2; }
.card.hide { display: none; }
.card-meta { font: 0.75rem var(--font-mono); color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; }
.card h3 { font: 600 1.35rem / 1.2 var(--font-display); letter-spacing: -0.02em; }
.card.featured h3 { font-size: 1.75rem; }
.card p { color: var(--muted); font-size: 0.94rem; }
.impact { margin-top: auto; padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.88rem; background: var(--surface-2); border-left: 2px solid var(--a2); }
.impact ul { list-style: none; display: grid; gap: 0.4rem; margin-top: 0.35rem; }
.impact li { position: relative; padding-left: 1.1rem; }
.impact li::before { content: "▹"; position: absolute; left: 0; color: var(--a2); }
.impact b { color: var(--a2); font: 500 0.7rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.2rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags span { font: 0.7rem var(--font-mono); padding: 0.2rem 0.55rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

/* TRAINING LOG */
.log { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); overflow: hidden; font-size: 0.86rem; }
.log-bar { display: flex; align-items: center; gap: 6px; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.log-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-2); }
.log-bar span:nth-child(1) { background: #ff5f57; } .log-bar span:nth-child(2) { background: #febc2e; } .log-bar span:nth-child(3) { background: #28c840; }
.log-bar em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 0.75rem; }
#epochs { list-style: none; padding: 0.6rem 0; }
.loss-chart { position: relative; border-bottom: 1px solid var(--border); background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--a1) 8%, transparent), transparent 70%); overflow-x: auto; scrollbar-width: thin; }
.tl-scroll { min-width: 720px; padding: 1.2rem 1rem 1.1rem; }
.tl-curve { position: relative; height: 96px; }
.loss-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; clip-path: inset(-20px -20px -20px 100%); }
.loss-line { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--a1) 60%, transparent)); }
.log.run .loss-svg { animation: draw 2.2s var(--ease) forwards; }
@keyframes draw { to { clip-path: inset(-20px -20px -20px -20px); } }
.loss-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--a1); transition: scale 0.25s var(--ease), background 0.25s, box-shadow 0.25s; opacity: 0; }
.log.run .loss-dot { animation: rise 0.6s var(--ease) forwards; animation-delay: calc(0.4s + 0.18s * var(--d, 0)); }
.loss-dot:first-of-type { background: var(--a2); border-color: var(--a2); box-shadow: 0 0 0 6px color-mix(in srgb, var(--a2) 22%, transparent); }
.loss-dot.on { scale: 1.6; background: var(--a1); box-shadow: 0 0 0 8px color-mix(in srgb, var(--a1) 22%, transparent), 0 0 24px var(--a1); }
.tl-nodes { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-top: 0.9rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.tl-node { all: unset; position: relative; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.4rem 0.2rem; border-radius: 14px; text-align: center; cursor: pointer; opacity: 0; transition: background 0.25s; }
.log.run .tl-node { animation: rise 0.6s var(--ease) forwards; animation-delay: calc(0.5s + 0.18s * var(--d, 0)); }
.tl-node::before { content: ""; position: absolute; top: calc(-1rem - 4px); width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tl-node:hover, .tl-node.on, .tl-node:focus-visible { background: var(--surface); }
.tl-node strong { font: 600 0.88rem var(--font-display); color: var(--text); line-height: 1.15; }
.tl-node small { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em; }
.logo-tile { flex: none; display: grid; place-items: center; width: 64px; height: 64px; padding: 8px; box-sizing: border-box; border-radius: 16px; background: #fff; border: 1px solid color-mix(in srgb, var(--border) 70%, #d9dce3); box-shadow: 0 6px 18px -10px rgba(10, 20, 40, 0.35); font: 700 0.85rem var(--font-display); color: #222; transition: translate 0.3s var(--ease), box-shadow 0.3s; }
.logo-tile img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tl-node:hover .logo-tile, .tl-node.on .logo-tile { translate: 0 -4px; box-shadow: 0 14px 30px -12px var(--a1); }
#epochs { counter-reset: e; }
.epoch { position: relative; display: grid; grid-template-columns: 10.5rem 1fr; gap: 1.2rem; align-items: center; padding: 1.1rem 1.4rem; border-left: 2px solid transparent; border-top: 1px solid var(--border); transition: background 0.25s, border-color 0.25s; cursor: default; }
.epoch:first-child { border-top: 0; }
.epoch:hover, .epoch.on, .epoch:focus-visible { background: var(--surface); border-left-color: var(--a1); outline: none; }
.epoch-id { color: var(--muted); font-size: 0.8rem; }
.epoch-id b { color: var(--text); font-weight: 500; }
.epoch-id small { color: var(--a1); }
.epoch-main { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.logo-tile.epoch-badge { width: 56px; height: 56px; padding: 9px; border-radius: 14px; }
.epoch:hover .epoch-badge, .epoch.on .epoch-badge { translate: 0 -2px; box-shadow: 0 10px 26px -12px var(--a1); }
.epoch-role { font-family: var(--font-body); min-width: 0; }
.epoch-co { display: block; font: 700 0.78rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--a1); margin-bottom: 0.15rem; }
.epoch-role strong { font: 600 1.05rem var(--font-display); display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.epoch-role small { color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; }
.epoch-focus { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.epoch-focus span { font: 0.7rem var(--font-mono); padding: 0.18rem 0.55rem; border-radius: 999px; color: var(--muted); border: 1px solid var(--border); transition: color 0.25s, border-color 0.25s; }
.epoch:hover .epoch-focus span, .epoch.on .epoch-focus span { color: var(--text); border-color: color-mix(in srgb, var(--a1) 45%, var(--border)); }
.live-tag { display: inline-flex; align-items: center; gap: 0.35rem; font: 500 0.62rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 999px; color: var(--a2); background: color-mix(in srgb, var(--a2) 12%, transparent); }
.live-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 0 0 var(--a2); animation: pulse 1.6s infinite; }

/* BENTO */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.7rem; }
.tile-pub { grid-column: span 2; }
.tile-skills { grid-column: span 2; }
.tile-title { font-size: 0.75rem; color: var(--a2); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 1rem; font-weight: 500; }
.tile-title.mt { margin-top: 1.6rem; }
.pub { display: block; padding: 1.2rem; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; transition: 0.3s; }
a.pub:hover { border-color: var(--a1); }
.pub h4 { font: 600 1.15rem / 1.3 var(--font-display); }
.pub p { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.pub small { font: 0.75rem var(--font-mono); color: var(--a1); }
.list { list-style: none; display: grid; gap: 0.7rem; }
.list li { padding-left: 1.2rem; position: relative; font-size: 0.93rem; }
.list li::before { content: "◆"; position: absolute; left: 0; font-size: 0.55rem; top: 0.45rem; color: var(--a1); }
.list small { display: block; color: var(--muted); font-size: 0.8rem; }
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.skill-groups h5 { font: 500 0.82rem var(--font-mono); color: var(--muted); margin-bottom: 0.7rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips span { font-size: 0.82rem; padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); transition: 0.25s; }
.chips span:hover { border-color: var(--a2); color: var(--a2); transform: translateY(-2px); }

/* CHAT */
.chat { max-width: 820px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg2); overflow: hidden; box-shadow: 0 40px 120px -50px color-mix(in srgb, var(--a1) 60%, transparent); }
.chat-head { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--border); }
.chat-head small { display: block; color: var(--muted); font-size: 0.72rem; }
.orb { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 0deg, var(--a1), var(--a2), var(--a3), var(--a1)); animation: spin 4s linear infinite; filter: blur(0.3px); box-shadow: 0 0 24px -4px var(--a1); flex: none; }
.chat-body { height: 380px; overflow-y: auto; padding: 1.3rem; display: flex; flex-direction: column; gap: 0.9rem; scroll-behavior: smooth; }
.msg { max-width: 85%; padding: 0.8rem 1.05rem; border-radius: 16px; font-size: 0.94rem; white-space: pre-wrap; animation: rise 0.4s var(--ease) both; opacity: 0; transform: translateY(8px); }
.msg.bot { background: var(--surface-2); border-top-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--text); color: var(--bg); border-top-right-radius: 4px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; } .typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 30% { transform: translateY(-5px); opacity: 1; } 0%, 60%, 100% { opacity: 0.4; } }
.suggestions { display: flex; gap: 0.5rem; padding: 0 1.3rem 0.9rem; overflow-x: auto; scrollbar-width: none; }
.suggestions button { flex: none; font-size: 0.8rem; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); transition: 0.2s; }
.suggestions button:hover { color: var(--text); border-color: var(--a1); }
.chat-input { display: flex; gap: 0.6rem; padding: 0.9rem; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0.8rem 1.2rem; font: inherit; color: var(--text); outline: none; }
.chat-input input:focus { border-color: var(--a1); }
.chat-input .btn { padding: 0.8rem 1.2rem; }

/* CONTACT */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; padding: 3rem; border: 1px solid var(--border); border-radius: 28px; background: var(--surface); position: relative; overflow: hidden; }
.contact::before { content: ""; position: absolute; width: 500px; height: 500px; right: -200px; top: -200px; background: radial-gradient(circle, color-mix(in srgb, var(--a3) 18%, transparent), transparent 70%); pointer-events: none; }
.socials { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.socials a { font-size: 0.82rem; padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 999px; transition: 0.2s; }
.socials a:hover { border-color: var(--a2); color: var(--a2); }
.contact-form { display: grid; gap: 1rem; position: relative; }
.contact-form label { display: grid; gap: 0.4rem; font: 0.75rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-form input, .contact-form textarea { font: 1rem var(--font-body); color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 1rem; resize: vertical; outline: none; transition: border-color 0.2s; text-transform: none; letter-spacing: 0; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--a1); }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-status { font-size: 0.82rem; min-height: 1.2em; }
.form-status.ok { color: var(--a2); } .form-status.err { color: var(--a3); }

.footer { width: min(var(--maxw), calc(100% - 3rem)); margin: 5rem auto 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.78rem; color: var(--muted); }

/* FAB */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--border); box-shadow: 0 10px 40px -10px var(--a1); transition: transform 0.3s var(--ease), opacity 0.3s; }
.fab:hover { transform: scale(1.08); }
.fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.6); }

/* PALETTE */
.palette { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); display: grid; place-items: start center; padding-top: 14vh; }
.palette[hidden] { display: none; }
.palette-box { width: min(560px, calc(100% - 2rem)); background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 100px -20px rgba(0, 0, 0, 0.6); animation: pop 0.25s var(--ease); }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.palette-box input { width: 100%; padding: 1.1rem 1.3rem; font: 1rem var(--font-body); background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--border); outline: none; }
#palette-list { list-style: none; max-height: 340px; overflow-y: auto; padding: 0.4rem; }
#palette-list li { padding: 0.7rem 0.9rem; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; font-size: 0.93rem; }
#palette-list li small { color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; }
#palette-list li.sel { background: var(--surface-2); }

/* RESPONSIVE */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero { align-content: center; }
  .hero-photo { position: relative; right: auto; top: auto; translate: none; width: 150px; margin-bottom: 1.8rem; justify-self: start; }
  .hero-photo::after { translate: 10px 10px; border-radius: 22px; }
  .hero-photo-tag { display: none; }
  .cards, .bento { grid-template-columns: 1fr 1fr; }
  .showcase { grid-template-columns: 1fr; }
  .tile-pub, .tile-skills { grid-column: span 2; }
  .skill-groups { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; padding: 2rem; }
}
@media (max-width: 640px) {
  .cards, .bento, .skill-groups { grid-template-columns: 1fr; }
  .brand .logo-tile { width: 60px; height: 60px; }
  .brand b { font-size: 1.1rem; }
  .card.featured, .tile-pub, .tile-skills { grid-column: auto; }
  .epoch { grid-template-columns: 1fr; gap: 0.6rem; }
  .logo-tile.epoch-badge { width: 46px; height: 46px; padding: 7px; border-radius: 12px; }
  .epoch-main { align-items: flex-start; }
  .tl-scroll { min-width: 640px; }
  .logo-tile { width: 54px; height: 54px; padding: 8px; }
  .log-bar em { font-size: 0.66rem; }
  .kbd-btn { display: none; }
  .eyebrow { font-size: 0.68rem; white-space: nowrap; }
  .section { padding-top: 5rem; }
  .contact { padding: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
