:root {
  --accent-hue: 150;
  --accent-chroma: 0.085;
  --bg: #16140f;
  --bg-soft: #1f1c16;
  --ink: #e8e2d2;
  --ink-dim: #9b9486;
  --ink-faint: #5f5a51;
  --line: rgba(255,255,255,0.04);
  --line-strong: rgba(255,255,255,0.08);
  --line-bold: rgba(255,255,255,0.14);
  --grid-line: rgba(255,255,255,0.025);
  --scan-line: rgba(255,255,255,0.008);
  --vignette: rgba(0,0,0,0.7);
  --panel: rgba(12,9,8,0.95);
  --panel-fab: rgba(12,9,8,0.85);
  --hud-bg: rgba(0,0,0,0.55);
  --halo-mode: dark;
  --accent: oklch(0.74 var(--accent-chroma) var(--accent-hue));
  --accent-soft: oklch(0.74 var(--accent-chroma) var(--accent-hue) / 0.16);
  --accent-glow: oklch(0.86 var(--accent-chroma) var(--accent-hue));
}

/* ————————————————————————————————————————
   Themes
———————————————————————————————————————— */

[data-theme="obsidian"] {
  /* defaults — warm black */
}

[data-theme="ivory"] {
  --bg: #f4f0e6;
  --bg-soft: #ebe5d4;
  --ink: #1a1814;
  --ink-dim: #6a635a;
  --ink-faint: #a6a097;
  --line: rgba(0,0,0,0.06);
  --line-strong: rgba(0,0,0,0.12);
  --line-bold: rgba(0,0,0,0.22);
  --grid-line: rgba(0,0,0,0.035);
  --scan-line: rgba(0,0,0,0.012);
  --vignette: rgba(120,100,60,0.18);
  --panel: rgba(252,248,238,0.96);
  --panel-fab: rgba(252,248,238,0.88);
  --hud-bg: rgba(255,252,244,0.7);
  --halo-mode: light;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono, .chip-meta, .msg-tag, .hud-label, .starter, .composer-prompt, .composer-send, .footmeta, .brand, .divider, .tweaks .mono {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ————————————————————————————————————————
   Layout
———————————————————————————————————————— */

.shell {
  position: relative;
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 32px;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.home-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.home-link:hover { color: var(--accent); }
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 60%, 100% { opacity: 1; } 30% { opacity: 0.35; } }

.nav {
  display: flex; gap: 12px; align-items: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  justify-self: center;
}
.chip-meta { text-transform: uppercase; }
.divider { color: var(--ink-faint); }

.links {
  display: flex; gap: 18px;
  justify-self: end;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.links a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}
.links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: var(--accent); transform: scaleX(0);
  transform-origin: left; transition: transform 0.3s;
}
.links a:hover { color: var(--ink); }
.links a:hover::after { transform: scaleX(1); }

/* ————————————————————————————————————————
   Stage
———————————————————————————————————————— */

.stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 24px 32px;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .stage { padding: 16px; }
}

/* Greeting-state halo (centered above name when no messages yet) */
.greeting-halo {
  width: 80px;
  height: 80px;
  margin: 0 auto 28px;
  display: block;
}
.greeting { text-align: center; padding: 32px 0; }
.greeting-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.greeting-name {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0 auto 18px;
  line-height: 1;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: none;
}
.greeting-sub {
  font-size: 15px;
  color: var(--ink);
  opacity: 0.85;
  margin: 0 auto;
  line-height: 1.6;
  max-width: 44ch;
}
.greeting-hud {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 16px;
}

/* Tiny halo embedded in the composer as a state indicator */
.composer-halo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-right: 4px;
  display: block;
}

.hud-label {
  /* inherits */
}
.halo-hud {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink);
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  background: var(--hud-bg);
  backdrop-filter: blur(4px);
}

/* ————————————————————————————————————————
   Prompt + conversation
———————————————————————————————————————— */

.prompt-zone {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 16px 0;
  width: 100%;
  max-width: 720px;
}

.conversation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.conversation::-webkit-scrollbar { width: 4px; }
.conversation::-webkit-scrollbar-thumb { background: var(--ink-faint); }

