/* ------------------------------------------------
   Jackie Jiang — Resume
   Tokens + Reset + Layout + Typography + Theme
   ------------------------------------------------ */

:root {
  --bg: #f5f3f0;
  --text: #1a1a1a;
  --text-secondary: #5c5753;
  --text-tertiary: #8a8480;
  --border: #ddd9d4;
  --selection-bg: #1a1a1a;
  --selection-fg: #f5f3f0;
}

[data-theme="dark"] {
  --bg: #0c0b0a;
  --text: #e8e4df;
  --text-secondary: #9a9590;
  --text-tertiary: #6b6662;
  --border: #2a2725;
  --selection-bg: #e8e4df;
  --selection-fg: #0c0b0a;
}

/* Reset */

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

/* Base */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.3s ease;
}


::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

/* Container */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 96px 24px 80px;
  position: relative;
  z-index: 2;
}

/* Content background mask — covers name/bio through footer, not banner */

.content-bg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  top: 140px;
  bottom: 0;
  background: radial-gradient(ellipse 450px 100% at 50% 50%, var(--bg) 70%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}


/* Banner */

.banner {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 40px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .banner {
  box-shadow:
    0 0 20px rgba(232, 228, 223, 0.04),
    0 0 60px rgba(232, 228, 223, 0.02);
}

/* Particle canvas */

.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}


/* Banner text */

.banner-text {
  position: relative;
  z-index: 1;
}

.daysi-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  vertical-align: middle;
  margin: 0 2px;
}

.daysi-logo {
  display: inline-block;
  vertical-align: middle;
}

.daysi-name {
  vertical-align: middle;
}

.external-icon {
  opacity: 0.4;
  vertical-align: middle;
}

.daysi-link:hover .external-icon {
  opacity: 1;
}

.daysi-dark { display: inline; }
.daysi-light { display: none; }

[data-theme="dark"] .daysi-dark { display: none; }
[data-theme="dark"] .daysi-light { display: inline; }

.banner a {
  color: var(--text);
  font-weight: 500;
}

/* Header */

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.bio {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 100%;
}

/* Theme Toggle */

.theme-toggle {
  appearance: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  margin: -8px -8px 0 0;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--border);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Toggle icon visibility */
.icon-moon { display: block; }
.icon-sun { display: none; }

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* Dividers */

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
  transition: border-color 0.3s ease;
}

/* Roles */

.role {
  margin-bottom: 40px;
}

.role:last-child {
  margin-bottom: 0;
}

.role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.role-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.role-title {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

time {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

ul {
  list-style: none;
  margin-top: 12px;
}

li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

li:last-child {
  margin-bottom: 0;
}

li::before {
  content: "\00B7";
  position: absolute;
  left: 2px;
  font-weight: 600;
}

/* Links */

a {
  color: var(--text);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--text-secondary);
}

/* Education */

.education p {
  font-size: 0.875rem;
  line-height: 1.65;
  margin-bottom: 4px;
}

.education p:last-child {
  margin-bottom: 0;
}

.education strong {
  font-weight: 500;
}

.education .sep {
  color: var(--text-secondary);
}

/* Footer */

.footer {
  font-size: 0.8125rem;
  position: relative;
  z-index: 2;
}

.footer-dot {
  color: var(--border);
  margin: 0 8px;
}

.footer a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-secondary);
}

/* Fade-in animation */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Chat bar — floating glass card */

.chat-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 600px;
  z-index: 10;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: background 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .chat-bar {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}


/* Chat thread */

.chat-thread {
  max-width: 100%;
  padding: 0 16px;
  max-height: 0;
  overflow-y: auto;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.chat-thread.visible {
  max-height: 260px;
  padding: 14px 16px 6px;
}

.chat-thread.collapsed {
  max-height: 0;
  padding: 0 16px;
}

/* Toggle button */

.chat-toggle {
  display: none;
  appearance: none;
  background: none;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  padding: 6px 0;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.3s ease;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .chat-toggle {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.chat-toggle:hover {
  color: var(--text);
}

.chat-toggle.active {
  display: flex;
}

.chat-toggle svg {
  transition: transform 0.25s ease;
}

.chat-toggle.flipped svg {
  transform: rotate(180deg);
}

.chat-toggle.flipped {
  border-top-color: transparent;
}

/* Bubbles */

.chat-bubble {
  font-size: 0.8125rem;
  line-height: 1.55;
  padding: 8px 12px;
  border-radius: 14px;
  max-width: 85%;
  margin-bottom: 8px;
  animation: bubbleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-user {
  background: var(--text);
  color: var(--bg);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-assistant {
  background: var(--border);
  color: var(--text);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.chat-assistant strong {
  font-weight: 500;
}

.chat-assistant code {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

[data-theme="dark"] .chat-assistant code {
  background: rgba(255, 255, 255, 0.08);
}

/* Typing indicator */

.chat-loading {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  min-height: 34px;
}

.chat-loading::before,
.chat-loading::after,
.chat-loading span {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingDot 1.2s ease-in-out infinite;
}

.chat-loading::after {
  animation-delay: 0.2s;
}

.chat-loading span {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30%            { opacity: 1;   transform: scale(1); }
}

/* Quick suggestion badges */

.chat-suggestions {
  display: flex;
  gap: 6px;
  padding: 8px 10px 2px;
  flex-wrap: wrap;
}

.chat-suggestions.hidden {
  display: none;
}

.chat-suggestion {
  appearance: none;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.chat-suggestion:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .chat-suggestion {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-suggestion:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Chat form — Claude-style rounded input */

.chat-form {
  padding: 6px 10px 10px;
  display: flex;
  gap: 0;
  align-items: center;
}

.chat-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
  font-size: 0.8125rem;
  color: var(--text);
  padding: 0;
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--text-secondary);
}

.chat-send {
  appearance: none;
  background: var(--text);
  border: none;
  color: var(--bg);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, background 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  opacity: 0.6;
}

.chat-send:hover {
  opacity: 1;
}

.chat-send:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Add bottom padding to container so content isn't hidden behind chat bar */
.container {
  padding-bottom: 100px !important;
}

/* Responsive */

@media (max-width: 480px) {
  .container {
    padding: 64px 20px 60px;
  }

  h1 {
    font-size: 1.5rem;
  }

  hr {
    margin: 36px 0;
  }

  .role {
    margin-bottom: 32px;
  }
}

/* Print — preserves current theme */

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: var(--bg) !important;
  }

  .banner,
  .theme-toggle,
  .particles,
  .content-bg,
  .footer,
  .chat-bar {
    display: none !important;
  }

  .banner + header {
    margin-top: 0;
  }

  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }

  .container {
    padding: 24px 0 0;
    max-width: none;
  }

  hr {
    margin: 32px 0;
  }

  .role {
    margin-bottom: 28px;
  }
}
