/* Jace Maniquis — resume site. Dark by default, light via prefers-color-scheme or the toggle. */

:root {
  --bg: #0b0f17;
  --bg-elev: #121826;
  --bg-tint: #0e1420;
  --surface: #161d2d;
  --border: #243049;
  --text: #e8ecf4;
  --text-muted: #9aa6bd;
  --accent: #7c9cff;
  --accent-2: #3ee0c0;
  --accent-ink: #0b0f17;
  --glow: rgba(124, 156, 255, 0.18);
  --code-bg: #0a0e15;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f8fb;
    --bg-elev: #ffffff;
    --bg-tint: #eef1f8;
    --surface: #ffffff;
    --border: #dde2ee;
    --text: #131a2a;
    --text-muted: #5a6680;
    --accent: #3d5ce0;
    --accent-2: #0f9f86;
    --accent-ink: #ffffff;
    --glow: rgba(61, 92, 224, 0.12);
    --code-bg: #0f1624;
    --shadow: 0 20px 50px -24px rgba(19, 26, 42, 0.25);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-elev: #ffffff;
  --bg-tint: #eef1f8;
  --surface: #ffffff;
  --border: #dde2ee;
  --text: #131a2a;
  --text-muted: #5a6680;
  --accent: #3d5ce0;
  --accent-2: #0f9f86;
  --accent-ink: #ffffff;
  --glow: rgba(61, 92, 224, 0.12);
  --code-bg: #0f1624;
  --shadow: 0 20px 50px -24px rgba(19, 26, 42, 0.25);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 999px;
  padding: .75rem 1.25rem; font: 600 .95rem/1 var(--font);
  cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: var(--accent-ink); box-shadow: 0 8px 24px -10px var(--accent); }