/* When there are no messages yet, center the greeting vertically so it
   sits between the topbar and the composer instead of pinning to the top. */
.conversation.empty { justify-content: center; }

.msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-tag {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
}
.msg-user .msg-tag { color: var(--accent); }

.msg-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 58ch;
  text-wrap: pretty;
}
.msg-user .msg-body {
  color: var(--ink-dim);
}

.caret {
  display: inline-block;
  color: var(--accent);
  margin-left: 2px;
  animation: caret 0.9s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.voice-toggle {
  background: transparent;
  border: 1px solid var(--line-bold);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.voice-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ————————————————————————————————————————
   Composer
———————————————————————————————————————— */

.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  background: color-mix(in oklab, var(--ink) 3%, transparent);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.composer::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.composer:focus-within::before { opacity: 0.6; }
.composer:focus-within {
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  box-shadow: 0 0 40px var(--accent-soft);
}

.composer-prompt {
  color: var(--accent);
  font-size: 14px;
}
.composer-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.01em;
  padding: 0;
}
.composer-input::placeholder { color: var(--ink-faint); }

.composer-send {
  background: transparent;
  border: 1px solid var(--line-bold);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.22em;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.composer-send:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.composer-send:disabled { opacity: 0.4; cursor: not-allowed; }

.starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.starter {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: none;
  font-family: inherit;
}
.starter:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--ink);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
}
.starter:disabled { opacity: 0.3; cursor: not-allowed; }

.starters.followups {
  align-items: center;
  margin-top: 4px;
}
.followups-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-right: 4px;
}
.starters.followups .starter {
  font-size: 11.5px;
  padding: 6px 11px;
  opacity: 0.9;
}

/* ————————————————————————————————————————
   Print / PDF export of the resume document
   When the user hits the download button we temporarily add
   .printing-resume to <body>, fire window.print(), then remove it.
   Everything below targets either @media print OR .printing-resume so
   the same rules cover both Save-as-PDF and the live print dialog.
———————————————————————————————————————— */

@media print {
  @page { margin: 0.5in; }

  /* Unwind every height/overflow constraint so the doc paginates naturally.
     Without this, the resume-doc keeps its scroll container and the
     "Save as PDF" output is just whatever happens to be in the viewport. */
  html, body, #root {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: white !important;
    color: black !important;
  }
  body { display: block !important; }
  .shell {
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    background: white !important;
  }

  /* Hide every element by default... */
  body * { visibility: hidden !important; }
  /* ...then re-show only the resume panel + its contents. */
  .resume-panel, .resume-panel * { visibility: visible !important; }

  .resume-panel {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    border: none !important;
    background: white !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .resume-panel-toolbar { display: none !important; }

  .resume-doc-wrap {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    flex: none !important;
    display: block !important;
    padding: 0 !important;
  }

  .resume-doc {
    position: static !important;
    flex: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    border: none !important;
    background: white !important;
    color: black !important;
    padding: 0 !important;
    font-size: 11pt;
    line-height: 1.45;
  }
  .resume-doc-hud { display: none !important; }

  /* Strip transient UI: spotlight + visited/active highlights */
  .cite-spotlight { display: none !important; }
  .doc-line.cited, .doc-line.cited-active {
    background: transparent !important;
    color: black !important;
  }

  /* Pagination */
  .doc-section { margin-bottom: 12px; page-break-inside: avoid; }
  .doc-job, .doc-job-compact { page-break-inside: avoid; }
  .doc-bullets li { page-break-inside: avoid; }

  /* Monochrome paper palette */
  .doc-name { color: black !important; font-size: 22pt; }
  .doc-h { color: #444 !important; border-color: #999 !important; }
  .doc-role, .doc-degree, .doc-proj-name { color: black !important; }
  .doc-co, .doc-skills dd, .doc-projects li, .doc-bullets li { color: #222 !important; }
  .doc-period, .doc-period-inline, .doc-meta { color: #555 !important; }
  .doc-bullets li::before { color: #555 !important; }
  .doc-tag { color: #444 !important; border-color: #999 !important; }
}

/* ————————————————————————————————————————
   Footer
———————————————————————————————————————— */

.footmeta {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 12px;
  padding: 14px 32px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
}

/* ————————————————————————————————————————
   Ambient effects
———————————————————————————————————————— */

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--vignette) 100%);
  z-index: 1;
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    var(--scan-line) 0px,
    var(--scan-line) 1px,
    transparent 1px,
    transparent 4px
  );
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ————————————————————————————————————————
   Tweaks panel
———————————————————————————————————————— */

.settings-fab {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--panel-fab);
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 19;
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s, transform 0.4s;
}
.settings-fab:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}

