/* ============================================================================
   Shivam Dixit — AI Resume Chatbot
   Single consolidated stylesheet · Champagne Gold & warm obsidian · editorial
   Sections: Tokens → Layout → Chat → Projects/Dialogs → Effects/A11y
   ========================================================================== */

/* ════════════════════════════ TOKENS ════════════════════════════════════ */
:root {
  /* ── Canvas: warm obsidian, never pure black ────────────────────────── */
  --bg-0: #060504;
  --bg-1: #0e0c0a;
  --bg-base: #090807;

  /* ── Elevation surfaces (warm silk-gold tints) ──────────────────────── */
  --surf-1: rgba(245, 235, 220, 0.02);
  --surf-2: rgba(245, 235, 220, 0.04);
  --surf-3: rgba(245, 235, 220, 0.07);
  --surf-4: rgba(245, 235, 220, 0.11);
  --surf-5: rgba(255, 255, 255, 0.16);

  /* ── Hairlines ──────────────────────────────────────────────────────── */
  --line-1: rgba(245, 235, 220, 0.08);
  --line-2: rgba(245, 235, 220, 0.13);
  --line-top: rgba(255, 255, 255, 0.18);
  --line-bot: rgba(0, 0, 0, 0.3);

  /* ── Accent: champagne gold & metallic bronze, used sparingly ───────── */
  --accent: #dfb271;
  --accent-light: #f5e4cc;
  --accent-dark: #9d733b;
  --accent-ink: #f8eccf; /* light gold text on soft-gold fills */
  --on-accent: #1c1307; /* dark ink on solid gold buttons */
  --accent-glow: rgba(223, 178, 113, 0.35);
  --accent-soft: rgba(223, 178, 113, 0.14);
  --accent-faint: rgba(223, 178, 113, 0.06);

  /* Gradients */
  --gold-gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  --panel-glow-gradient: radial-gradient(120% 80% at 50% -12%, var(--accent-faint), transparent 60%);

  /* ── Radius scale (unified) ─────────────────────────────────────────── */
  --r-card: 18px;
  --r-btn: 12px;
  --r-chip: 12px;
  --r-pill: 999px;

  /* ── Text ramp ──────────────────────────────────────────────────────── */
  --text-1: rgba(248, 245, 240, 0.96);
  --text-2: rgba(230, 224, 212, 0.68);
  --text-3: rgba(210, 202, 188, 0.45);
  --ink: var(--text-1);

  /* ── Status ─────────────────────────────────────────────────────────── */
  --ok: #e0b372;
  --ok-glow: rgba(224, 179, 114, 0.35);
  --live: #34d399;
  --live-glow: rgba(52, 211, 153, 0.4);

  /* ── Glass material ─────────────────────────────────────────────────── */
  --glass-bg: var(--surf-2);
  --glass-bg-strong: var(--surf-3);
  --glass-border: var(--line-1);
  --blur-panel: 30px;
  --sat: 150%;

  /* ── Chat bubble backgrounds ────────────────────────────────────────── */
  --bubble-ai: var(--surf-2);
  --bubble-user: linear-gradient(135deg, rgba(223, 178, 113, 0.15) 0%, rgba(223, 178, 113, 0.07) 100%);

  /* ── Shadows ────────────────────────────────────────────────────────── */
  --sh-inner-hi: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  --shadow-glass:
    0 32px 64px -28px rgba(0, 0, 0, 0.8),
    0 8px 24px -12px rgba(0, 0, 0, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-float:
    0 48px 96px -36px rgba(0, 0, 0, 0.85),
    0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-pill: 0 8px 24px -10px var(--accent-glow);

  /* ── Motion ─────────────────────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring-lg: cubic-bezier(0.22, 1.3, 0.36, 1);

  /* Fonts */
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
}

/* ════════════════════════════ LAYOUT ════════════════════════════════════ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-1);
  background: var(--bg-base);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1;
}

.lg-filters {
  position: absolute;
  pointer-events: none;
}

.layout {
  height: 100dvh;
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(24px, 5vw, 68px);
  display: grid;
  grid-template-columns: minmax(320px, 42fr) minmax(440px, 58fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: stretch;
}

/* ── Left sidebar (identity) ──────────────────────────────────────────── */
.identity {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: clamp(28px, 6vh, 72px);
  gap: clamp(20px, 2.6vh, 28px);
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.identity::-webkit-scrollbar {
  display: none;
}

.identity__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.name {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(40px, 5vw, 62px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text-1);
}
.name em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.positioning {
  font-size: clamp(15px, 1.3vw, 17px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 32ch;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.01em;
  color: var(--text-2);
}
.availability__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 var(--live-glow);
  animation: pulse-live 2.6s ease-out infinite;
  flex: none;
}
@keyframes pulse-live {
  0% {
    box-shadow: 0 0 0 0 var(--live-glow);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }
}

/* ── Experience / proof row ───────────────────────────────────────────── */
.proof {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}
.proof__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.proof__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 18px;
}
.proof__list li {
  position: relative;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.01em;
  color: var(--text-2);
}
.proof__list li + li::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-dark);
  transform: translateY(-50%);
}

