/* =============================================
   DR. MARIE MARTIN — DIGITAL TWIN
   Design: Academic / Equity-Forward
   Burgundy · Gold · Ivory · Charcoal
   ============================================= */

:root {
  --burgundy:      #5c1a2e;
  --burgundy-mid:  #7a2340;
  --burgundy-light:#9e3455;
  --gold:          #c9a84c;
  --gold-light:    #e2c470;
  --ivory:         #f8f4ec;
  --ivory-dark:    #ede8de;
  --charcoal:      #1c1c1e;
  --charcoal-mid:  #2c2c2e;
  --text:          #3a3028;
  --text-light:    #6e5f52;
  --text-muted:    #9e8e80;
  --white:         #ffffff;
  --font-head:     'Playfair Display', Georgia, serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:        8px;
  --radius-lg:     16px;
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm:     0 2px 8px rgba(92,26,46,0.10);
  --shadow-md:     0 8px 32px rgba(92,26,46,0.15);
  --shadow-lg:     0 24px 80px rgba(92,26,46,0.20);
}

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

html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -0.01em; color: var(--charcoal); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; }
p { margin-bottom: 1rem; color: var(--text-light); }
a { color: var(--burgundy-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

::selection { background: rgba(201,168,76,0.25); color: var(--charcoal); }

/* ===================== HEADER ===================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(92, 26, 46, 0.97);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(201,168,76,0.20);
  padding: 0 2rem;
  transition: all var(--transition);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.header-brand {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: 0.01em;
}
.header-brand span { color: var(--gold); }
.header-nav { display: flex; gap: 1.75rem; align-items: center; }
.header-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(248,244,236,0.75);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.header-nav a:hover, .header-nav a.active { color: var(--gold); }
.header-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.header-toggle span { display: block; width: 22px; height: 2px; background: var(--ivory); border-radius: 2px; }

/* ===================== HERO ===================== */
.hero {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--burgundy) 0%, var(--burgundy-mid) 40%, #3d0f1d 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-content {
  max-width: 800px; text-align: center; position: relative; z-index: 1;
}
.hero-badge {
  display: inline-block;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1.2rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.hero h1 { color: var(--ivory); margin-bottom: 0.5rem; }
.hero h1 span { color: var(--gold); }
.hero-title-sub {
  color: rgba(248,244,236,0.75);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 1rem;
}
.hero-credentials {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
  margin: 1.25rem 0 1.75rem;
}
.hero-cred {
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
}
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem;
  margin: 1.5rem 0 2rem;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.hero-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248,244,236,0.60);
}
.hero-tagline {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-style: italic;
  color: rgba(248,244,236,0.90);
  margin-bottom: 2.5rem;
}
.hero-tagline strong { color: var(--gold); font-style: normal; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--gold);
  color: var(--burgundy);
}
.btn-primary:hover { background: var(--gold-light); color: var(--burgundy); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent;
  color: var(--ivory);
  border: 1.5px solid rgba(248,244,236,0.35);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ===================== SECTIONS ===================== */
.section { max-width: 1200px; margin: 0 auto; padding: 5rem 2rem; }
.section-full { background: var(--ivory-dark); }
.section-label {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.section-label::after {
  content: ''; flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--gold), transparent);
  max-width: 60px;
}
.section-title { color: var(--charcoal); margin-bottom: 1rem; }
.section-subtitle { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 680px; }

/* ===================== LEVER PILLARS ===================== */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.pillar {
  background: var(--white);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(201,168,76,0.3); }
