/* Design system ported from docs/denys-volokh-profile.html (mockup).
   Dark is the default theme; class names match the mockup 1:1 so
   templates/base.html and templates/home.html can reuse them directly. */
:root {
  --bg: #0e1013;
  --s1: #151920;
  --s2: #1c212a;
  --s3: #232935;
  --line: #2a303b;
  --line-strong: #3a4250;
  --text: #f1eee8;
  --text-2: #a3a9b4;
  --text-3: #6e7481;
  --accent: #9da9f5;
  --accent-ink: #0e1013;
  --accent-soft: rgba(157, 169, 245, 0.14);
  --ok: #8fcfa8;
  --ok-soft: rgba(143, 207, 168, 0.14);
  --warn: #d8b879;
  --warn-soft: rgba(216, 184, 121, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --font:
    "Onest",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  --maxw: 1120px;
}

[data-theme="light"] {
  --bg: #f6f5f2;
  --s1: #ffffff;
  --s2: #f0efeb;
  --s3: #e7e5df;
  --line: #e1dfd8;
  --line-strong: #c9c6bd;
  --text: #15181d;
  --text-2: #5b6069;
  --text-3: #8a8f98;
  --accent: #4e5bd6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(78, 91, 214, 0.1);
  --ok: #2e7d4f;
  --ok-soft: rgba(46, 125, 79, 0.1);
  --warn: #946b14;
  --warn-soft: rgba(148, 107, 20, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

textarea,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 600;
  line-height: 1.15;
}

.lede {
  color: var(--text-2);
  font-size: 18px;
  max-width: 56ch;
  margin: 14px 0 0;
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
}

/* header */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand strong {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 14px;
}

.brand span {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}

.links {
  display: flex;
  gap: 4px;
}

.links a {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
}

.links a:hover {
  color: var(--text);
  background: var(--s2);
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-2);
}

.icon-btn:hover {
  background: var(--s2);
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--s1);
  transition:
    background 0.15s,
    border-color 0.15s;
}

.btn:hover {
  background: var(--s2);
  border-color: var(--text-3);
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn.primary:hover {
  opacity: 0.9;
}

svg {
  display: block;
}

/* hero */
.hero {
  padding: 96px 0 64px;
  border-top: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--s1);
}

.badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 600;
  line-height: 1.02;
  margin: 28px 0 0;
  max-width: 14ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--text-3);
  font-weight: 400;
}

.hero .sub {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--text-2);
  max-width: 58ch;
  margin: 26px 0 0;
  line-height: 1.5;
}

/* ask box */
.ask {
  margin-top: 44px;
  background: var(--s1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 8px 8px 18px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 24px 60px -30px rgba(0, 0, 0, 0.6);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.ask:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 24px 60px -30px rgba(0, 0, 0, 0.6);
}

.ask textarea {
  flex: 1;
  resize: none;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 12px 0;
  font-size: 17px;
  line-height: 1.4;
  min-height: 48px;
  max-height: 180px;
  color: var(--text);
}

.ask textarea::placeholder {
  color: var(--text-3);
}

.ask .send {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  transition:
    transform 0.12s,
    opacity 0.15s;
}

.ask .send:hover {
  transform: translateY(-1px);
}

.ask .send:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 4px 0;
  font-size: 13px;
  color: var(--text-3);
}

.hint kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--s1);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  background: var(--s1);
  text-align: left;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.chip:hover {
  border-color: var(--text-3);
  color: var(--text);
  background: var(--s2);
}

/* conversation */
.convo {
  margin-top: 40px;
  display: none;
  flex-direction: column;
  gap: 28px;
}

.convo.on {
  display: flex;
}

.msg {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.msg.user .avatar {
  background: var(--s2);
  color: var(--text-2);
  border: 1px solid var(--line);
}

.msg.ai .avatar {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.msg .who {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.msg.user .body {
  font-size: 17px;
  font-weight: 500;
}

.msg.ai .body p {
  margin: 0 0 14px;
  font-size: 16.5px;
  color: var(--text);
  line-height: 1.6;
  max-width: 70ch;
}

.msg.ai .body p:last-child {
  margin-bottom: 0;
}

.thinking {
  display: inline-flex;
  gap: 5px;
  padding: 10px 0;
}

.thinking i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: pulse 1.2s infinite ease-in-out;
}

.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.grounded {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-3);
}

.grounded svg {
  color: var(--ok);
}

.evidence {
  margin-top: 18px;
}

.evidence .lbl {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.ev-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ev-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--s1);
  border-radius: var(--radius-sm);
  text-align: left;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.ev-card:hover {
  border-color: var(--accent);
  background: var(--s2);
}

.ev-card b {
  font-weight: 500;
  font-size: 14px;
}

.ev-card small {
  display: block;
  color: var(--text-3);
  font-size: 12.5px;
}

.ev-card svg {
  color: var(--text-3);
  margin-left: 4px;
}

.feedback-controls {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.fb-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--s1);
  color: var(--text-3);
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.fb-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
  background: var(--s2);
}

.fb-btn:disabled {
  cursor: default;
}

.fb-btn.selected.positive {
  border-color: var(--ok);
  color: var(--ok);
}

.fb-btn.selected.negative {
  border-color: var(--warn);
  color: var(--warn);
}

.err {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  background: var(--s1);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text-2);
}