/* ── Metric chips ─────────────────────────────────────────────────────── */
.chips {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 4px;
}
.chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--r-chip);
  background: var(--surf-2);
  border: 1px solid var(--line-1);
}
.chip__num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.chip__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Toast (used by feedback acknowledgement) ─────────────────────────── */
.premium-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate3d(-50%, 24px, 0);
  background: rgba(14, 12, 10, 0.95);
  border: 1px solid var(--line-2);
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  box-shadow: var(--shadow-float);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.premium-toast.visible {
  transform: translate3d(-50%, 0, 0);
  opacity: 1;
}

/* ════════════════════════════ CHAT ══════════════════════════════════════ */
.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--panel-glow-gradient), var(--glass-bg);
  transition: transform 0.5s var(--ease-spring-lg), box-shadow 0.5s var(--ease-soft);
}
.chat > * {
  position: relative;
  z-index: 1;
}
/* cursor-tracking light on the panel surface, behind content */
.chat::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    280px circle at var(--light-x, 50%) var(--light-y, 0%),
    rgba(255, 255, 255, 0.05),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease-soft);
}

.chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--line-1);
}
.chat__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.chat__id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.chat__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
}
.chat__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 var(--live-glow);
  animation: pulse-live 2.6s ease-out infinite;
  flex: none;
}

/* ── Avatars (restored — were dropped in the module split) ────────────── */
.avatar {
  display: grid;
  place-items: center;
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surf-3);
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  flex: none;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 0 22px -8px var(--accent-glow);
}
.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.avatar--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 50%;
  z-index: 1;
}
.avatar__fallback {
  position: relative;
  z-index: 0;
}
.avatar--noimg img {
  display: none;
}
/* header avatar = focal: visible ring (in effects) + dark scrim */
.chat__header .avatar--photo {
  overflow: visible;
}
.chat__header .avatar--photo img {
  z-index: 1;
}
.chat__header .avatar--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 30%, transparent 54%, rgba(6, 5, 4, 0.55) 100%);
}

/* ── Action bar ───────────────────────────────────────────────────────── */
.actionbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
/* Tier 2 — secondary / ghost: quiet, single state shift */
.act {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--line-1);
  background: var(--surf-2);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.act:hover {
  background: var(--surf-4);
  border-color: var(--accent);
  color: var(--text-1);
}
.act:active {
  background: var(--surf-3);
}
.act--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  gap: 7px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  color: var(--text-1);
  background: var(--surf-2);
}
.act--primary:hover {
  color: var(--on-accent);
  background: var(--gold-gradient);
  border-color: var(--accent);
}
.act__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.act--disabled {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(0.6);
}