.tweaks-foot {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid var(--line-strong);
}

.tweaks {
  position: fixed;
  right: 20px; bottom: 68px;
  width: 280px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  padding: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12px;
}
.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-dim);
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
}
.tweaks-head button {
  background: none; border: none; color: var(--ink-dim); cursor: pointer;
  font-size: 18px; line-height: 1;
}
.tweak-row { display: flex; flex-direction: column; gap: 8px; }
.tweak-row label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.seg { display: flex; gap: 4px; }
.seg button {
  flex: 1;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  padding: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
}
.seg button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.tweak-row input[type="range"] { width: 100%; accent-color: var(--accent); }

.hue-presets { display: flex; gap: 6px; margin-top: 4px; }
.hue-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line-bold);
  cursor: pointer;
  padding: 0;
}

.tweak-row input[type="checkbox"] { accent-color: var(--accent); margin-right: 6px; }

.tweak-collapse { padding: 0; }
.tweak-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 0;
}
.tweak-collapse > summary::-webkit-details-marker { display: none; }
.tweak-collapse-caret { transition: transform 0.15s; }
.tweak-collapse[open] .tweak-collapse-caret { transform: rotate(180deg); }
.tweak-collapse-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}
.tweak-collapse-body .mini-preview { align-self: flex-end; }

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.theme-swatch-chip {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}
.theme-swatch-dot {
  width: 6px; height: 6px; border-radius: 50%;
  opacity: 0.7;
}
.theme-swatch:hover .theme-swatch-chip {
  border-color: var(--ink-dim);
}
.theme-swatch:hover { color: var(--ink-dim); }
.theme-swatch.on .theme-swatch-chip {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.theme-swatch.on { color: var(--accent); }

.persona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.persona-card {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s, color 0.15s;
}
.persona-card:hover { border-color: var(--ink-dim); color: var(--ink); }
.persona-card.on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.persona-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.persona-blurb {
  font-family: "Inter Tight", sans-serif;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
  line-height: 1.3;
}

.voice-select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
}
.voice-select:focus { outline: none; border-color: var(--accent); }
.voice-hint {
  font-family: "Inter Tight", sans-serif;
  font-size: 10px;
  color: var(--ink-faint);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}

.mini-preview {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 8px;
  cursor: pointer;
}
.mini-preview:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mini-preview:disabled { opacity: 0.4; cursor: not-allowed; }

.premium-row label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.badge-live, .badge-off {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  padding: 1px 5px;
  margin-left: 6px;
  border: 1px solid currentColor;
}
.badge-live { color: var(--accent); }
.badge-off { color: var(--ink-faint); }
.premium-row input[type="text"] { margin-bottom: 4px; }
.voice-hint code {
  font-family: "IBM Plex Mono", monospace;
  background: var(--bg-soft);
  padding: 1px 4px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

/* ————————————————————————————————————————
   Career timeline (replaces the HAL eye)
———————————————————————————————————————— */

.timeline {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 24px 20px;
}

.timeline-rail {
  position: relative;
  height: 96px;
  margin: 0 18px;
}

.timeline-spine {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--line-bold) 8%,
    var(--line-bold) 92%,
    transparent 100%
  );
}