/* recruiter mode */
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.jd {
  background: var(--s1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.jd:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.jd textarea {
  width: 100%;
  min-height: 260px;
  background: transparent;
  border: 0;
  outline: 0;
  resize: vertical;
  padding: 14px;
  font-size: 15px;
  line-height: 1.55;
}

.jd textarea::placeholder {
  color: var(--text-3);
}

.jd-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 6px;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.jd-foot span {
  font-size: 13px;
  color: var(--text-3);
}

.result {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 320px;
}

.result .empty {
  color: var(--text-3);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.result .empty svg {
  color: var(--text-3);
}

.result h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 22px;
}

.res-group {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.res-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.res-group h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-group h4 i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--s2);
}

.tag.ok {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

.tag.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.res-group ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 15px;
}

.res-group li {
  margin: 5px 0;
}

.res-group li::marker {
  color: var(--text-3);
}

.skel {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--s2), var(--s3), var(--s2));
  background-size: 200% 100%;
  animation: sh 1.4s infinite linear;
  margin: 10px 0;
}

@keyframes sh {
  to {
    background-position: -200% 0;
  }
}

.note {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

/* projects */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.proj {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  transition:
    border-color 0.15s,
    transform 0.15s;
}

.proj:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.proj .cat {
  font-size: 13px;
  color: var(--text-3);
}

.proj h3 {
  font-size: 21px;
  font-weight: 600;
}

.proj p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
}

.impact {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.impact i {
  width: 14px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
  border-radius: 2px;
}

.proj .foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack span {
  font-size: 12.5px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
}

.proj .go {
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* timeline */
.tl {
  position: relative;
  padding-left: 32px;
  max-width: 760px;
}

.tl::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line-strong);
}

.tl-item {
  position: relative;
  padding-bottom: 48px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-item .when {
  color: var(--text-3);
  font-size: 14px;
}

.tl-item h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 6px 0 2px;
}

.tl-item .role {
  color: var(--text-2);
  font-size: 16px;
}

.tl-item p {
  color: var(--text-2);
  font-size: 15.5px;
  max-width: 60ch;
  margin: 14px 0 0;
}

.areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.areas span {
  font-size: 13px;
  color: var(--text-2);
  background: var(--s2);
  border-radius: 6px;
  padding: 4px 9px;
}

/* capabilities */
.caps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--s1);
}

.cap {
  padding: 24px 22px;
  border-left: 1px solid var(--line);
}

.cap:first-child {
  border-left: 0;
}

.cap h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.cap ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cap li {
  font-size: 14.5px;
  color: var(--text-2);
}

/* impact grid */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stat {
  display: block;
  text-align: left;
  padding: 36px 28px 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  width: 100%;
  transition: background 0.15s;
}

button.stat:hover {
  background: var(--s1);
}

button.stat:hover h3::after {
  opacity: 1;
  transform: none;
}

.num {
  font-size: clamp(64px, 7.5vw, 96px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

button.stat h3::after {
  content: "→";
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.15s,
    transform 0.15s;
  font-weight: 400;
}

.stat p {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--text-2);
}

.lead-note {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.lead-note p {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
  max-width: 52ch;
}

.lead-note h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* cta + footer */
.cta {
  text-align: center;
}

.cta h2 {
  max-width: 22ch;
  margin: 0 auto;
}

.cta .lede {
  margin: 14px auto 0;
}

.cta .row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
}

footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--text-3);
  font-size: 14px;
}

footer .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

footer strong {
  color: var(--text);
  font-weight: 600;
  display: block;
}

footer nav {
  display: flex;
  gap: 18px;
}

footer nav a:hover {
  color: var(--text);
}

footer .tiny {
  margin-top: 28px;
  font-size: 13px;
}

/* drawer */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
}

.overlay.on {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100%);
  background: var(--s1);
  border-left: 1px solid var(--line);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.on {
  transform: none;
}

.drawer .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer .top span {
  font-size: 13px;
  color: var(--text-3);
}

.drawer .scroll {
  overflow: auto;
  padding: 28px 24px 40px;
}

.drawer h3 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
}

.drawer .co {
  color: var(--text-2);
  margin-top: 6px;
  font-size: 15px;
}

.dl {
  margin-top: 26px;
}

.dl dt {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 22px;
}

.dl dd {
  margin: 6px 0 0;
  font-size: 15.5px;
  color: var(--text);
  line-height: 1.6;
}

.dl dd a {
  color: var(--accent);
  text-decoration: underline;
}

.dl dd.big {
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .grid,
  .lead-note,
  .two {
    grid-template-columns: 1fr;
  }

  .caps {
    grid-template-columns: 1fr 1fr;
  }

  .cap {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .cap:nth-child(-n + 2) {
    border-top: 0;
  }

  .cap:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .impact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .links,
  .brand span {
    display: none;
  }

  section {
    padding: 72px 0;
  }
}

@media (max-width: 600px) {
  .caps {
    grid-template-columns: 1fr;
  }

  .impact-grid {
    grid-template-columns: 1fr;
  }

  .cap {
    border-left: 0 !important;
  }

  .cap:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    scrollbar-width: none;
  }

  .chip {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .hero {
    padding-top: 64px;
  }

  .hero h1 {
    max-width: none;
  }

  .btn .txt {
    display: none;
  }

  .btn {
    padding: 9px;
  }
}