/* ── Scroll area ──────────────────────────────────────────────────────── */
.chat__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(16px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--surf-4) transparent;
}
.chat__scroll::-webkit-scrollbar {
  width: 6px;
}
.chat__scroll::-webkit-scrollbar-thumb {
  background: var(--surf-4);
  border-radius: 999px;
}
.chat__scroll:hover::-webkit-scrollbar-thumb {
  background: var(--accent-soft);
}

/* ── Empty state / scan layer ─────────────────────────────────────────── */
.chat__empty {
  padding: clamp(18px, 4vh, 36px) 4px 8px;
  transition: opacity 0.4s var(--ease-soft), max-height 0.4s var(--ease-soft), padding 0.4s;
  max-height: 400px;
}
.chat__empty.is-hidden {
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.chat__headline {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--text-1);
}
.chat__sub {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 44ch;
}

/* ── Messages & bubbles ───────────────────────────────────────────────── */
.messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.msg {
  position: relative;
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: rise 0.42s var(--ease-out) both;
}
.msg--ai {
  align-self: flex-start;
}
.msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 80%;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
.msg__body {
  padding: 12px 18px;
  font-size: 15px;
  line-height: 1.65;
  border-radius: 18px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg--ai .msg__body {
  background: var(--bubble-ai);
  color: var(--text-1);
  border: 1px solid var(--line-1);
  border-top-left-radius: 4px;
  box-shadow: var(--sh-inner-hi);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.msg--user .msg__body {
  background: var(--bubble-user);
  color: var(--text-1);
  border: 1px solid var(--accent-soft);
  border-top-right-radius: 4px;
  box-shadow: var(--sh-inner-hi);
}
.msg .avatar--sm {
  margin-top: 2px;
}
.msg--grouped {
  margin-top: -12px;
}
.msg--grouped .avatar--sm {
  visibility: hidden;
}

/* ── AI reply feedback (quiet, editorial — no confetti, no bounce) ────── */
.msg__feedback {
  position: absolute;
  right: 18px;
  bottom: -13px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translate3d(0, 4px, 0);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  z-index: 5;
}
.msg--ai:hover .msg__feedback,
.msg--ai:focus-within .msg__feedback {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.feedback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(14, 12, 10, 0.92);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.feedback-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.feedback-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.feedback-btn:disabled:not(.active) {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Composer tray ────────────────────────────────────────────────────── */
.tray {
  padding: 16px clamp(16px, 2vw, 24px) 20px;
  border-top: 1px solid var(--line-1);
  background: var(--surf-1);
}
.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
/* Tier 3 — cloud chips: small, soft, airy; quiet single state shift */
.topic {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-1);
  background: var(--surf-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.topic:hover {
  background: var(--surf-4);
  border-color: var(--accent);
  color: var(--text-1);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  transition: opacity 0.3s var(--ease-soft), max-height 0.35s var(--ease-soft), margin 0.3s var(--ease-soft);
  max-height: 120px;
  overflow: hidden;
}
.pills.is-hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  pointer-events: none;
}
.pill {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-1);
  background: var(--surf-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.pill:hover {
  color: var(--text-1);
  background: var(--surf-4);
  border-color: var(--accent);
}
.pill:active {
  background: var(--surf-3);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 18px;
  background: var(--surf-3);
  border: 1px solid var(--line-1);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--sh-inner-hi);
  transition: border-color 0.16s var(--ease-soft), box-shadow 0.16s var(--ease-soft);
}
.composer:focus-within {
  border-color: transparent;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft), 0 0 24px -10px var(--accent-glow);
}
.composer__input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  resize: none;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-1);
  caret-color: var(--accent);
  max-height: 104px;
  padding: 8px 0;
}
.composer__input::placeholder {
  color: var(--text-3);
}

/* Tier 1 — primary: solid gold, dark ink, one restrained hover */
.send {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--r-btn);
  background: var(--gold-gradient);
  color: var(--on-accent);
  cursor: pointer;
  box-shadow: 0 6px 16px -10px var(--accent-glow);
  transition: filter 0.16s var(--ease-soft), box-shadow 0.16s var(--ease-soft), transform 0.12s var(--ease-soft), opacity 0.16s var(--ease-soft);
}
.send:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 8px 20px -8px var(--accent-glow);
}
.send:active:not(:disabled) {
  transform: scale(0.96);
}
.send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.5);
}
.send.is-pop {
  animation: send-pop 0.4s var(--ease-spring);
}
@keyframes send-pop {
  40% {
    transform: scale(1.15);
  }
}
.send.is-sending svg {
  opacity: 0;
}
.send.is-sending::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(28, 19, 7, 0.3);
  border-top-color: var(--on-accent);
  animation: spin-loader 0.6s linear infinite;
}
@keyframes spin-loader {
  to {
    transform: rotate(360deg);
  }
}

