@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #F2F0EC;
  --surface: #FAFAF7;
  --border: #E2DED8;
  --text: #1C1C1A;
  --text-muted: #6B6860;
  --accent: #1B4332;
  --accent-light: #D8EDDF;
  --accent2: #2D6A4F;
  --tag-bg: #ECEAE5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
}

/* Rotating word - accent color (replaces gradient) */
.rw { color: var(--accent2); }
.grad { color: var(--text); }

.btn-g {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 24px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}
.btn-g:hover {
  background: var(--accent2);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--tag-bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  border: 1px solid var(--border);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
  position: relative;
}
.card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
}

.accent-bar {
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 0 0 2px 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover .accent-bar {
  opacity: 1;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 22px 60px;
  display: flex;
  align-items: center;
}

.nlogo {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
  cursor: pointer;
}

.page { padding-top: 60px; min-height: 100vh; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 72px 60px; }
.strip .wrap { padding-top: 96px; padding-bottom: 96px; }
.wrap-hero { padding: 80px 60px 70px; }
.wrap-sm { max-width: 740px; margin: 0 auto; padding: 72px 60px; }

/* Section headers - dot + title */
.sh {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sh::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.chat-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  background: var(--surface);
}

.chat-box-full {
  text-align: center;
  padding: 32px 24px;
  border-style: solid;
}

.chat-default-questions {
  margin-bottom: 24px;
}

.chat-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.85;
  margin: 16px 0 0;
}

.chat-question-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.chat-question-chip {
  padding: 10px 16px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chat-question-chip:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.chat-question-chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-messages {
  text-align: left;
  height: 540px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 16px 0;
  -webkit-overflow-scrolling: touch;
}

.chat-msg {
  margin-bottom: 16px;
}

.chat-msg:last-child { margin-bottom: 0; }

.chat-msg-user {
  text-align: right;
}

.chat-msg-user .chat-msg-content {
  display: inline-block;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px 12px 4px 12px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-msg-assistant .chat-msg-content {
  display: inline-block;
  padding: 12px 16px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  max-width: 100%;
  white-space: pre-wrap;
}

.chat-msg-assistant .chat-msg-content-md {
  display: block;
  white-space: normal;
}

.chat-msg-content-md h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 8px;
}

.chat-msg-content-md h2:first-child { margin-top: 0; }

.chat-msg-content-md p {
  margin: 0 0 10px;
  line-height: 1.65;
}

.chat-msg-content-md p:last-child { margin-bottom: 0; }

.chat-msg-content-md ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.chat-msg-content-md li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.chat-msg-content-md strong {
  font-weight: 600;
}

.chat-msg-content-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.chat-stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: chat-cursor-blink 1s step-end infinite;
}

@keyframes chat-cursor-blink {
  50% { opacity: 0; }
}

.chat-msg-streaming {
  transition: opacity 0.15s ease;
}

.chat-input-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.chat-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.chat-send {
  flex-shrink: 0;
}

.hgrid {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto auto;
  gap: 60px;
  align-items: center;
}

.hero-content { grid-column: 1; grid-row: 1; }
.hero-photo { grid-column: 2; grid-row: 1 / 3; }
.hero-cta { grid-column: 1; grid-row: 2; }

/* Hero label pill */
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.hero-label::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* Hero title - Playfair Display */
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.hero p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 8px;
}

/* Photo frame - warm slate style */
.ring {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--surface);
  box-shadow: 0 12px 40px rgba(27, 67, 50, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.ring-in {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.rmore {
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s;
}
.rmore:hover { color: var(--accent); }

.rw { display: inline-block; transition: opacity 0.35s ease, transform 0.35s ease; }
.rw.on { opacity: 1; transform: translateY(0); }
.rw.off { opacity: 0; transform: translateY(8px); }

/* Section divider */
.section-divider {
  height: 1px;
  background: var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

/* Strips - same as page bg, subtle borders */
.strip {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.strip-last { border-bottom: none; }

.footer-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 60px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 80px;
}

.ft { font-size: 12px; color: var(--text-muted); font-family: 'DM Sans', sans-serif; }
.fl {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}
.fl:hover { color: var(--accent); }

.section-anchor { scroll-margin-top: 60px; }

/* Resume section */
.resume-content { max-width: 640px; }
.resume-block { margin-bottom: 28px; }
.resume-block:last-child { margin-bottom: 0; }
.resume-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 14px;
}
.resume-item { margin-bottom: 20px; }
.resume-item:last-child { margin-bottom: 0; }
.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.resume-title { font-weight: 600; font-size: 15px; color: var(--text); }
.resume-meta { font-size: 13px; color: var(--text-muted); }
.resume-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  font-family: 'DM Sans', sans-serif;
  margin: 0;
}

/* Timeline for grouped roles */
.resume-timeline {
  position: relative;
  padding-left: 24px;
  margin-bottom: 20px;
}
.resume-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
.resume-timeline-item { position: relative; padding-bottom: 20px; }
.resume-timeline-item:last-child { padding-bottom: 0; }
.resume-timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-sizing: border-box;
}

/* Resume download link */
.resume-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.resume-download:hover { color: var(--accent2); }

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  z-index: 999;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
.nlogo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.nlogo { outline: none; }

/* Copy button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--accent); }
.copy-btn.copied { color: var(--accent); }

/* Card content padding */
.card-content { padding: 24px; }
.card-content-tight { padding: 18px 22px 22px; }

/* Card title styling */
.card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
}
.card p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.card .tag { margin-right: 6px; margin-bottom: 6px; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content { animation: fadeUp 0.6s ease forwards; }
.hero-photo { animation: fadeUp 0.6s 0.15s ease both; }
.pgrid .card { animation: fadeUp 0.5s ease both; }
.pgrid .card:nth-child(1) { animation-delay: 0.05s; }
.pgrid .card:nth-child(2) { animation-delay: 0.1s; }
.pgrid .card:nth-child(3) { animation-delay: 0.15s; }
.pgrid .card:nth-child(4) { animation-delay: 0.2s; }
.pgrid .card:nth-child(5) { animation-delay: 0.25s; }
#posts .card { animation: fadeUp 0.5s ease both; }

@media (max-width: 640px) {
  .hgrid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .hero-content,
  .hero-photo,
  .hero-cta {
    grid-column: 1;
    grid-row: auto;
  }

  .hero h1 {
    font-size: 42px;
  }

  .chat-question-chips { justify-content: flex-start; }

  .chat-input-wrap {
    flex-direction: column;
    max-width: 100%;
    width: 100%;
    gap: 12px;
  }

  .chat-input {
    width: 100%;
    min-height: 48px;
    padding: 14px 18px;
    font-size: 16px;
  }

  .chat-send {
    width: 100%;
    min-height: 48px;
    padding: 14px 20px;
    font-size: 16px;
    justify-content: center;
  }

  nav { padding: 22px 32px; }
  .wrap { padding: 64px 32px; }
  .strip .wrap { padding-top: 80px; padding-bottom: 80px; }
  .wrap-hero { padding: 56px 32px; }
  .hgrid { grid-template-columns: 1fr; gap: 36px; text-align: left; }
  .ring { margin: 0 auto; width: 220px; height: 220px; }
  .pgrid { grid-template-columns: 1fr; }
  #home .wrap-hero,
  #home .hgrid,
  #home .hgrid > div:first-child { text-align: left; }
  #home .hero-cta { text-align: center; }
  .resume-item-header { flex-direction: column; align-items: flex-start; }
  .footer-wrap { padding: 20px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rw { transition: none; }
  .chat-stream-cursor { animation: none; opacity: 1; }
}