.timeline-node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-dim);
  transition: color 0.15s;
}
.timeline-node:hover,
.timeline-node:focus-visible {
  color: var(--ink);
  outline: none;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--ink-faint);
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.timeline-node:hover .timeline-dot,
.timeline-node:focus-visible .timeline-dot {
  border-color: var(--ink-dim);
  transform: scale(1.2);
}
.timeline-node.is-active .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-label {
  position: absolute;
  top: calc(50% + 14px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.timeline-label-company { color: inherit; }
.timeline-label-period { color: var(--ink-faint); font-size: 8.5px; }

/* Pulse when the chat reply names this role's company. */
.timeline-node.is-pulsing .timeline-dot {
  animation: pulse-accent 1.2s ease-out 1;
}
@keyframes pulse-accent {
  0%   { box-shadow: 0 0 0 0   var(--accent-soft), 0 0 0 0 var(--accent-soft); }
  40%  { box-shadow: 0 0 0 12px transparent,        0 0 24px 6px var(--accent-soft); }
  100% { box-shadow: 0 0 0 4px var(--accent-soft),  0 0 0 0 transparent; }
}

.timeline-card {
  border: 1px solid var(--line-strong);
  background: color-mix(in oklab, var(--ink) 3%, transparent);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: card-in 0.35s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.timeline-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.timeline-card-period { color: var(--accent); }
.timeline-card-divider { color: var(--ink-faint); }
.timeline-card-company { color: var(--ink); }

.timeline-card-role {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}

.timeline-card-summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 56ch;
  text-wrap: pretty;
}

.timeline-card-bullets {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.timeline-card-bullets li {
  position: relative;
  padding-left: 14px;
}
.timeline-card-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 1px;
  background: var(--ink-faint);
}

.timeline-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.timeline-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 3px 7px;
}

/* ————————————————————————————————————————
   Resume document panel (slide-in from left)
———————————————————————————————————————— */

.resume-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(520px, 45vw);
  z-index: 10;
  background: var(--bg);
  border-right: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  padding: 0;
  /* transform is controlled inline from React; transition runs the slide */
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* When resume is visible, shift the rest of the shell over */
.shell.resume-visible .stage,
.shell.resume-visible .topbar,
.shell.resume-visible .footmeta {
  margin-left: min(520px, 45vw);
  transition: margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Fullscreen mode: resume covers everything */
.shell.resume-fullscreen .resume-panel {
  width: 100%;
  border-right: none;
}
.shell.resume-fullscreen .stage,
.shell.resume-fullscreen .topbar,
.shell.resume-fullscreen .footmeta {
  opacity: 0;
  pointer-events: none;
}

.resume-panel-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 0;
  flex-shrink: 0;
}
.resume-panel-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.resume-panel-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.resume-panel .resume-doc-wrap {
  flex: 1;
  min-height: 0;
  padding: 8px 16px 16px;
}

/* RESUME button in the topbar */
.resume-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line-bold);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.resume-toggle:hover,
.resume-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Resume document */
.resume-doc-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.resume-doc {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  padding: 28px 32px 36px;
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
  isolation: isolate;
}
.resume-doc::-webkit-scrollbar { width: 4px; }
.resume-doc::-webkit-scrollbar-thumb { background: var(--ink-faint); }

.doc-header {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.doc-name {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--ink);
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}
.doc-meta a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.doc-meta a:hover { color: var(--accent); border-color: var(--accent); }
.doc-dot { color: var(--ink-faint); }

.doc-section { margin-bottom: 20px; }
.doc-h {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line-strong);
}

.doc-line {
  position: relative;
  transition: color 0.3s, opacity 0.3s;
  border-radius: 2px;
}

.doc-job { margin-bottom: 14px; }
.doc-job-compact { margin-bottom: 10px; }
.doc-job-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.doc-role { font-weight: 600; font-size: 15px; color: var(--ink); }
.doc-co { font-size: 14px; color: var(--ink-dim); }
.doc-period {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-top: 2px;
}
.doc-bullets { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; }
.doc-bullets li {
  position: relative;
  font-size: 13.5px;
  color: var(--ink);
  margin: 4px 0;
  padding: 2px 6px 2px 14px;
}
.doc-bullets li::before { content: "›"; position: absolute; left: 0; color: var(--ink-faint); }

.doc-job-compact p {
  font-size: 13.5px;
  color: var(--ink);
  margin: 6px 0 0;
  padding: 2px 6px;
}

.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.doc-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 2px 6px;
}