/* ── Typing indicator ─────────────────────────────────────────────────── */
.typing {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.typing[hidden] {
  display: none;
}
.typing__bubble {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bubble-ai);
  border: 1px solid var(--line-1);
  border-radius: 18px;
  border-top-left-radius: 4px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: blink-dot 1.3s infinite both;
}
.dot:nth-child(2) {
  animation-delay: 0.18s;
}
.dot:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes blink-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* ── Rich markdown inside AI bubbles ──────────────────────────────────── */
.msg__body :first-child {
  margin-top: 0;
}
.msg__body :last-child {
  margin-bottom: 0;
}
.msg__body p + p {
  margin-top: 8px;
}
.msg__body strong {
  font-weight: 600;
  color: var(--accent-light);
}
.msg__body em {
  font-style: italic;
  color: var(--text-1);
}
.msg__body .md-h {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent);
  margin: 14px 0 6px;
}
.msg__body .md-h1 {
  font-size: 1.15em;
  border-bottom: 1px solid var(--line-1);
  padding-bottom: 4px;
}
.msg__body .md-h2 {
  font-size: 1.08em;
}
.msg__body .md-h3 {
  font-size: 1em;
  font-weight: 500;
  color: var(--text-2);
}
.msg__body a.premium-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.msg__body a.premium-link:hover {
  border-bottom-color: var(--accent);
}
.msg__body ul.premium-list,
.msg__body ol.premium-list-ordered {
  margin: 8px 0;
  padding-left: 2px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg__body ul.premium-list li,
.msg__body ol.premium-list-ordered li {
  position: relative;
  padding-left: 18px;
}
.msg__body ul.premium-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.65em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.msg__body ol.premium-list-ordered {
  counter-reset: li;
}
.msg__body ol.premium-list-ordered li {
  counter-increment: li;
}
.msg__body ol.premium-list-ordered li::before {
  content: counter(li) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.msg__body blockquote.premium-quote {
  margin: 10px 0;
  padding: 4px 0 4px 14px;
  border-left: 3px solid var(--accent-dark);
  color: var(--text-2);
  font-style: italic;
  background: var(--accent-faint);
  border-radius: 0 var(--r-btn) var(--r-btn) 0;
}
.msg__body code.glass-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-1);
}
.msg__body hr {
  border: 0;
  height: 1px;
  background: var(--line-1);
  margin: 12px 0;
}
.msg__body pre.code-block {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-btn);
  background: rgba(10, 8, 7, 0.95);
  overflow-x: auto;
}
.msg__body pre.code-block code {
  background: none;
  color: var(--accent-light);
  padding: 0;
  border: none;
  font-size: 13.5px;
  line-height: 1.6;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ════════════════════════ PROJECTS & DIALOGS ════════════════════════════ */
.section-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2px;
  margin-top: 4px;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
  width: 100%;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

/* ── Project cards (clickable tiles → lightbox) ───────────────────────── */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line-1);
  background: var(--surf-2);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.28s var(--ease-out), border-color 0.28s var(--ease-out),
    background-color 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--line-top) 0%, rgba(245, 235, 220, 0.02) 40%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  background-color: var(--surf-3);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.5);
}
.project-card__thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background-size: cover;
  background-position: center top;
  border-bottom: 1px solid var(--line-1);
  transition: transform 0.45s var(--ease-out);
  will-change: transform;
}
.project-card:hover .project-card__thumb {
  transform: scale(1.03);
}
.project-card__content {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  flex-grow: 1;
  gap: 7px;
}
.project-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.project-card__outcome {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-card__outcome::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.project-card__role {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
}
.project-card__title {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
  line-height: 1.25;
}
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 1px;
}
.project-card__tag {
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surf-3);
  border: 1px solid var(--line-1);
  color: var(--text-2);
}
.project-card__view {
  margin-top: auto;
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: gap 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.project-card__view::after {
  content: "→";
}
.project-card:hover .project-card__view {
  color: var(--accent);
  gap: 8px;
}

/* ── Certifications (view-only gallery → lightbox) ─────────────────────── */
.certs-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
  width: 100%;
}
.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}
.cert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line-1);
  background: var(--surf-2);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.28s var(--ease-out), border-color 0.28s var(--ease-out),
    background-color 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}