.pillar-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-mid));
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.pillar-num { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.pillar h3 { color: var(--burgundy); margin-bottom: 0.75rem; font-size: 1.1rem; }
.pillar p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* ===================== RESEARCH CARDS ===================== */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.research-card {
  background: var(--white);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.research-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(201,168,76,0.3); }
.research-card-tag {
  display: inline-block;
  background: rgba(92,26,46,0.08);
  color: var(--burgundy);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}
.research-card h3 { color: var(--charcoal); margin-bottom: 0.75rem; }
.research-card p { font-size: 0.9rem; }
.card-link { font-size: 0.85rem; font-weight: 600; color: var(--burgundy-mid); }
.card-link:hover { color: var(--gold); }

/* ===================== IMPACT ===================== */
.impact-bg { background: linear-gradient(160deg, var(--burgundy) 0%, var(--burgundy-mid) 100%); }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }
.impact-item { text-align: center; }
.impact-num {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.impact-label { font-size: 0.8rem; font-weight: 500; color: rgba(248,244,236,0.70); letter-spacing: 0.04em; }

/* ===================== TIMELINE ===================== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}
.timeline-item { position: relative; padding-left: 2rem; padding-bottom: 2.5rem; }
.timeline-dot {
  position: absolute; left: -2.4rem; top: 0.4rem;
  width: 12px; height: 12px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.25);
}
.timeline-year {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.timeline-item h3 { color: var(--charcoal); margin-bottom: 0.5rem; font-size: 1rem; }
.timeline-item p { font-size: 0.9rem; margin: 0; }

/* ===================== CHAT ===================== */
.chat-wrapper {
  background: linear-gradient(180deg, var(--ivory-dark) 0%, var(--ivory) 100%);
  padding: 5rem 2rem;
}
.chat-container {
  max-width: 800px; margin: 0 auto;
}
.chat-box {
  background: var(--white);
  border: 1px solid rgba(201,168,76,0.20);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.chat-header {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-mid));
  padding: 1.25rem 1.5rem;
}
.chat-avatar {
  width: 46px; height: 46px;
  background: var(--gold);
  color: var(--burgundy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-header-info h3 { color: var(--ivory); font-size: 1rem; margin: 0 0 0.15rem; }
.chat-status { font-size: 0.75rem; color: var(--gold-light); }
.chat-messages {
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--ivory-dark); border-radius: 2px; }

.msg { display: flex; gap: 0.75rem; }
.msg.user { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 80%;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.msg.assistant .msg-bubble {
  background: var(--ivory);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: var(--burgundy);
  color: var(--ivory);
  border-bottom-right-radius: 4px;
}
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}
.msg.assistant .msg-avatar { background: var(--gold); color: var(--burgundy); }
.msg.user .msg-avatar { background: var(--ivory-dark); color: var(--text); }

.typing-indicator { display: flex; gap: 4px; padding: 0.85rem 1.1rem; background: var(--ivory); border-radius: 14px; border-bottom-left-radius: 4px; width: fit-content; }
.typing-dot { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: typing-bounce 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }

.chat-input-row {
  display: flex; gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--ivory-dark);
  background: var(--white);
}
.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--ivory);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color var(--transition);
}
.chat-input:focus { outline: none; border-color: var(--gold); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send {
  padding: 0.75rem 1.5rem;
  background: var(--burgundy);
  color: var(--ivory);
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.chat-send:hover { background: var(--burgundy-mid); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-prompts {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.25rem;
}
.prompt-chip {
  background: var(--white);
  border: 1px solid rgba(201,168,76,0.30);
  color: var(--burgundy-mid);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}
.prompt-chip:hover { background: var(--burgundy); color: var(--gold); border-color: var(--burgundy); }

/* ===================== PUBLICATIONS ===================== */
.pub-list { display: flex; flex-direction: column; gap: 1.25rem; }
.pub-item {
  background: var(--white);
  border: 1px solid var(--ivory-dark);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}
.pub-item:hover { border-left-color: var(--burgundy); box-shadow: var(--shadow-sm); }
.pub-journal { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.35rem; }
.pub-title { font-family: var(--font-head); font-size: 1rem; color: var(--charcoal); font-weight: 600; margin-bottom: 0.5rem; }
.pub-meta { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ===================== FOOTER ===================== */
footer {
  background: var(--charcoal);
  color: rgba(248,244,236,0.55);
  text-align: center;
  padding: 3rem 2rem;
  font-size: 0.85rem;
  line-height: 1.8;
}
footer a { color: var(--gold-light); }
footer a:hover { color: var(--gold); }

/* ===================== ANIMATIONS ===================== */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ===================== MOBILE ===================== */
@media (max-width: 768px) {
  .header-nav { display: none; flex-direction: column; position: fixed; top: 58px; left: 0; right: 0; background: var(--burgundy); padding: 1.5rem 2rem; gap: 1.25rem; border-bottom: 1px solid rgba(201,168,76,0.2); }
  .header-nav.open { display: flex; }
  .header-toggle { display: flex; }
  .hero { padding: 5rem 1.5rem 3rem; }
  .hero-credentials { gap: 0.35rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .pillars, .research-grid { grid-template-columns: 1fr; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { padding-left: 1.25rem; }
  .chat-prompts { display: none; }
}