.doc-skills { margin: 0; display: grid; gap: 4px; }
.doc-skills > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 4px 6px;
}
.doc-skills dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
}
.doc-skills dd { margin: 0; font-size: 13.5px; color: var(--ink); }

.doc-projects { list-style: none; margin: 0; padding: 0; }
.doc-projects li { padding: 6px; font-size: 13.5px; }
.doc-proj-name { font-weight: 600; color: var(--ink); }
.doc-proj-desc { color: var(--ink-dim); }

.doc-degree { font-weight: 500; color: var(--ink); }
.doc-school { color: var(--ink-dim); font-size: 14px; }
.doc-period-inline {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.doc-line.cited-active { color: var(--ink) !important; }

.cite-spotlight {
  position: absolute;
  pointer-events: none;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 24px var(--accent-soft);
  border-radius: 2px;
  transition: top 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  mix-blend-mode: multiply;
}
[data-theme="obsidian"] .cite-spotlight {
  mix-blend-mode: screen;
}

.resume-doc-hud {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.resume-doc-hud .hud-cite { color: var(--accent); }

@media (max-width: 900px) {
  .resume-panel { width: 100vw; }
  .shell.resume-visible .stage,
  .shell.resume-visible .topbar,
  .shell.resume-visible .footmeta { margin-left: 0; }
  .shell.resume-visible:not(.resume-fullscreen) .stage { opacity: 0.05; pointer-events: none; }
}

/* ————————————————————————————————————————
   Mobile chat layout (≤ 720px)
———————————————————————————————————————— */
@media (max-width: 720px) {
  /* Topbar: stack brand + nav + actions vertically with smaller text */
  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px;
    text-align: center;
  }
  .topbar .nav { justify-self: stretch; justify-content: center; flex-wrap: wrap; }
  .topbar .links {
    justify-self: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .brand { justify-content: center; font-size: 11px; }

  /* Tighter stage padding */
  .stage { padding: 10px 12px; }

  /* Greeting: smaller halo, tighter spacing */
  .greeting { padding: 14px 0; }
  .greeting-halo { width: 64px; height: 64px; margin: 0 auto 12px; }
  .greeting-name { font-size: clamp(24px, 7vw, 32px); margin-bottom: 8px; }
  .greeting-sub { font-size: 14px; max-width: 32ch; }
  .greeting-kicker { font-size: 9px; letter-spacing: 0.22em; }

  /* Conversation: narrower bubbles, tighter type */
  .msg-body { font-size: 15px; max-width: 100%; }

  /* Composer: drop the inline halo (small enough to be noise on phone) */
  .composer-halo { display: none; }
  .composer { padding: 10px 12px; gap: 8px; }
  .composer-prompt { font-size: 13px; }
  .composer-input { font-size: 15px; }
  .composer-send {
    padding: 6px 10px;
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  /* Starter / follow-up rows wrap cleanly, smaller chips */
  .starters { gap: 6px; }
  .starter { font-size: 12px; padding: 7px 11px; }
  .starters.followups .starter { font-size: 11px; padding: 5px 9px; }
  .followups-label { font-size: 8.5px; letter-spacing: 0.18em; }

  /* Resume button: shrink slightly */
  .resume-toggle, .voice-toggle { font-size: 10px; padding: 4px 8px; letter-spacing: 0.14em; }

  /* Footer: smaller */
  .footmeta { font-size: 9.5px; padding: 10px 14px; letter-spacing: 0.18em; flex-wrap: wrap; }
}

/* Mobile: vertical timeline */
@media (max-width: 900px) {
  .timeline { gap: 16px; padding: 16px 8px; }
  .timeline-rail {
    height: auto;
    min-height: 180px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .timeline-spine {
    top: 0;
    bottom: 0;
    left: 14px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(
      180deg,
      transparent 0%,
      var(--line-bold) 8%,
      var(--line-bold) 92%,
      transparent 100%
    );
  }
  .timeline-node {
    position: relative;
    top: auto;
    left: 0 !important;
    transform: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding-left: 4px;
  }
  .timeline-node .timeline-label {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 8px;
    font-size: 10px;
  }
  .timeline-card-role { font-size: 18px; }
}