.cert-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  background-color: var(--surf-3);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.5);
}
.cert-card__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center top;
  background-color: #f3f1ec;
  border-bottom: 1px solid var(--line-1);
  -webkit-user-drag: none;
  transition: transform 0.45s var(--ease-out);
}
.cert-card:hover .cert-card__thumb {
  transform: scale(1.03);
}
.cert-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}
.cert-card__title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-1);
}
.cert-card__meta {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-3);
}
.cert-dialog__media {
  min-height: 42vh;
  max-height: 64vh;
  background-color: #2a2a2a;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-bottom: 1px solid var(--line-1);
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Show presentation CTA ────────────────────────────────────────────── */
/* Floating launcher pill (bottom-right) → opens the presentation */
.presentation-fab {
  position: fixed;
  right: clamp(20px, 3vw, 32px);
  bottom: clamp(20px, 3vh, 32px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--gold-gradient);
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: var(--shadow-pill), 0 8px 24px -10px var(--accent-glow);
  cursor: pointer;
  animation: fab-in 0.5s var(--ease-spring) both;
  animation-delay: 0.7s;
  transition: transform 0.18s var(--ease-out), filter 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.presentation-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 32px -8px var(--accent-glow);
}
.presentation-fab:active {
  transform: translateY(0) scale(0.98);
}
@keyframes fab-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.btn--presentation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--r-btn);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--gold-gradient);
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: filter 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), transform 0.12s var(--ease-out);
}
.btn--presentation:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 28px -8px var(--accent-glow);
}
.btn--presentation:active {
  transform: scale(0.98);
}