.btn--primary:hover { box-shadow: 0 10px 30px -8px var(--accent); }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); }
.btn--sm { padding: .55rem 1rem; font-size: .875rem; }
.btn--link { color: var(--text-muted); padding-inline: .5rem; }
.btn--link:hover { color: var(--text); }
.hero__formats { margin: .75rem 0 0; font-size: .85rem; color: var(--text-muted); }
.btn--icon { padding: .7rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.topbar__inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; text-decoration: none !important; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-size: .8rem; letter-spacing: .02em;
}
.nav { display: flex; gap: 1.5rem; margin-left: auto; }
.nav a { color: var(--text-muted); font-size: .92rem; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.topbar__actions { display: flex; align-items: center; gap: .6rem; }

@media (max-width: 820px) {
  .nav { display: none; }
  .topbar__actions { margin-left: auto; }
  .brand__name { display: none; }
}

/* Hero */
.hero { position: relative; padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%;
  background:
    radial-gradient(40% 50% at 25% 30%, var(--glow), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero__title { font-size: clamp(2.6rem, 6.5vw, 4.6rem); font-weight: 800; letter-spacing: -0.04em; margin: .9rem 0 .6rem; }
.hero__headline { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--text-muted); max-width: 34ch; margin-bottom: 1rem; }
.hero__meta { display: flex; align-items: center; gap: .4rem; color: var(--text-muted); font-size: .95rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0;
  padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev); font-size: .85rem; font-weight: 500;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.hero__card { position: relative; display: grid; gap: 1rem; justify-items: end; }
.avatar {
  width: 132px; height: 132px; border-radius: 32px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-size: 2.6rem; font-weight: 800; box-shadow: var(--shadow); justify-self: start; margin-left: 12%;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.terminal { width: 100%; border-radius: var(--radius); background: var(--code-bg); border: 1px solid #222c40; box-shadow: var(--shadow); overflow: hidden; }
.terminal__bar { display: flex; align-items: center; gap: 6px; padding: .6rem .9rem; border-bottom: 1px solid #1e2738; }
.terminal__bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c3650; }
.terminal__bar span { margin-left: .5rem; font: 500 .75rem var(--mono); color: #7f8aa3; }
.terminal pre { margin: 0; padding: 1rem 1.1rem 1.2rem; font: 400 .8rem/1.7 var(--mono); color: #d4dbea; overflow-x: auto; }
.c-dim { color: #6b7690; } .c-key { color: #c792ea; } .c-fn { color: #82aaff; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { justify-items: stretch; }
  .avatar { display: none; }
}

/* Sections */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section--tint { background: var(--bg-tint); border-block: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.section__title { display: flex; align-items: baseline; gap: .8rem; font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; margin-bottom: 1.5rem; }
.section__num { font: 500 .85rem var(--mono); color: var(--accent); }
.section__lead { color: var(--text-muted); font-size: 1.08rem; max-width: 62ch; margin-bottom: 2rem; }

.about { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.about__body { font-size: 1.08rem; max-width: 68ch; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; gap: 0; } }

.stats { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stats li { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); }
.stats strong { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.stats span { color: var(--text-muted); font-size: .88rem; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

/* Agentic AI */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; counter-reset: step; }
.pipeline__step {
  position: relative; padding: 1.1rem 1.1rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
}
.pipeline__step:not(:last-child)::after {
  content: "→"; position: absolute; right: -.85rem; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-weight: 700; z-index: 1;
}
.pipeline__step span {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; margin-bottom: .6rem;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font: 600 .8rem var(--mono);
}
.pipeline__step strong { display: block; margin-bottom: .25rem; }
.pipeline__step p { margin: 0; color: var(--text-muted); font-size: .9rem; line-height: 1.5; }
@media (max-width: 900px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline__step::after { display: none; }
}
@media (max-width: 520px) { .pipeline { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; }
.card {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); transform: translateY(-2px); }
.card h3 { font-size: 1.2rem; }
.card__tagline { color: var(--accent); font-size: .92rem; font-weight: 500; margin: .3rem 0 .8rem; }
.card > p { color: var(--text-muted); font-size: .96rem; }
.card__link { margin-top: auto; padding-top: .8rem; font-weight: 600; font-size: .92rem; }

.ticks { list-style: none; padding: 0; margin: .25rem 0 1rem; display: grid; gap: .45rem; }
.ticks li { position: relative; padding-left: 1.4rem; font-size: .94rem; line-height: 1.5; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-2); transform: rotate(45deg); }

.chips { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li {
  padding: .28rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 500;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Experience */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 180px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.timeline__item { display: grid; grid-template-columns: 180px 1fr; gap: 2.5rem; padding-bottom: 2.25rem; position: relative; }
.timeline__item::before {
  content: ""; position: absolute; left: 175px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline__item:first-child::before { background: var(--accent); }
.timeline__when { font: 500 .88rem var(--mono); color: var(--text-muted); padding-top: 2px; }
.timeline__what h3 { font-size: 1.15rem; margin-bottom: .2rem; }
.timeline__what h3 span { color: var(--text-muted); font-weight: 500; }
.timeline__what .muted { font-size: .9rem; margin-bottom: .5rem; }
@media (max-width: 680px) {
  .timeline::before { left: 5px; }
  .timeline__item { grid-template-columns: 1fr; gap: .25rem; padding-left: 1.75rem; }
  .timeline__item::before { left: 0; }
}

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; }
.skills__group { padding: 1.25rem 1.35rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.skills__group h3 { font-size: 1rem; margin-bottom: .8rem; }

/* Education */
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; }
.edu__item { padding: 1.35rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); }
.edu__item h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.edu__item p { margin: 0; }

/* Contact */
.section--contact { background: radial-gradient(60% 80% at 50% 0%, var(--glow), transparent 70%); }
.contact__links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.contact__links a {
  display: flex; flex-direction: column; gap: .15rem; padding: 1.1rem 1.25rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none;
  transition: border-color .15s ease;
}
.contact__links a:hover { border-color: var(--accent); }
.contact__links span { color: var(--text-muted); font-weight: 400; font-size: .88rem; overflow-wrap: anywhere; }

.footer { border-top: 1px solid var(--border); padding: 1.75rem 0 6rem; font-size: .9rem; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer p { margin: 0; }

/* Chat */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1.2rem; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
  color: var(--accent-ink); font: 600 .95rem var(--font); cursor: pointer; box-shadow: 0 14px 34px -12px var(--accent);
}
.chat-launcher[aria-expanded="true"] { display: none; }

.chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 40px));
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  overflow: hidden; animation: chat-in .2s ease-out;
}
.chat[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 520px) {
  .chat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}

.chat__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.chat__head h2 { font-size: 1.05rem; }
.chat__sub { margin: .1rem 0 0; font-size: .78rem; color: var(--text-muted); }
.chat__log { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .85rem; }

.msg { max-width: 88%; font-size: .94rem; line-height: 1.55; }
.msg p { margin: 0 0 .5rem; } .msg p:last-child { margin: 0; }
.msg ul { margin: .25rem 0 .5rem; padding-left: 1.2rem; }
.msg--user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: .6rem .9rem; border-radius: 16px 16px 4px 16px; }
.msg--bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); padding: .7rem .95rem; border-radius: 16px 16px 16px 4px; }
.msg--error { border-color: #c2414b; }
.msg--bot.is-typing::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.msg .trace { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.trace li {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 6px;
  font: 500 .72rem var(--mono); color: var(--text-muted); background: var(--bg-tint); border: 1px solid var(--border);
}
.trace li b { color: var(--accent-2); font-weight: 500; }

.sources { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; padding-top: .55rem; border-top: 1px dashed var(--border); }
.sources span { font-size: .75rem; color: var(--text-muted); width: 100%; }
.sources a { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--border); }

.chat__suggestions { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.1rem .75rem; }
.chat__suggestions button {
  border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px;
  padding: .4rem .75rem; font: 500 .8rem var(--font); cursor: pointer; text-align: left;
}
.chat__suggestions button:hover { border-color: var(--accent); color: var(--accent); }

.chat__form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem 1.1rem .4rem; border-top: 1px solid var(--border); }
.chat__form textarea {
  flex: 1; resize: none; max-height: 140px; padding: .7rem .9rem; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 400 .95rem/1.4 var(--font);
}
.chat__form textarea:focus { outline: none; border-color: var(--accent); }
.chat__note { margin: 0; padding: 0 1.1rem .8rem; font-size: .72rem; color: var(--text-muted); }