/* ── Dialog shell (PDF + project + business card) ─────────────────────── */
.pdf-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  outline: none;
  max-width: min(92vw, 1100px);
  width: 100%;
  height: 82vh;
  box-shadow: var(--shadow-float);
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.96) translate3d(0, 12px, 0);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), display 0.25s var(--ease-out) allow-discrete;
  overflow: hidden;
}
.pdf-dialog[open] {
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
  display: flex;
}
.pdf-dialog.is-closing {
  opacity: 0;
  transform: scale(0.96) translate3d(0, 12px, 0);
}
.pdf-dialog::backdrop {
  background: rgba(4, 3, 2, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.25s var(--ease-out), display 0.25s var(--ease-out) allow-discrete;
}
.pdf-dialog[open]::backdrop {
  opacity: 1;
}
.pdf-dialog.is-closing::backdrop {
  opacity: 0;
}
.dialog-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: radial-gradient(120% 80% at 50% -8%, rgba(223, 178, 113, 0.05), transparent 70%), rgba(10, 8, 7, 0.98);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.01);
}
.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialog-title-icon {
  color: var(--accent);
}
.dialog-title {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialog-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surf-2);
  border: 1px solid var(--line-1);
  color: var(--text-2);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.dialog-close-btn:hover {
  transform: rotate(90deg);
  background: var(--surf-4);
  border-color: var(--accent);
  color: var(--text-1);
}
.dialog-body {
  flex-grow: 1;
  width: 100%;
  background: #050403;
  position: relative;
}
.dialog-iframe-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.dialog-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Project lightbox ─────────────────────────────────────────────────── */
.project-dialog {
  height: auto;
  max-height: 88vh;
  max-width: min(92vw, 760px);
}
.project-dialog .dialog-content {
  height: auto;
  max-height: 88vh;
}
.project-dialog__outcome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-dialog__outcome::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.project-dialog__body {
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow-y: auto;
}
.project-dialog__media {
  display: flex;
  justify-content: center;
  background: #000;
  border-bottom: 1px solid var(--line-1);
}
.project-dialog__embed {
  border: 0;
  width: min(100%, 504px);
  display: block;
}
.project-dialog__img {
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
  display: block;
  background: #000;
}
.project-dialog__info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px clamp(16px, 3vw, 24px) clamp(18px, 3vw, 24px);
}
.project-dialog__desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-2);
}
.project-dialog__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-dialog__tags .project-card__tag {
  font-size: 10.5px;
  padding: 3px 9px;
}
.project-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.proj-dialog__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-btn);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--line-2);
  background: var(--surf-2);
  color: var(--text-1);
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out), filter 0.18s var(--ease-out);
}
.proj-dialog__btn:not(.proj-dialog__btn--primary):hover {
  background: var(--surf-4);
  border-color: var(--accent);
}
.proj-dialog__btn--primary {
  background: var(--gold-gradient);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--on-accent);
}
.proj-dialog__btn--primary:hover {
  background: var(--gold-gradient);
  filter: brightness(1.06);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ── Digital business card modal (real business-card format) ──────────── */
.business-card-dialog {
  max-width: 520px;
  height: auto;
}
.business-card-dialog .dialog-content {
  height: auto;
}
.bizcard-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
}

/* The physical card face */
.bizcard {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 22px 24px;
  border-radius: 16px;
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(223, 178, 113, 0.12), transparent 44%),
    linear-gradient(155deg, var(--surf-3), var(--surf-1));
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
/* gold-foil hairline border */
.bizcard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, var(--accent) 0%, rgba(223, 178, 113, 0.14) 38%, rgba(255, 255, 255, 0.05) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
/* large faint serif monogram watermark */
.bizcard__monogram {
  position: absolute;
  right: -6px;
  bottom: -40px;
  z-index: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 150px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}
.bizcard__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.bizcard__avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 2px;
  background: var(--gold-gradient);
  box-shadow: 0 0 22px -6px var(--accent-glow);
}
.bizcard__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  display: block;
}
.bizcard__id {
  min-width: 0;
}
.bizcard__name {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-1);
}
.bizcard__role {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.bizcard__divider {
  position: relative;
  z-index: 1;
  height: 1px;
  margin: 18px 0 16px;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent-dark) 62%, transparent);
  opacity: 0.5;
}
.bizcard__contacts {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.bizcard__item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.16s var(--ease-out);
}
.bizcard__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bizcard__item:hover {
  color: var(--text-1);
}
.bizcard__item svg {
  color: var(--accent);
  flex-shrink: 0;
}
.card-cta {
  width: 100%;
  margin: 0;
}

/* ════════════════════════ EFFECTS & A11Y ════════════════════════════════ */
/* ── Aurora background ────────────────────────────────────────────────── */
.stage-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 16% -4%, rgba(223, 178, 113, 0.08) 0%, transparent 56%),
    radial-gradient(110% 90% at 102% 104%, rgba(157, 115, 59, 0.06) 0%, transparent 52%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-color: var(--bg-0);
  animation: bg-fade-in 1.2s var(--ease-soft) both;
}
@keyframes bg-fade-in {
  from {
    opacity: 0;
  }
}
.bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.bloom--1 {
  width: 65vmax;
  height: 65vmax;
  left: -15vmax;
  top: -18vmax;
  background: radial-gradient(circle, rgba(223, 178, 113, 0.12) 0%, transparent 64%);
  animation: drift1 48s ease-in-out infinite alternate;
}
.bloom--2 {
  width: 60vmax;
  height: 60vmax;
  right: -15vmax;
  bottom: -20vmax;
  background: radial-gradient(circle, rgba(157, 115, 59, 0.08) 0%, transparent 64%);
  animation: drift2 56s ease-in-out infinite alternate;
}
@keyframes drift1 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(6vmax, 4vmax, 0) scale(1.1);
  }
}
@keyframes drift2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-5vmax, -3vmax, 0) scale(1.08);
  }
}

/* (noise grain overlay removed — it rendered as faint vertical lines over flat areas) */

/* ── Glass material ───────────────────────────────────────────────────── */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--blur-panel)) saturate(var(--sat));
  backdrop-filter: blur(var(--blur-panel)) saturate(var(--sat));
  border: 1px solid transparent;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-glass), var(--sh-inner-hi);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--line-top) 0%, var(--line-1) 40%, var(--line-bot) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
/* Chat panel: drop the warm glass hairline (it read as a faint gold line beside the
   portrait). The panel stays defined via its box-shadow (--shadow-glass + --sh-inner-hi). */
.chat.glass::before {
  display: none;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background: #0f0d0c;
  }
}
@supports (corner-shape: squircle) {
  .glass,
  .composer,
  .pill,
  .topic,
  .project-card,
  .act,
  .chip {
    corner-shape: squircle;
  }
}

/* ── Portrait hero ────────────────────────────────────────────────────── */
.portrait {
  position: relative;
  width: clamp(220px, 22vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: visible;
  background: var(--surf-3);
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 0 70px -14px var(--accent-glow), var(--shadow-float);
  animation: float-hero 9s ease-in-out infinite;
  will-change: transform;
  transition: transform 0.4s var(--ease-spring);
}
.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 50%;
  z-index: 1;
}
.portrait__scrim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 120% at 50% 32%, transparent 52%, rgba(6, 5, 4, 0.65) 100%),
    linear-gradient(180deg, rgba(223, 178, 113, 0.12) 0%, transparent 34%);
}
/* rotating gold ring around portrait + header avatar */
.portrait::before,
.chat__header .avatar--photo::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  padding: 4px;
  z-index: 3;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    var(--accent) 0deg,
    transparent 90deg,
    var(--accent-dark) 200deg,
    transparent 280deg,
    var(--accent) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  animation: ring-spin-anim 9s linear infinite;
}
.chat__header .avatar--photo::before {
  inset: -3px;
  padding: 3px;
  animation-duration: 7s;
}
@keyframes ring-spin-anim {
  to {
    transform: rotate(360deg);
  }
}
@keyframes float-hero {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* ── Entrance reveal ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  animation: reveal-anim 0.8s var(--ease-out) both;
  animation-delay: calc(100ms + var(--i, 0) * 70ms);
}
.portrait.reveal,
.chat.reveal {
  animation-timing-function: var(--ease-spring-lg);
}
@keyframes reveal-anim {
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* ── Focus rings ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);
  border-radius: 12px;
}
.pill:focus-visible,
.topic:focus-visible,
.act:focus-visible {
  border-radius: 999px;
}
.composer__input:focus-visible {
  box-shadow: none;
}

/* ── Liquid glass cursor light + refraction (desktop) ─────────────────── */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .chat:hover::after {
    opacity: 1;
  }
  .chat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-float);
  }
  .portrait:hover {
    animation-play-state: paused;
    transform: scale(1.025);
  }
  @supports ((backdrop-filter: url(#lg-refraction)) or (-webkit-backdrop-filter: url(#lg-refraction))) {
    .chat {
      -webkit-backdrop-filter: url(#lg-refraction) blur(calc(var(--blur-panel) - 8px)) saturate(var(--sat));
      backdrop-filter: url(#lg-refraction) blur(calc(var(--blur-panel) - 8px)) saturate(var(--sat));
    }
  }
}

/* ════════════════════════════ RESPONSIVE ════════════════════════════════ */
@media (max-width: 1023px) {
  .layout {
    grid-template-columns: minmax(280px, 40fr) minmax(380px, 60fr);
    gap: clamp(24px, 3vw, 40px);
  }
}

@media (max-width: 767px) {
  :root {
    --blur-panel: 18px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 0;
    gap: 0;
  }
  .identity {
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-top));
    justify-content: flex-start;
    overflow: visible;
    background: rgba(6, 5, 4, 0.7);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line-1);
    z-index: 10;
  }
  .identity__text {
    gap: 3px;
    flex: 1;
    min-width: 0;
  }
  .portrait {
    width: 52px;
    height: 52px;
    flex: none;
    animation: none;
    box-shadow: 0 0 0 1px var(--line-2) inset, 0 0 18px -6px var(--accent-glow);
  }
  .portrait::before {
    inset: -2px;
    padding: 2px;
  }
  .name {
    font-size: 22px;
  }
  .positioning {
    font-size: 12px;
    max-width: none;
  }
  .proof,
  .chips {
    display: none;
  }
  .availability {
    font-size: 11px;
  }
  .projects-container {
    flex-basis: 100%;
    margin-top: 10px;
    gap: 10px;
  }
  .projects-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .projects-grid::-webkit-scrollbar {
    display: none;
  }
  .project-card {
    width: 240px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .project-card__thumb {
    aspect-ratio: 16/9;
  }
  .project-card__content {
    padding: 10px 12px 12px;
    gap: 6px;
  }
  .project-card__title {
    font-size: 13.5px;
  }
  .project-card__tag {
    font-size: 9px;
    padding: 2px 6px;
  }
  .project-card__view {
    font-size: 11px;
  }
  .certs-container {
    flex-basis: 100%;
    margin-top: 6px;
    gap: 8px;
  }
  .certs-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .certs-grid::-webkit-scrollbar {
    display: none;
  }
  .cert-card {
    width: 170px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .presentation-fab {
    display: none;
  }
  .btn--presentation {
    padding: 10px 16px;
    font-size: 12.5px;
    border-radius: 10px;
  }
  .chat {
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border: none;
  }
  .chat::before,
  .chat::after {
    display: none;
  }
  .chat__scroll {
    padding: 16px;
  }
  .tray {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .topics,
  .pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .topics::-webkit-scrollbar,
  .pills::-webkit-scrollbar {
    display: none;
  }
  .pill,
  .topic {
    white-space: nowrap;
    flex: none;
  }
  .msg {
    max-width: 92%;
  }
  /* Fullscreen modals on mobile */
  .pdf-dialog {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .dialog-content {
    border: none !important;
    border-radius: 0 !important;
  }
  /* Business card: center the card face on the fullscreen sheet */
  .bizcard-body {
    flex: 1;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
  }
  .bizcard__name {
    font-size: 22px;
  }
  .bizcard__monogram {
    font-size: 120px;
  }
}

@media (max-width: 480px) {
  .availability {
    display: none;
  }
}

/* ── Reduced transparency → opaque ────────────────────────────────────── */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-bg: #0e0c0a;
    --glass-bg-strong: #141210;
    --bubble-ai: #141210;
    --surf-2: #0e0c0a;
    --surf-3: #141210;
  }
  .glass,
  .composer,
  .act {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .chat::after {
    display: none;
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .bloom,
  .portrait {
    animation: none !important;
  }
  .portrait::before,
  .chat__header .avatar--photo::before {
    animation: none !important;
    background: var(--gold-gradient);
  }
  .chat::after {
    display: none;
  }
  .chat:hover,
  .portrait:hover {
    transform: none;
  }
}
